diff --git a/src/tools/3DViewer-web/.DS_Store b/src/tools/3DViewer-web/.DS_Store
new file mode 100644
index 000000000..a4dd99e5e
Binary files /dev/null and b/src/tools/3DViewer-web/.DS_Store differ
diff --git a/src/tools/3DViewer-web/main.js b/src/tools/3DViewer-web/main.js
new file mode 100644
index 000000000..4dbff3089
--- /dev/null
+++ b/src/tools/3DViewer-web/main.js
@@ -0,0 +1,51 @@
+const {app, BrowserWindow, ipcMain} = require('electron')
+const path = require('path')
+const url = require('url')
+
+// Keep a global reference of the window object, if you don't, the window will
+// be closed automatically when the JavaScript object is garbage collected.
+let win
+
+
+function createWindow () {
+ // Create the browser window.
+ win = new BrowserWindow({width: 1800, height: 1080})
+
+ // and load the index.html of the app.
+ win.loadURL(url.format({
+ pathname: path.join(__dirname, 'public/index.html'),
+ protocol: 'file:',
+ slashes: true
+ }))
+
+
+ // Emitted when the window is closed.
+ win.on('closed', () => {
+ // Dereference the window object, usually you would store windows
+ // in an array if your app supports multi windows, this is the time
+ // when you should delete the corresponding element.
+ win = null
+ })
+}
+
+// This method will be called when Electron has finished
+// initialization and is ready to create browser windows.
+// Some APIs can only be used after this event occurs.
+app.on('ready', createWindow)
+
+// Quit when all windows are closed.
+app.on('window-all-closed', () => {
+ // On macOS it is common for applications and their menu bar
+ // to stay active until the user quits explicitly with Cmd + Q
+ if (process.platform !== 'darwin') {
+ app.quit()
+ }
+})
+
+app.on('activate', () => {
+ // On macOS it's common to re-create a window in the app when the
+ // dock icon is clicked and there are no other windows open.
+ if (win === null) {
+ createWindow()
+ }
+})
diff --git a/src/tools/3DViewer-web/package-lock.json b/src/tools/3DViewer-web/package-lock.json
new file mode 100644
index 000000000..4ff93ab56
--- /dev/null
+++ b/src/tools/3DViewer-web/package-lock.json
@@ -0,0 +1,1363 @@
+{
+ "name": "3DViewer",
+ "version": "0.1.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@types/node": {
+ "version": "7.0.51",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.51.tgz",
+ "integrity": "sha512-h5u7FnEnG+Fn44HfknTTvu199FzFWVSo97ToSRWvXl1F11UfN6wGnE7exUy23pFfDn+CeluvEoCoe4l2eCVC3g==",
+ "dev": true
+ },
+ "ajv": {
+ "version": "5.5.2",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
+ "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
+ "dev": true,
+ "requires": {
+ "co": "4.6.0",
+ "fast-deep-equal": "1.0.0",
+ "fast-json-stable-stringify": "2.0.0",
+ "json-schema-traverse": "0.3.1"
+ }
+ },
+ "amdefine": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
+ "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
+ },
+ "ansi-regex": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+ "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+ "dev": true
+ },
+ "argparse": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz",
+ "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=",
+ "requires": {
+ "sprintf-js": "1.0.3"
+ }
+ },
+ "array-find-index": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",
+ "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=",
+ "dev": true
+ },
+ "asn1": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
+ "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=",
+ "dev": true
+ },
+ "assert-plus": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
+ "dev": true
+ },
+ "async": {
+ "version": "0.2.10",
+ "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
+ "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E="
+ },
+ "asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
+ "dev": true
+ },
+ "aws-sign2": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
+ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
+ "dev": true
+ },
+ "aws4": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
+ "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=",
+ "dev": true
+ },
+ "balanced-match": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "dev": true
+ },
+ "bcrypt-pbkdf": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
+ "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "tweetnacl": "0.14.5"
+ }
+ },
+ "boom": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
+ "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
+ "dev": true,
+ "requires": {
+ "hoek": "4.2.0"
+ }
+ },
+ "brace-expansion": {
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
+ "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
+ "dev": true,
+ "requires": {
+ "balanced-match": "1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "builtin-modules": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+ "dev": true
+ },
+ "camelcase": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
+ "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=",
+ "dev": true
+ },
+ "camelcase-keys": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
+ "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
+ "dev": true,
+ "requires": {
+ "camelcase": "2.1.1",
+ "map-obj": "1.0.1"
+ }
+ },
+ "caseless": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
+ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
+ "dev": true
+ },
+ "co": {
+ "version": "4.6.0",
+ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
+ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
+ "dev": true
+ },
+ "code-point-at": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+ "dev": true
+ },
+ "combined-stream": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
+ "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=",
+ "dev": true,
+ "requires": {
+ "delayed-stream": "1.0.0"
+ }
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "concat-stream": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz",
+ "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=",
+ "dev": true,
+ "requires": {
+ "inherits": "2.0.3",
+ "readable-stream": "2.3.3",
+ "typedarray": "0.0.6"
+ },
+ "dependencies": {
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+ "dev": true
+ },
+ "readable-stream": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
+ "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
+ "dev": true,
+ "requires": {
+ "core-util-is": "1.0.2",
+ "inherits": "2.0.3",
+ "isarray": "1.0.0",
+ "process-nextick-args": "1.0.7",
+ "safe-buffer": "5.1.1",
+ "string_decoder": "1.0.3",
+ "util-deprecate": "1.0.2"
+ }
+ },
+ "string_decoder": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
+ "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "5.1.1"
+ }
+ }
+ }
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+ "dev": true
+ },
+ "cryptiles": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz",
+ "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=",
+ "dev": true,
+ "requires": {
+ "boom": "5.2.0"
+ },
+ "dependencies": {
+ "boom": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
+ "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
+ "dev": true,
+ "requires": {
+ "hoek": "4.2.0"
+ }
+ }
+ }
+ },
+ "currently-unhandled": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz",
+ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=",
+ "dev": true,
+ "requires": {
+ "array-find-index": "1.0.2"
+ }
+ },
+ "dashdash": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
+ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "dev": true,
+ "requires": {
+ "assert-plus": "1.0.0"
+ }
+ },
+ "debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "dev": true,
+ "requires": {
+ "ms": "2.0.0"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "dev": true
+ },
+ "deep-extend": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz",
+ "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=",
+ "dev": true
+ },
+ "delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
+ "dev": true
+ },
+ "ecc-jsbn": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
+ "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
+ "dev": true,
+ "optional": true,
+ "requires": {
+ "jsbn": "0.1.1"
+ }
+ },
+ "electron": {
+ "version": "1.7.10",
+ "resolved": "https://registry.npmjs.org/electron/-/electron-1.7.10.tgz",
+ "integrity": "sha1-Oj6D2WX9f6/kc76N349HJWG2JT0=",
+ "dev": true,
+ "requires": {
+ "@types/node": "7.0.51",
+ "electron-download": "3.3.0",
+ "extract-zip": "1.6.6"
+ }
+ },
+ "electron-download": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-3.3.0.tgz",
+ "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=",
+ "dev": true,
+ "requires": {
+ "debug": "2.6.9",
+ "fs-extra": "0.30.0",
+ "home-path": "1.0.5",
+ "minimist": "1.2.0",
+ "nugget": "2.0.1",
+ "path-exists": "2.1.0",
+ "rc": "1.2.2",
+ "semver": "5.4.1",
+ "sumchecker": "1.3.1"
+ }
+ },
+ "error-ex": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz",
+ "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=",
+ "dev": true,
+ "requires": {
+ "is-arrayish": "0.2.1"
+ }
+ },
+ "es6-promise": {
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.2.tgz",
+ "integrity": "sha512-LSas5vsuA6Q4nEdf9wokY5/AJYXry98i0IzXsv49rYsgDGDNDPbqAYR1Pe23iFxygfbGZNR/5VrHXBCh2BhvUQ==",
+ "dev": true
+ },
+ "esprima": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
+ "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw=="
+ },
+ "extend": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
+ "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
+ "dev": true
+ },
+ "extract-zip": {
+ "version": "1.6.6",
+ "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz",
+ "integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=",
+ "dev": true,
+ "requires": {
+ "concat-stream": "1.6.0",
+ "debug": "2.6.9",
+ "mkdirp": "0.5.0",
+ "yauzl": "2.4.1"
+ }
+ },
+ "extsprintf": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
+ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
+ "dev": true
+ },
+ "fast-deep-equal": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz",
+ "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=",
+ "dev": true
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
+ "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
+ "dev": true
+ },
+ "fd-slicer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
+ "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
+ "dev": true,
+ "requires": {
+ "pend": "1.2.0"
+ }
+ },
+ "find-up": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
+ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
+ "dev": true,
+ "requires": {
+ "path-exists": "2.1.0",
+ "pinkie-promise": "2.0.1"
+ }
+ },
+ "forever-agent": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
+ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
+ "dev": true
+ },
+ "form-data": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz",
+ "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=",
+ "dev": true,
+ "requires": {
+ "asynckit": "0.4.0",
+ "combined-stream": "1.0.5",
+ "mime-types": "2.1.17"
+ }
+ },
+ "fs-extra": {
+ "version": "0.30.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz",
+ "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11",
+ "jsonfile": "2.4.0",
+ "klaw": "1.3.1",
+ "path-is-absolute": "1.0.1",
+ "rimraf": "2.6.2"
+ }
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "get-stdin": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
+ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
+ "dev": true
+ },
+ "getpass": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
+ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "dev": true,
+ "requires": {
+ "assert-plus": "1.0.0"
+ }
+ },
+ "glob": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
+ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "1.0.0",
+ "inflight": "1.0.6",
+ "inherits": "2.0.3",
+ "minimatch": "3.0.4",
+ "once": "1.4.0",
+ "path-is-absolute": "1.0.1"
+ }
+ },
+ "graceful-fs": {
+ "version": "4.1.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
+ "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
+ "dev": true
+ },
+ "har-schema": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
+ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
+ "dev": true
+ },
+ "har-validator": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz",
+ "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
+ "dev": true,
+ "requires": {
+ "ajv": "5.5.2",
+ "har-schema": "2.0.0"
+ }
+ },
+ "hawk": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz",
+ "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==",
+ "dev": true,
+ "requires": {
+ "boom": "4.3.1",
+ "cryptiles": "3.1.2",
+ "hoek": "4.2.0",
+ "sntp": "2.1.0"
+ }
+ },
+ "hoek": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz",
+ "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==",
+ "dev": true
+ },
+ "home-path": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/home-path/-/home-path-1.0.5.tgz",
+ "integrity": "sha1-eIspgVsS1Tus9XVkhHbm+QQdEz8=",
+ "dev": true
+ },
+ "hosted-git-info": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz",
+ "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==",
+ "dev": true
+ },
+ "http-signature": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
+ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "dev": true,
+ "requires": {
+ "assert-plus": "1.0.0",
+ "jsprim": "1.4.1",
+ "sshpk": "1.13.1"
+ }
+ },
+ "ice": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/ice/-/ice-3.7.0.tgz",
+ "integrity": "sha512-kXKP3xxP4f0aAnFlJTeJwmhJmWz7vkww7xvrr0S0wdVvUD4nr/kxuGor5iCNGU5jc00oAHw2FZ+1lBsoahchwg==",
+ "dev": true
+ },
+ "indent-string": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
+ "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
+ "dev": true,
+ "requires": {
+ "repeating": "2.0.1"
+ }
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "requires": {
+ "once": "1.4.0",
+ "wrappy": "1.0.2"
+ }
+ },
+ "inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
+ "dev": true
+ },
+ "ini": {
+ "version": "1.3.5",
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
+ "dev": true
+ },
+ "is-arrayish": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
+ "dev": true
+ },
+ "is-builtin-module": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
+ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
+ "dev": true,
+ "requires": {
+ "builtin-modules": "1.1.1"
+ }
+ },
+ "is-finite": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
+ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "1.0.1"
+ }
+ },
+ "is-fullwidth-code-point": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+ "dev": true,
+ "requires": {
+ "number-is-nan": "1.0.1"
+ }
+ },
+ "is-typedarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
+ "dev": true
+ },
+ "is-utf8": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
+ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
+ "dev": true
+ },
+ "isarray": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
+ "dev": true
+ },
+ "isstream": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
+ "dev": true
+ },
+ "js-yaml": {
+ "version": "3.10.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz",
+ "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==",
+ "requires": {
+ "argparse": "1.0.9",
+ "esprima": "4.0.0"
+ }
+ },
+ "jsbn": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
+ "dev": true,
+ "optional": true
+ },
+ "json-schema": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
+ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
+ "dev": true
+ },
+ "json-schema-traverse": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
+ "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
+ "dev": true
+ },
+ "json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
+ "dev": true
+ },
+ "jsonfile": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
+ "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11"
+ }
+ },
+ "jsprim": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
+ "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+ "dev": true,
+ "requires": {
+ "assert-plus": "1.0.0",
+ "extsprintf": "1.3.0",
+ "json-schema": "0.2.3",
+ "verror": "1.10.0"
+ }
+ },
+ "klaw": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
+ "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11"
+ }
+ },
+ "load-json-file": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
+ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11",
+ "parse-json": "2.2.0",
+ "pify": "2.3.0",
+ "pinkie-promise": "2.0.1",
+ "strip-bom": "2.0.0"
+ }
+ },
+ "loud-rejection": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
+ "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=",
+ "dev": true,
+ "requires": {
+ "currently-unhandled": "0.4.1",
+ "signal-exit": "3.0.2"
+ }
+ },
+ "map-obj": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
+ "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
+ "dev": true
+ },
+ "meow": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
+ "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
+ "dev": true,
+ "requires": {
+ "camelcase-keys": "2.1.0",
+ "decamelize": "1.2.0",
+ "loud-rejection": "1.6.0",
+ "map-obj": "1.0.1",
+ "minimist": "1.2.0",
+ "normalize-package-data": "2.4.0",
+ "object-assign": "4.1.1",
+ "read-pkg-up": "1.0.1",
+ "redent": "1.0.0",
+ "trim-newlines": "1.0.0"
+ }
+ },
+ "mime-db": {
+ "version": "1.30.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz",
+ "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=",
+ "dev": true
+ },
+ "mime-types": {
+ "version": "2.1.17",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz",
+ "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=",
+ "dev": true,
+ "requires": {
+ "mime-db": "1.30.0"
+ }
+ },
+ "minimatch": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "1.1.8"
+ }
+ },
+ "minimist": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+ "dev": true
+ },
+ "mkdirp": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz",
+ "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=",
+ "dev": true,
+ "requires": {
+ "minimist": "0.0.8"
+ },
+ "dependencies": {
+ "minimist": {
+ "version": "0.0.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+ "dev": true
+ }
+ }
+ },
+ "ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
+ "dev": true
+ },
+ "normalize-package-data": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
+ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
+ "dev": true,
+ "requires": {
+ "hosted-git-info": "2.5.0",
+ "is-builtin-module": "1.0.0",
+ "semver": "5.4.1",
+ "validate-npm-package-license": "3.0.1"
+ }
+ },
+ "nugget": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/nugget/-/nugget-2.0.1.tgz",
+ "integrity": "sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA=",
+ "dev": true,
+ "requires": {
+ "debug": "2.6.9",
+ "minimist": "1.2.0",
+ "pretty-bytes": "1.0.4",
+ "progress-stream": "1.2.0",
+ "request": "2.83.0",
+ "single-line-log": "1.1.2",
+ "throttleit": "0.0.2"
+ }
+ },
+ "number-is-nan": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+ "dev": true
+ },
+ "oauth-sign": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
+ "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=",
+ "dev": true
+ },
+ "object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+ "dev": true
+ },
+ "object-keys": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz",
+ "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=",
+ "dev": true
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "requires": {
+ "wrappy": "1.0.2"
+ }
+ },
+ "optimist": {
+ "version": "0.3.7",
+ "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
+ "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=",
+ "requires": {
+ "wordwrap": "0.0.3"
+ }
+ },
+ "parse-json": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
+ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
+ "dev": true,
+ "requires": {
+ "error-ex": "1.3.1"
+ }
+ },
+ "path-exists": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
+ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
+ "dev": true,
+ "requires": {
+ "pinkie-promise": "2.0.1"
+ }
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
+ },
+ "path-type": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
+ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
+ "dev": true,
+ "requires": {
+ "graceful-fs": "4.1.11",
+ "pify": "2.3.0",
+ "pinkie-promise": "2.0.1"
+ }
+ },
+ "pend": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
+ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=",
+ "dev": true
+ },
+ "performance-now": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
+ "dev": true
+ },
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+ "dev": true
+ },
+ "pinkie": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
+ "dev": true
+ },
+ "pinkie-promise": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+ "dev": true,
+ "requires": {
+ "pinkie": "2.0.4"
+ }
+ },
+ "pretty-bytes": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz",
+ "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=",
+ "dev": true,
+ "requires": {
+ "get-stdin": "4.0.1",
+ "meow": "3.7.0"
+ }
+ },
+ "process-nextick-args": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
+ "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
+ "dev": true
+ },
+ "progress-stream": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/progress-stream/-/progress-stream-1.2.0.tgz",
+ "integrity": "sha1-LNPP6jO6OonJwSHsM0er6asSX3c=",
+ "dev": true,
+ "requires": {
+ "speedometer": "0.1.4",
+ "through2": "0.2.3"
+ }
+ },
+ "punycode": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
+ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
+ "dev": true
+ },
+ "qs": {
+ "version": "6.5.1",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
+ "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==",
+ "dev": true
+ },
+ "rc": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz",
+ "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=",
+ "dev": true,
+ "requires": {
+ "deep-extend": "0.4.2",
+ "ini": "1.3.5",
+ "minimist": "1.2.0",
+ "strip-json-comments": "2.0.1"
+ }
+ },
+ "read-pkg": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
+ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
+ "dev": true,
+ "requires": {
+ "load-json-file": "1.1.0",
+ "normalize-package-data": "2.4.0",
+ "path-type": "1.1.0"
+ }
+ },
+ "read-pkg-up": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
+ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
+ "dev": true,
+ "requires": {
+ "find-up": "1.1.2",
+ "read-pkg": "1.1.0"
+ }
+ },
+ "readable-stream": {
+ "version": "1.1.14",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
+ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
+ "dev": true,
+ "requires": {
+ "core-util-is": "1.0.2",
+ "inherits": "2.0.3",
+ "isarray": "0.0.1",
+ "string_decoder": "0.10.31"
+ }
+ },
+ "redent": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz",
+ "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=",
+ "dev": true,
+ "requires": {
+ "indent-string": "2.1.0",
+ "strip-indent": "1.0.1"
+ }
+ },
+ "repeating": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
+ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
+ "dev": true,
+ "requires": {
+ "is-finite": "1.0.2"
+ }
+ },
+ "request": {
+ "version": "2.83.0",
+ "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz",
+ "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==",
+ "dev": true,
+ "requires": {
+ "aws-sign2": "0.7.0",
+ "aws4": "1.6.0",
+ "caseless": "0.12.0",
+ "combined-stream": "1.0.5",
+ "extend": "3.0.1",
+ "forever-agent": "0.6.1",
+ "form-data": "2.3.1",
+ "har-validator": "5.0.3",
+ "hawk": "6.0.2",
+ "http-signature": "1.2.0",
+ "is-typedarray": "1.0.0",
+ "isstream": "0.1.2",
+ "json-stringify-safe": "5.0.1",
+ "mime-types": "2.1.17",
+ "oauth-sign": "0.8.2",
+ "performance-now": "2.1.0",
+ "qs": "6.5.1",
+ "safe-buffer": "5.1.1",
+ "stringstream": "0.0.5",
+ "tough-cookie": "2.3.3",
+ "tunnel-agent": "0.6.0",
+ "uuid": "3.1.0"
+ }
+ },
+ "require": {
+ "version": "2.4.20",
+ "resolved": "https://registry.npmjs.org/require/-/require-2.4.20.tgz",
+ "integrity": "sha1-Zstrqqu2XeinHXk/XGX9GE83mLY=",
+ "requires": {
+ "std": "0.1.40",
+ "uglify-js": "2.3.0"
+ }
+ },
+ "rimraf": {
+ "version": "2.6.2",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
+ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
+ "dev": true,
+ "requires": {
+ "glob": "7.1.2"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
+ "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.4.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
+ "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
+ "dev": true
+ },
+ "signal-exit": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
+ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
+ "dev": true
+ },
+ "single-line-log": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-1.1.2.tgz",
+ "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=",
+ "dev": true,
+ "requires": {
+ "string-width": "1.0.2"
+ }
+ },
+ "sntp": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz",
+ "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==",
+ "dev": true,
+ "requires": {
+ "hoek": "4.2.0"
+ }
+ },
+ "source-map": {
+ "version": "0.1.43",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
+ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
+ "requires": {
+ "amdefine": "1.0.1"
+ }
+ },
+ "spdx-correct": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz",
+ "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=",
+ "dev": true,
+ "requires": {
+ "spdx-license-ids": "1.2.2"
+ }
+ },
+ "spdx-expression-parse": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
+ "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
+ "dev": true
+ },
+ "spdx-license-ids": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz",
+ "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=",
+ "dev": true
+ },
+ "speedometer": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/speedometer/-/speedometer-0.1.4.tgz",
+ "integrity": "sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=",
+ "dev": true
+ },
+ "sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+ },
+ "sshpk": {
+ "version": "1.13.1",
+ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz",
+ "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=",
+ "dev": true,
+ "requires": {
+ "asn1": "0.2.3",
+ "assert-plus": "1.0.0",
+ "bcrypt-pbkdf": "1.0.1",
+ "dashdash": "1.14.1",
+ "ecc-jsbn": "0.1.1",
+ "getpass": "0.1.7",
+ "jsbn": "0.1.1",
+ "tweetnacl": "0.14.5"
+ }
+ },
+ "std": {
+ "version": "0.1.40",
+ "resolved": "https://registry.npmjs.org/std/-/std-0.1.40.tgz",
+ "integrity": "sha1-Nnil9lCU2eG2teJu2/wCErg0K3E="
+ },
+ "string-width": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+ "dev": true,
+ "requires": {
+ "code-point-at": "1.1.0",
+ "is-fullwidth-code-point": "1.0.0",
+ "strip-ansi": "3.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "0.10.31",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
+ "dev": true
+ },
+ "stringstream": {
+ "version": "0.0.5",
+ "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
+ "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+ "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "2.1.1"
+ }
+ },
+ "strip-bom": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
+ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
+ "dev": true,
+ "requires": {
+ "is-utf8": "0.2.1"
+ }
+ },
+ "strip-indent": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz",
+ "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=",
+ "dev": true,
+ "requires": {
+ "get-stdin": "4.0.1"
+ }
+ },
+ "strip-json-comments": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+ "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+ "dev": true
+ },
+ "sumchecker": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-1.3.1.tgz",
+ "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=",
+ "dev": true,
+ "requires": {
+ "debug": "2.6.9",
+ "es6-promise": "4.2.2"
+ }
+ },
+ "throttleit": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz",
+ "integrity": "sha1-z+34jmDADdlpe2H90qg0OptoDq8=",
+ "dev": true
+ },
+ "through2": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz",
+ "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=",
+ "dev": true,
+ "requires": {
+ "readable-stream": "1.1.14",
+ "xtend": "2.1.2"
+ }
+ },
+ "tough-cookie": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz",
+ "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=",
+ "dev": true,
+ "requires": {
+ "punycode": "1.4.1"
+ }
+ },
+ "trim-newlines": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz",
+ "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
+ "dev": true
+ },
+ "tunnel-agent": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "5.1.1"
+ }
+ },
+ "tweetnacl": {
+ "version": "0.14.5",
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
+ "dev": true,
+ "optional": true
+ },
+ "typedarray": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
+ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
+ "dev": true
+ },
+ "uglify-js": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.0.tgz",
+ "integrity": "sha1-LN7BbTeKiituz7aYl4TPi3rlSR8=",
+ "requires": {
+ "async": "0.2.10",
+ "optimist": "0.3.7",
+ "source-map": "0.1.43"
+ }
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
+ "dev": true
+ },
+ "uuid": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
+ "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==",
+ "dev": true
+ },
+ "validate-npm-package-license": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz",
+ "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=",
+ "dev": true,
+ "requires": {
+ "spdx-correct": "1.0.2",
+ "spdx-expression-parse": "1.0.4"
+ }
+ },
+ "verror": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
+ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "dev": true,
+ "requires": {
+ "assert-plus": "1.0.0",
+ "core-util-is": "1.0.2",
+ "extsprintf": "1.3.0"
+ }
+ },
+ "wordwrap": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
+ "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc="
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "xtend": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz",
+ "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=",
+ "dev": true,
+ "requires": {
+ "object-keys": "0.4.0"
+ }
+ },
+ "yauzl": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz",
+ "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=",
+ "dev": true,
+ "requires": {
+ "fd-slicer": "1.0.1"
+ }
+ }
+ }
+}
diff --git a/src/tools/3DViewer-web/package.json b/src/tools/3DViewer-web/package.json
new file mode 100644
index 000000000..eaef08db4
--- /dev/null
+++ b/src/tools/3DViewer-web/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "3DViewer",
+ "version": "0.1.0",
+ "main": "main.js",
+ "scripts": {
+ "start": "electron ."
+ },
+ "dependencies": {
+ "js-yaml": "^3.10.0",
+ "require": "^2.4.20"
+ },
+ "devDependencies": {
+ "electron": "^1.7.10",
+ "ice": "^3.7.0"
+ }
+}
diff --git a/src/tools/3DViewer-web/public/config.yml b/src/tools/3DViewer-web/public/config.yml
new file mode 100644
index 000000000..b3688405a
--- /dev/null
+++ b/src/tools/3DViewer-web/public/config.yml
@@ -0,0 +1,3 @@
+Server: "localhost"
+Port: "11000"
+Name: "3DViwer"
diff --git a/src/tools/3DViewer-web/public/img/disc.png b/src/tools/3DViewer-web/public/img/disc.png
new file mode 100644
index 000000000..92572c622
Binary files /dev/null and b/src/tools/3DViewer-web/public/img/disc.png differ
diff --git a/src/tools/3DViewer-web/public/index.html b/src/tools/3DViewer-web/public/index.html
new file mode 100644
index 000000000..f5e7edf22
--- /dev/null
+++ b/src/tools/3DViewer-web/public/index.html
@@ -0,0 +1,29 @@
+
+
+
+ 3DViewer
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/tools/3DViewer-web/public/js/3DViewer.js b/src/tools/3DViewer-web/public/js/3DViewer.js
new file mode 100644
index 000000000..ac35b03ca
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/3DViewer.js
@@ -0,0 +1,83 @@
+let config = {};
+var w;
+try{
+ const yaml = require('js-yaml');
+ const fs = require('fs');
+ config = yaml.safeLoad(fs.readFileSync('public/config.yml', 'utf8'))
+} catch (e) {
+ config.Server = "localhost";
+ config.Port = "11000";
+}
+ function startWorker(){
+ if(typeof(Worker) !== "undefined") {
+ if(typeof(w) == "undefined") {
+ w = new Worker("js/3DViewer_worker.js");
+ w.postMessage({func:"Start",server:config.Server, port:config.Port});
+ }
+ } else {
+ Console.log("Sorry, your browser does not support Web Workers...");
+ }
+ w.onmessage = function(event) {
+ if (event.data.func == "Connect"){
+ console.log(event.data.func);
+ setLine();
+ } else {
+ console.log(event.data);
+ w.terminate();
+ }
+ }
+ }
+
+ function stop(){
+ if(typeof(w) != "undefined") {
+ w.postMessage({func:"Stop"});
+ w.onmessage = function(event) {
+ if (event.data.func == "Disconnect"){
+ w.terminate();
+ w = undefined;
+ }
+ }}
+ }
+
+ function setLine(){
+ w.postMessage({func:"setLine"});
+ w.onmessage = function(event){
+ if (event.data.length > 0){
+ segments = event.data;
+ for (var i = 0; i < segments.length; i+=1) {
+ addLine(segments[i]);
+ }
+ setPoint();
+ }}
+ }
+
+ function setPoint(){
+ w.postMessage({func:"setPoint"});
+ w.onmessage = function(event) {
+ if (event.data.func == "drawPoint"){
+ points = event.data.points;
+ for (var i = 0; i < points.length; i+=1) {
+ addPoint(points[i]);
+ }
+ setInterval(setPoint(),1000);
+ }}
+ }
+
+ function clearAll(){
+ if(typeof(w) == "undefined") {
+ deleteObj();
+ console.log("Clear all");
+ startWorker();
+ } else {
+ w.postMessage({func:"ClearAll"});
+ w.onmessage = function(event) {
+ if (event.data.func == "ClearAll"){
+ if(typeof(w) != "undefined") {
+ w.terminate();
+ w = undefined;
+ }
+ deleteObj();
+ startWorker();
+ }}
+ }
+ }
diff --git a/src/tools/3DViewer-web/public/js/3DViewer_worker.js b/src/tools/3DViewer-web/public/js/3DViewer_worker.js
new file mode 100644
index 000000000..08521b069
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/3DViewer_worker.js
@@ -0,0 +1,83 @@
+// variables to make believe to ICE that is in the main thread
+var window=self;
+var global=self;
+
+// importing required files
+importScripts('jderobot/Ice.min.js');
+importScripts('jderobot/datetime.js');
+importScripts('jderobot/exceptions.js');
+importScripts('jderobot/containers.js');
+importScripts('jderobot/common.js');
+importScripts('jderobot/image.js');
+importScripts('jderobot/primitives.js');
+importScripts('jderobot/visualization.js')
+importScripts('jderobot/camera.js');
+
+// variables related to the configuration and connection of ICE
+var ic = Ice.initialize();
+var communicator;
+var Promise;
+var Prx = jderobot.VisualizationPrx;
+var srv;
+
+function connect(server,port){
+ endpoint = "ws -h " + server + " -p " + port;
+ var proxy = ic.stringToProxy("3DViewer:" + endpoint);
+ Promise = Prx.checkedCast(proxy).then(
+ function(printer)
+ {
+ srv = printer;
+ self.postMessage({func:"Connect"});
+ });
+}
+
+function setPoint(point){
+ srv.getPoints().then(function(data){
+ point = data;
+ self.postMessage({func:"drawPoint",points: point});
+ });
+}
+
+function setLine(){
+ srv.getSegment().then(function(data){
+ segments = data;
+ self.postMessage(segments);
+ });
+}
+
+function clearAll(){
+ srv.clearAll().then(function(data){
+ console.log("Clear all");
+ self.postMessage({func:"ClearAll"});
+ });
+}
+
+function disconnect(){
+ console.log("Disconnect");
+ srv = undefined;
+ self.postMessage({func:"Disconnect"});
+}
+
+onmessage = function(e) {
+
+ switch (e.data.func){
+ case "Start":
+ var server = e.data.server;
+ var port = e.data.port;
+ connect(server,port);
+ break;
+ case "Stop":
+ disconnect();
+ break;
+ case "ClearAll":
+ clearAll();
+ case "setLine":
+ var seg = [];
+ var color = [];
+ setLine();
+ case "setPoint":
+ var point = []
+ setPoint(point);
+ break;
+ }
+}
diff --git a/src/tools/3DViewer-web/public/js/GUI.js b/src/tools/3DViewer-web/public/js/GUI.js
new file mode 100644
index 000000000..10fbcb70d
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/GUI.js
@@ -0,0 +1,101 @@
+
+var camera, scene, renderer, controls;
+var axes, grid, particles;
+var obj_active, obj;
+var rotationx = 0.0;
+var rotationy = 0.0;
+
+
+ function init() {
+ camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 1000 );
+ camera.position.z = 300;
+ camera.position.y = 50;
+ camera.position.x = 100;
+ scene = new THREE.Scene();
+ renderer = new THREE.WebGLRenderer();
+ renderer.setSize( window.innerWidth, window.innerHeight);
+ renderer.setClearColor(0x58D3F7);
+ document.getElementById("canvas").appendChild( renderer.domElement );
+ controls = new THREE.OrbitControls(camera, renderer.domElement);
+ window.addEventListener( 'resize', onWindowResize, false );
+ }
+ function onWindowResize() {
+ camera.aspect = window.innerWidth / window.innerHeight;
+ camera.updateProjectionMatrix();
+ renderer.setSize( window.innerWidth, window.innerHeight );
+ }
+ function animate() {
+ requestAnimationFrame( animate );
+ renderer.render( scene, camera );
+ }
+
+ function addAxes (){
+ axes = new THREE.Object3D();
+ axes.add(buildAxis(new THREE.Vector3(0,0,0),new THREE.Vector3(1000,0,0), 0xFF0000, false)); //x
+ axes.add(buildAxis(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1000,0), 0x00FF00, false)); //Y
+ axes.add(buildAxis(new THREE.Vector3(0,0,0),new THREE.Vector3(0,0,1000), 0x0000FF, false)); //Z
+ scene.add(axes);
+ }
+
+ function buildAxis (src,dst, colorHex, dashed){
+ var geom = new THREE.Geometry();
+ var mat;
+ if (dashed){
+ mat = new THREE.LineDashedMaterial({linewidth: 3, color: colorHex, dashSize: 3, gapSize:3});
+ } else {
+ mat = new THREE.LineBasicMaterial({linewidth:3, color: colorHex});
+ }
+ geom.vertices.push(src.clone());
+ geom.vertices.push(dst.clone());
+ geom.computeLineDistances();
+
+ var axis = new THREE.Line (geom, mat, THREE.LineSegments);
+ return axis;
+ }
+ function addGrid(){
+ grid = new THREE.GridHelper( 1000, 100, 0x888888, 0x888888);
+ grid.position.set(0,-0.1,0);
+ scene.add(grid);
+ }
+
+
+ function addPoint (point){
+ var geometry = new THREE.Geometry();
+ geometry.vertices.push( new THREE.Vector3(point.x,point.z,point.y));
+ var sprite = new THREE.TextureLoader().load("img/disc.png");
+ var material = new THREE.PointsMaterial( { size: 8, sizeAttenuation: false, map: sprite, alphaTest: 0.5, transparent: true } );
+ material.color.setRGB( point.r, point.g, point.b);
+ var particles = new THREE.Points( geometry, material );
+ particles.name ="point";
+ obj = "Sphere";
+ obj_active = particles;
+ scene.add( particles );
+ }
+
+ function addLine(segment){
+ var geometry = new THREE.Geometry();
+ geometry.vertices.push(
+ new THREE.Vector3(segment.seg.fromPoint.x,segment.seg.fromPoint.z,segment.seg.fromPoint.y),
+ new THREE.Vector3(segment.seg.toPoint.x,segment.seg.toPoint.z,segment.seg.toPoint.y),
+ new THREE.Vector3(segment.seg.fromPoint.x,segment.seg.fromPoint.z,segment.seg.fromPoint.y));
+ var material = new THREE.LineBasicMaterial();
+ material.color.setRGB(segment.c.r,segment.c.g, segment.c.b)
+ line = new THREE.Line(geometry,material);
+ scene.add(line);
+ }
+
+ function deleteObj(){
+ var selectedObject = scene.getObjectByName("point");
+ while (selectedObject != null) {
+ scene.remove(selectedObject);
+ selectedObject = scene.getObjectByName("point");
+ }
+ }
+
+ function webGLStart (){
+ init();
+ //addGrid();
+ //addAxes();
+ animate();
+ startWorker();
+ }
diff --git a/src/tools/3DViewer-web/public/js/OrbitControls.js b/src/tools/3DViewer-web/public/js/OrbitControls.js
new file mode 100644
index 000000000..44d7e92e7
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/OrbitControls.js
@@ -0,0 +1,1042 @@
+/**
+ * @author qiao / https://github.com/qiao
+ * @author mrdoob / http://mrdoob.com
+ * @author alteredq / http://alteredqualia.com/
+ * @author WestLangley / http://github.com/WestLangley
+ * @author erich666 / http://erichaines.com
+ */
+
+// This set of controls performs orbiting, dollying (zooming), and panning.
+// Unlike TrackballControls, it maintains the "up" direction object.up (+Y by default).
+//
+// Orbit - left mouse / touch: one finger move
+// Zoom - middle mouse, or mousewheel / touch: two finger spread or squish
+// Pan - right mouse, or arrow keys / touch: three finger swipe
+
+THREE.OrbitControls = function ( object, domElement ) {
+
+ this.object = object;
+
+ this.domElement = ( domElement !== undefined ) ? domElement : document;
+
+ // Set to false to disable this control
+ this.enabled = true;
+
+ // "target" sets the location of focus, where the object orbits around
+ this.target = new THREE.Vector3();
+
+ // How far you can dolly in and out ( PerspectiveCamera only )
+ this.minDistance = 0;
+ this.maxDistance = Infinity;
+
+ // How far you can zoom in and out ( OrthographicCamera only )
+ this.minZoom = 0;
+ this.maxZoom = Infinity;
+
+ // How far you can orbit vertically, upper and lower limits.
+ // Range is 0 to Math.PI radians.
+ this.minPolarAngle = 0; // radians
+ this.maxPolarAngle = Math.PI; // radians
+
+ // How far you can orbit horizontally, upper and lower limits.
+ // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].
+ this.minAzimuthAngle = - Infinity; // radians
+ this.maxAzimuthAngle = Infinity; // radians
+
+ // Set to true to enable damping (inertia)
+ // If damping is enabled, you must call controls.update() in your animation loop
+ this.enableDamping = false;
+ this.dampingFactor = 0.25;
+
+ // This option actually enables dollying in and out; left as "zoom" for backwards compatibility.
+ // Set to false to disable zooming
+ this.enableZoom = true;
+ this.zoomSpeed = 1.0;
+
+ // Set to false to disable rotating
+ this.enableRotate = true;
+ this.rotateSpeed = 1.0;
+
+ // Set to false to disable panning
+ this.enablePan = true;
+ this.keyPanSpeed = 7.0; // pixels moved per arrow key push
+
+ // Set to true to automatically rotate around the target
+ // If auto-rotate is enabled, you must call controls.update() in your animation loop
+ this.autoRotate = false;
+ this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60
+
+ // Set to false to disable use of the keys
+ this.enableKeys = true;
+
+ // The four arrow keys
+ this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };
+
+ // Mouse buttons
+ this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };
+
+ // for reset
+ this.target0 = this.target.clone();
+ this.position0 = this.object.position.clone();
+ this.zoom0 = this.object.zoom;
+
+ //
+ // public methods
+ //
+
+ this.getPolarAngle = function () {
+
+ return spherical.phi;
+
+ };
+
+ this.getAzimuthalAngle = function () {
+
+ return spherical.theta;
+
+ };
+
+ this.saveState = function () {
+
+ scope.target0.copy( scope.target );
+ scope.position0.copy( scope.object.position );
+ scope.zoom0 = scope.object.zoom;
+
+ };
+
+ this.reset = function () {
+
+ scope.target.copy( scope.target0 );
+ scope.object.position.copy( scope.position0 );
+ scope.object.zoom = scope.zoom0;
+
+ scope.object.updateProjectionMatrix();
+ scope.dispatchEvent( changeEvent );
+
+ scope.update();
+
+ state = STATE.NONE;
+
+ };
+
+ // this method is exposed, but perhaps it would be better if we can make it private...
+ this.update = function () {
+
+ var offset = new THREE.Vector3();
+
+ // so camera.up is the orbit axis
+ var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );
+ var quatInverse = quat.clone().inverse();
+
+ var lastPosition = new THREE.Vector3();
+ var lastQuaternion = new THREE.Quaternion();
+
+ return function update() {
+
+ var position = scope.object.position;
+
+ offset.copy( position ).sub( scope.target );
+
+ // rotate offset to "y-axis-is-up" space
+ offset.applyQuaternion( quat );
+
+ // angle from z-axis around y-axis
+ spherical.setFromVector3( offset );
+
+ if ( scope.autoRotate && state === STATE.NONE ) {
+
+ rotateLeft( getAutoRotationAngle() );
+
+ }
+
+ spherical.theta += sphericalDelta.theta;
+ spherical.phi += sphericalDelta.phi;
+
+ // restrict theta to be between desired limits
+ spherical.theta = Math.max( scope.minAzimuthAngle, Math.min( scope.maxAzimuthAngle, spherical.theta ) );
+
+ // restrict phi to be between desired limits
+ spherical.phi = Math.max( scope.minPolarAngle, Math.min( scope.maxPolarAngle, spherical.phi ) );
+
+ spherical.makeSafe();
+
+
+ spherical.radius *= scale;
+
+ // restrict radius to be between desired limits
+ spherical.radius = Math.max( scope.minDistance, Math.min( scope.maxDistance, spherical.radius ) );
+
+ // move target to panned location
+ scope.target.add( panOffset );
+
+ offset.setFromSpherical( spherical );
+
+ // rotate offset back to "camera-up-vector-is-up" space
+ offset.applyQuaternion( quatInverse );
+
+ position.copy( scope.target ).add( offset );
+
+ scope.object.lookAt( scope.target );
+
+ if ( scope.enableDamping === true ) {
+
+ sphericalDelta.theta *= ( 1 - scope.dampingFactor );
+ sphericalDelta.phi *= ( 1 - scope.dampingFactor );
+
+ } else {
+
+ sphericalDelta.set( 0, 0, 0 );
+
+ }
+
+ scale = 1;
+ panOffset.set( 0, 0, 0 );
+
+ // update condition is:
+ // min(camera displacement, camera rotation in radians)^2 > EPS
+ // using small-angle approximation cos(x/2) = 1 - x^2 / 8
+
+ if ( zoomChanged ||
+ lastPosition.distanceToSquared( scope.object.position ) > EPS ||
+ 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) {
+
+ scope.dispatchEvent( changeEvent );
+
+ lastPosition.copy( scope.object.position );
+ lastQuaternion.copy( scope.object.quaternion );
+ zoomChanged = false;
+
+ return true;
+
+ }
+
+ return false;
+
+ };
+
+ }();
+
+ this.dispose = function () {
+
+ scope.domElement.removeEventListener( 'contextmenu', onContextMenu, false );
+ scope.domElement.removeEventListener( 'mousedown', onMouseDown, false );
+ scope.domElement.removeEventListener( 'wheel', onMouseWheel, false );
+
+ scope.domElement.removeEventListener( 'touchstart', onTouchStart, false );
+ scope.domElement.removeEventListener( 'touchend', onTouchEnd, false );
+ scope.domElement.removeEventListener( 'touchmove', onTouchMove, false );
+
+ document.removeEventListener( 'mousemove', onMouseMove, false );
+ document.removeEventListener( 'mouseup', onMouseUp, false );
+
+ window.removeEventListener( 'keydown', onKeyDown, false );
+
+ //scope.dispatchEvent( { type: 'dispose' } ); // should this be added here?
+
+ };
+
+ //
+ // internals
+ //
+
+ var scope = this;
+
+ var changeEvent = { type: 'change' };
+ var startEvent = { type: 'start' };
+ var endEvent = { type: 'end' };
+
+ var STATE = { NONE: - 1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY: 4, TOUCH_PAN: 5 };
+
+ var state = STATE.NONE;
+
+ var EPS = 0.000001;
+
+ // current position in spherical coordinates
+ var spherical = new THREE.Spherical();
+ var sphericalDelta = new THREE.Spherical();
+
+ var scale = 1;
+ var panOffset = new THREE.Vector3();
+ var zoomChanged = false;
+
+ var rotateStart = new THREE.Vector2();
+ var rotateEnd = new THREE.Vector2();
+ var rotateDelta = new THREE.Vector2();
+
+ var panStart = new THREE.Vector2();
+ var panEnd = new THREE.Vector2();
+ var panDelta = new THREE.Vector2();
+
+ var dollyStart = new THREE.Vector2();
+ var dollyEnd = new THREE.Vector2();
+ var dollyDelta = new THREE.Vector2();
+
+ function getAutoRotationAngle() {
+
+ return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
+
+ }
+
+ function getZoomScale() {
+
+ return Math.pow( 0.95, scope.zoomSpeed );
+
+ }
+
+ function rotateLeft( angle ) {
+
+ sphericalDelta.theta -= angle;
+
+ }
+
+ function rotateUp( angle ) {
+
+ sphericalDelta.phi -= angle;
+
+ }
+
+ var panLeft = function () {
+
+ var v = new THREE.Vector3();
+
+ return function panLeft( distance, objectMatrix ) {
+
+ v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix
+ v.multiplyScalar( - distance );
+
+ panOffset.add( v );
+
+ };
+
+ }();
+
+ var panUp = function () {
+
+ var v = new THREE.Vector3();
+
+ return function panUp( distance, objectMatrix ) {
+
+ v.setFromMatrixColumn( objectMatrix, 1 ); // get Y column of objectMatrix
+ v.multiplyScalar( distance );
+
+ panOffset.add( v );
+
+ };
+
+ }();
+
+ // deltaX and deltaY are in pixels; right and down are positive
+ var pan = function () {
+
+ var offset = new THREE.Vector3();
+
+ return function pan( deltaX, deltaY ) {
+
+ var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
+
+ if ( scope.object.isPerspectiveCamera ) {
+
+ // perspective
+ var position = scope.object.position;
+ offset.copy( position ).sub( scope.target );
+ var targetDistance = offset.length();
+
+ // half of the fov is center to top of screen
+ targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );
+
+ // we actually don't use screenWidth, since perspective camera is fixed to screen height
+ panLeft( 2 * deltaX * targetDistance / element.clientHeight, scope.object.matrix );
+ panUp( 2 * deltaY * targetDistance / element.clientHeight, scope.object.matrix );
+
+ } else if ( scope.object.isOrthographicCamera ) {
+
+ // orthographic
+ panLeft( deltaX * ( scope.object.right - scope.object.left ) / scope.object.zoom / element.clientWidth, scope.object.matrix );
+ panUp( deltaY * ( scope.object.top - scope.object.bottom ) / scope.object.zoom / element.clientHeight, scope.object.matrix );
+
+ } else {
+
+ // camera neither orthographic nor perspective
+ console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );
+ scope.enablePan = false;
+
+ }
+
+ };
+
+ }();
+
+ function dollyIn( dollyScale ) {
+
+ if ( scope.object.isPerspectiveCamera ) {
+
+ scale /= dollyScale;
+
+ } else if ( scope.object.isOrthographicCamera ) {
+
+ scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom * dollyScale ) );
+ scope.object.updateProjectionMatrix();
+ zoomChanged = true;
+
+ } else {
+
+ console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
+ scope.enableZoom = false;
+
+ }
+
+ }
+
+ function dollyOut( dollyScale ) {
+
+ if ( scope.object.isPerspectiveCamera ) {
+
+ scale *= dollyScale;
+
+ } else if ( scope.object.isOrthographicCamera ) {
+
+ scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / dollyScale ) );
+ scope.object.updateProjectionMatrix();
+ zoomChanged = true;
+
+ } else {
+
+ console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );
+ scope.enableZoom = false;
+
+ }
+
+ }
+
+ //
+ // event callbacks - update the object state
+ //
+
+ function handleMouseDownRotate( event ) {
+
+ //console.log( 'handleMouseDownRotate' );
+
+ rotateStart.set( event.clientX, event.clientY );
+
+ }
+
+ function handleMouseDownDolly( event ) {
+
+ //console.log( 'handleMouseDownDolly' );
+
+ dollyStart.set( event.clientX, event.clientY );
+
+ }
+
+ function handleMouseDownPan( event ) {
+
+ //console.log( 'handleMouseDownPan' );
+
+ panStart.set( event.clientX, event.clientY );
+
+ }
+
+ function handleMouseMoveRotate( event ) {
+
+ //console.log( 'handleMouseMoveRotate' );
+
+ rotateEnd.set( event.clientX, event.clientY );
+ rotateDelta.subVectors( rotateEnd, rotateStart );
+
+ var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
+
+ // rotating across whole screen goes 360 degrees around
+ rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );
+
+ // rotating up and down along whole screen attempts to go 360, but limited to 180
+ rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );
+
+ rotateStart.copy( rotateEnd );
+
+ scope.update();
+
+ }
+
+ function handleMouseMoveDolly( event ) {
+
+ //console.log( 'handleMouseMoveDolly' );
+
+ dollyEnd.set( event.clientX, event.clientY );
+
+ dollyDelta.subVectors( dollyEnd, dollyStart );
+
+ if ( dollyDelta.y > 0 ) {
+
+ dollyIn( getZoomScale() );
+
+ } else if ( dollyDelta.y < 0 ) {
+
+ dollyOut( getZoomScale() );
+
+ }
+
+ dollyStart.copy( dollyEnd );
+
+ scope.update();
+
+ }
+
+ function handleMouseMovePan( event ) {
+
+ //console.log( 'handleMouseMovePan' );
+
+ panEnd.set( event.clientX, event.clientY );
+
+ panDelta.subVectors( panEnd, panStart );
+
+ pan( panDelta.x, panDelta.y );
+
+ panStart.copy( panEnd );
+
+ scope.update();
+
+ }
+
+ function handleMouseUp( event ) {
+
+ // console.log( 'handleMouseUp' );
+
+ }
+
+ function handleMouseWheel( event ) {
+
+ // console.log( 'handleMouseWheel' );
+
+ if ( event.deltaY < 0 ) {
+
+ dollyOut( getZoomScale() );
+
+ } else if ( event.deltaY > 0 ) {
+
+ dollyIn( getZoomScale() );
+
+ }
+
+ scope.update();
+
+ }
+
+ function handleKeyDown( event ) {
+
+ //console.log( 'handleKeyDown' );
+
+ switch ( event.keyCode ) {
+
+ case scope.keys.UP:
+ pan( 0, scope.keyPanSpeed );
+ scope.update();
+ break;
+
+ case scope.keys.BOTTOM:
+ pan( 0, - scope.keyPanSpeed );
+ scope.update();
+ break;
+
+ case scope.keys.LEFT:
+ pan( scope.keyPanSpeed, 0 );
+ scope.update();
+ break;
+
+ case scope.keys.RIGHT:
+ pan( - scope.keyPanSpeed, 0 );
+ scope.update();
+ break;
+
+ }
+
+ }
+
+ function handleTouchStartRotate( event ) {
+
+ //console.log( 'handleTouchStartRotate' );
+
+ rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
+
+ }
+
+ function handleTouchStartDolly( event ) {
+
+ //console.log( 'handleTouchStartDolly' );
+
+ var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
+ var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
+
+ var distance = Math.sqrt( dx * dx + dy * dy );
+
+ dollyStart.set( 0, distance );
+
+ }
+
+ function handleTouchStartPan( event ) {
+
+ //console.log( 'handleTouchStartPan' );
+
+ panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
+
+ }
+
+ function handleTouchMoveRotate( event ) {
+
+ //console.log( 'handleTouchMoveRotate' );
+
+ rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
+ rotateDelta.subVectors( rotateEnd, rotateStart );
+
+ var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
+
+ // rotating across whole screen goes 360 degrees around
+ rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );
+
+ // rotating up and down along whole screen attempts to go 360, but limited to 180
+ rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );
+
+ rotateStart.copy( rotateEnd );
+
+ scope.update();
+
+ }
+
+ function handleTouchMoveDolly( event ) {
+
+ //console.log( 'handleTouchMoveDolly' );
+
+ var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
+ var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;
+
+ var distance = Math.sqrt( dx * dx + dy * dy );
+
+ dollyEnd.set( 0, distance );
+
+ dollyDelta.subVectors( dollyEnd, dollyStart );
+
+ if ( dollyDelta.y > 0 ) {
+
+ dollyOut( getZoomScale() );
+
+ } else if ( dollyDelta.y < 0 ) {
+
+ dollyIn( getZoomScale() );
+
+ }
+
+ dollyStart.copy( dollyEnd );
+
+ scope.update();
+
+ }
+
+ function handleTouchMovePan( event ) {
+
+ //console.log( 'handleTouchMovePan' );
+
+ panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
+
+ panDelta.subVectors( panEnd, panStart );
+
+ pan( panDelta.x, panDelta.y );
+
+ panStart.copy( panEnd );
+
+ scope.update();
+
+ }
+
+ function handleTouchEnd( event ) {
+
+ //console.log( 'handleTouchEnd' );
+
+ }
+
+ //
+ // event handlers - FSM: listen for events and reset state
+ //
+
+ function onMouseDown( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ event.preventDefault();
+
+ switch ( event.button ) {
+
+ case scope.mouseButtons.ORBIT:
+
+ if ( scope.enableRotate === false ) return;
+
+ handleMouseDownRotate( event );
+
+ state = STATE.ROTATE;
+
+ break;
+
+ case scope.mouseButtons.ZOOM:
+
+ if ( scope.enableZoom === false ) return;
+
+ handleMouseDownDolly( event );
+
+ state = STATE.DOLLY;
+
+ break;
+
+ case scope.mouseButtons.PAN:
+
+ if ( scope.enablePan === false ) return;
+
+ handleMouseDownPan( event );
+
+ state = STATE.PAN;
+
+ break;
+
+ }
+
+ if ( state !== STATE.NONE ) {
+
+ document.addEventListener( 'mousemove', onMouseMove, false );
+ document.addEventListener( 'mouseup', onMouseUp, false );
+
+ scope.dispatchEvent( startEvent );
+
+ }
+
+ }
+
+ function onMouseMove( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ event.preventDefault();
+
+ switch ( state ) {
+
+ case STATE.ROTATE:
+
+ if ( scope.enableRotate === false ) return;
+
+ handleMouseMoveRotate( event );
+
+ break;
+
+ case STATE.DOLLY:
+
+ if ( scope.enableZoom === false ) return;
+
+ handleMouseMoveDolly( event );
+
+ break;
+
+ case STATE.PAN:
+
+ if ( scope.enablePan === false ) return;
+
+ handleMouseMovePan( event );
+
+ break;
+
+ }
+
+ }
+
+ function onMouseUp( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ handleMouseUp( event );
+
+ document.removeEventListener( 'mousemove', onMouseMove, false );
+ document.removeEventListener( 'mouseup', onMouseUp, false );
+
+ scope.dispatchEvent( endEvent );
+
+ state = STATE.NONE;
+
+ }
+
+ function onMouseWheel( event ) {
+
+ if ( scope.enabled === false || scope.enableZoom === false || ( state !== STATE.NONE && state !== STATE.ROTATE ) ) return;
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ handleMouseWheel( event );
+
+ scope.dispatchEvent( startEvent ); // not sure why these are here...
+ scope.dispatchEvent( endEvent );
+
+ }
+
+ function onKeyDown( event ) {
+
+ if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;
+
+ handleKeyDown( event );
+
+ }
+
+ function onTouchStart( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ switch ( event.touches.length ) {
+
+ case 1: // one-fingered touch: rotate
+
+ if ( scope.enableRotate === false ) return;
+
+ handleTouchStartRotate( event );
+
+ state = STATE.TOUCH_ROTATE;
+
+ break;
+
+ case 2: // two-fingered touch: dolly
+
+ if ( scope.enableZoom === false ) return;
+
+ handleTouchStartDolly( event );
+
+ state = STATE.TOUCH_DOLLY;
+
+ break;
+
+ case 3: // three-fingered touch: pan
+
+ if ( scope.enablePan === false ) return;
+
+ handleTouchStartPan( event );
+
+ state = STATE.TOUCH_PAN;
+
+ break;
+
+ default:
+
+ state = STATE.NONE;
+
+ }
+
+ if ( state !== STATE.NONE ) {
+
+ scope.dispatchEvent( startEvent );
+
+ }
+
+ }
+
+ function onTouchMove( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ switch ( event.touches.length ) {
+
+ case 1: // one-fingered touch: rotate
+
+ if ( scope.enableRotate === false ) return;
+ if ( state !== STATE.TOUCH_ROTATE ) return; // is this needed?...
+
+ handleTouchMoveRotate( event );
+
+ break;
+
+ case 2: // two-fingered touch: dolly
+
+ if ( scope.enableZoom === false ) return;
+ if ( state !== STATE.TOUCH_DOLLY ) return; // is this needed?...
+
+ handleTouchMoveDolly( event );
+
+ break;
+
+ case 3: // three-fingered touch: pan
+
+ if ( scope.enablePan === false ) return;
+ if ( state !== STATE.TOUCH_PAN ) return; // is this needed?...
+
+ handleTouchMovePan( event );
+
+ break;
+
+ default:
+
+ state = STATE.NONE;
+
+ }
+
+ }
+
+ function onTouchEnd( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ handleTouchEnd( event );
+
+ scope.dispatchEvent( endEvent );
+
+ state = STATE.NONE;
+
+ }
+
+ function onContextMenu( event ) {
+
+ if ( scope.enabled === false ) return;
+
+ event.preventDefault();
+
+ }
+
+ //
+
+ scope.domElement.addEventListener( 'contextmenu', onContextMenu, false );
+
+ scope.domElement.addEventListener( 'mousedown', onMouseDown, false );
+ scope.domElement.addEventListener( 'wheel', onMouseWheel, false );
+
+ scope.domElement.addEventListener( 'touchstart', onTouchStart, false );
+ scope.domElement.addEventListener( 'touchend', onTouchEnd, false );
+ scope.domElement.addEventListener( 'touchmove', onTouchMove, false );
+
+ window.addEventListener( 'keydown', onKeyDown, false );
+
+ // force an update at start
+
+ this.update();
+
+};
+
+THREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );
+THREE.OrbitControls.prototype.constructor = THREE.OrbitControls;
+
+Object.defineProperties( THREE.OrbitControls.prototype, {
+
+ center: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .center has been renamed to .target' );
+ return this.target;
+
+ }
+
+ },
+
+ // backward compatibility
+
+ noZoom: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );
+ return ! this.enableZoom;
+
+ },
+
+ set: function ( value ) {
+
+ console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );
+ this.enableZoom = ! value;
+
+ }
+
+ },
+
+ noRotate: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );
+ return ! this.enableRotate;
+
+ },
+
+ set: function ( value ) {
+
+ console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );
+ this.enableRotate = ! value;
+
+ }
+
+ },
+
+ noPan: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );
+ return ! this.enablePan;
+
+ },
+
+ set: function ( value ) {
+
+ console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );
+ this.enablePan = ! value;
+
+ }
+
+ },
+
+ noKeys: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );
+ return ! this.enableKeys;
+
+ },
+
+ set: function ( value ) {
+
+ console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );
+ this.enableKeys = ! value;
+
+ }
+
+ },
+
+ staticMoving: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );
+ return ! this.enableDamping;
+
+ },
+
+ set: function ( value ) {
+
+ console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );
+ this.enableDamping = ! value;
+
+ }
+
+ },
+
+ dynamicDampingFactor: {
+
+ get: function () {
+
+ console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );
+ return this.dampingFactor;
+
+ },
+
+ set: function ( value ) {
+
+ console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );
+ this.dampingFactor = value;
+
+ }
+
+ }
+
+} );
diff --git a/src/tools/3DViewer-web/public/js/jderobot/Ice.min.js b/src/tools/3DViewer-web/public/js/jderobot/Ice.min.js
new file mode 100644
index 000000000..ee100584f
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/Ice.min.js
@@ -0,0 +1,10 @@
+(function(){var e=typeof window!=="undefined"?window:self;e.Ice=e.Ice||{};Ice.Slice=Ice.Slice||{};e.IceMX=e.IceMX||{};e.IceSSL=e.IceSSL||{};var t=Ice.Slice;(function(){var e=typeof window!=="undefined"?window:self;var t={module:function(t){var n=e[t];if(n===undefined){n={};e[t]=n}return n},require:function(t){return e},type:function(t){if(t===undefined){return undefined}var n=t.split(".");var i=e;for(var r=0,s=n.length;r
1;--t){var n=e[t-1];var i=Math.floor(Math.random()*t);e[t-1]=e[i];e[i]=n}},indexOf:function(e,t,n){if(n!==undefined&&n!==null){for(var i=0;ie.MAX_UINT32){throw new RangeError("Low word must be between 0 and 0xFFFFFFFF")}if(t<0||t>e.MAX_UINT32){throw new RangeError("High word must be between 0 and 0xFFFFFFFF")}this.high=t;this.low=n},hashCode:function(){return this.low},equals:function(t){if(this===t){return true}if(!(t instanceof e)){return false}return this.high===t.high&&this.low===t.low},toString:function(){return this.high+":"+this.low},toNumber:function(){if((this.high&e.SIGN_MASK)!==0){const t=~this.low>>>0;const n=~this.high>>>0;if(n>e.HIGH_MAX||n==e.HIGH_MAX&&t==e.MAX_UINT32){return Number.NEGATIVE_INFINITY}return-(n*e.HIGH_MASK+t+1)}else{if(this.high>e.HIGH_MAX){return Number.POSITIVE_INFINITY}return this.high*e.HIGH_MASK+this.low}}});e.MAX_UINT32=4294967295;e.SIGN_MASK=2147483648;e.HIGH_MASK=4294967296;e.HIGH_MAX=2097151;Ice.Long=e})();(function(){Ice.AssertionFailedException=Ice.Class(Error,{__init__:function(e){Error.call(this);Ice.Exception.captureStackTrace(this);this.message=e}});Ice.Debug={assert:function(e,t){if(!e){console.log(t===undefined?"assertion failed":t);console.log(Error().stack);throw new Ice.AssertionFailedException(t===undefined?"assertion failed":t)}}}})();(function(){Ice.DispatchStatus={DispatchOK:0,DispatchUserException:1,DispatchAsync:2}})();(function(){var e=Ice.Class({__init__:function(e,t){this._name=e;this._value=t},equals:function(e){if(this===e){return true}var t=Object.getPrototypeOf(this);if(!(e instanceof t.constructor)){return false}return this._value==e._value},hashCode:function(){return this._value},toString:function(){return this._name}});Ice.EnumBase=e;var t=e.prototype;Object.defineProperty(t,"name",{enumerable:true,get:function(){return this._name}});Object.defineProperty(t,"value",{enumerable:true,get:function(){return this._value}});var n=Ice.Class({__init__:function(e){this._enumType=e},write:function(e,t){this._enumType.__write(e,t)},writeOpt:function(e,t,n){this._enumType.__writeOpt(e,t,n)},read:function(e){return this._enumType.__read(e)},readOpt:function(e,t){return this._enumType.__readOpt(e,t)}});Ice.EnumHelper=n;var i=Ice.Slice;i.defineEnum=function(t){var i=function(t,n){e.call(this,t,n)};i.prototype=new e;i.prototype.constructor=i;var r=[];var s=0;var o=null;for(var c in t){var a=t[c][0],u=t[c][1];var l=new i(a,u);r[u]=l;if(!o){o=l}Object.defineProperty(i,a,{enumerable:true,value:l});if(u>s){s=u}}Object.defineProperty(i,"minWireSize",{get:function(){return 1}});i.__write=function(e,t){if(t){e.writeEnum(t)}else{e.writeEnum(o)}};i.__read=function(e){return e.readEnum(i)};i.__writeOpt=function(e,t,n){if(n!==undefined){if(e.writeOpt(t,Ice.OptionalFormat.Size)){i.__write(e,n)}}};i.__readOpt=function(e,t){return e.readOptEnum(t,i)};i.__helper=new n(i);Object.defineProperty(i,"valueOf",{value:function(e){if(e===undefined){return i}return r[e]}});Object.defineProperty(i,"maxValue",{value:s});Object.defineProperty(i.prototype,"maxValue",{value:s});return i}})();(function(){function e(){var e=(new Date).getTime();var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+Math.random()*16)%16|0;e=Math.floor(e/16);return(t=="x"?n:n&7|8).toString(16)});return t}Ice.generateUUID=e})();(function(){Ice.FormatType=Ice.Slice.defineEnum([["DefaultFormat",0],["CompactFormat",1],["SlicedFormat",2]])})();(function(){var e=Ice.Debug;Ice.StringUtil={findFirstOf:function(e,t,n){n=n===undefined?0:n;var i=e.length;for(var r=n;r126){throw new Error("special characters must be in ASCII range 32-126")}}}var s=[],o;for(i=0,r=e.length;i127&&o<2048){t(o>>6|192,s,n);t(o&63|128,s,n)}else{t(o>>12|224,s,n);t(o>>6&63|128,s,n);t(o&63|128,s,n)}}return s.join("")},unescapeString:function(t,n,i){n=n===undefined?0:n;i=i===undefined?t.length:i;e.assert(n>=0&&n<=i&&i<=t.length);var s=[];r(t,n,i,s);return s.join("")},splitString:function(e,t){var n=[];var i="";var r=0;var s=null;while(r0){n.push(i);i=""}continue}}if(r0){n.push(i)}if(s!==null){return null}return n},checkQuote:function(e,t){t=t===undefined?0:t;var n=e.charAt(t);if(n=='"'||n=="'"){t++;var i=e.length;var r;while(t=32&&e<=126)){t.push("\\");var i=e.toString(8);for(var r=i.length;r<3;r++){t.push("0")}t.push(i)}else{var s=String.fromCharCode(e);if(n!==null&&n.indexOf(s)!==-1){t.push("\\");t.push(s)}else{t.push(s)}}}}}function n(e,t){var n=e.charCodeAt(t);if(!(n>=32&&n<=126)){var i;if(t>0){i="character after `"+e.substring(0,t)+"'"}else{i="first character"}i+=" is not a printable ASCII character (ordinal "+n+")";throw new Error(i)}return n}function i(t,i,r,s){e.assert(i>=0);e.assert(r<=t.length);if(i>=r){throw new Error("EOF while decoding string")}var o;if(t.charAt(i)!="\\"){o=n(t,i++)}else{if(i+1==r){throw new Error("trailing backslash")}switch(t.charAt(++i)){case"\\":case"'":case'"':{o=t.charCodeAt(i++);break}case"b":{++i;o="\b".charCodeAt(0);break}case"f":{++i;o="\f".charCodeAt(0);break}case"n":{++i;o="\n".charCodeAt(0);break}case"r":{++i;o="\r".charCodeAt(0);break}case"t":{++i;o="\t".charCodeAt(0);break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{var c="01234567";var a=0;for(var u=0;u<3&&i255){var h="octal value \\"+a.toString(8)+" ("+a+") is out of range";throw new Error(h)}o=a;break}default:{o=n(t,i++);break}}}s.value=i;return o}function r(e,t,n,r){var s={value:0},o,c,a;while(t191&&o<224){c=i(e,t,n,s);t=s.value;r.push(String.fromCharCode((o&31)<<6|c&63))}else{c=i(e,t,n,s);t=s.value;a=i(e,t,n,s);t=s.value;r.push(String.fromCharCode((o&15)<<12|(c&63)<<6|a&63))}}}})();(function(){var e=Ice.__M;var t=Ice.StringUtil;function n(e,t,n,i,r){for(var s=e._table[r];s!==null;s=s._nextInBucket){if(s._hash===i&&e.keysEqual(t,s._key)){s._value=n;return undefined}}e.add(t,n,i,r);return undefined}function i(e,t){if(e===t){return true}if(e===undefined||e===null||t===undefined||t===null){return false}return e.equals(t)}function r(e,t){return e===t}var s=Ice.Class({__init__:function(e,t){var n=arguments;var i,o,c;if(typeof e=="function"){o=e;c=t}else if(e instanceof s){i=e;o=i.keyComparator;c=i.valueComparator}this._size=0;this._head=null;this._initialCapacity=32;this._loadFactor=.75;this._table=[];this._keyComparator=typeof o=="function"?o:r;this._valueComparator=typeof c=="function"?c:r;var a,u;if(i instanceof s&&i._size>0){this._threshold=i._threshold;u=i._table.length;this._table.length=u;for(a=0;a=this._threshold){this.resize(this._table.length*2)}},resize:function(e){var t=this._table;var n=[];for(var i=0;i254?s*e+5:s*e+1);this.write(t,r)}};this.readOpt=function(e,t){var n;if(e.readOpt(t,i.VSize)){e.skipSize();n=this.read(e)}return n}};r.VSizeContainer1OptHelper=function(){this.writeOpt=function(e,t,n){if(n!==undefined&&e.writeOpt(t,i.VSize)){this.write(e,n)}};this.readOpt=function(e,t){var n;if(e.readOpt(t,i.VSize)){n=this.read(e)}return n}};var s=e({write:function(e,t){if(t===null||t.length===0){e.writeSize(0)}else{var n=this.elementHelper;e.writeSize(t.length);for(var i=0;i=0},ice_ping:function(e){},ice_ids:function(e){return this.__mostDerivedType().__ids},ice_id:function(e){return this.__mostDerivedType().__id},toString:function(){return"[object "+this.ice_id()+"]"},ice_preMarshal:function(){},ice_postUnmarshal:function(){},__write:function(e){e.startWriteObject(null);i(this,e,this.__mostDerivedType());e.endWriteObject()},__read:function(e){e.startReadObject();r(this,e,this.__mostDerivedType());e.endReadObject(false)},ice_instanceof:function(e){if(e){if(this instanceof e){return true}return this.__mostDerivedType().__instanceof(e)}return false},__mostDerivedType:function(){return n},equals:function(e){return this===e}});n.write=function(e,t){e.writeObject(t)};n.writeOpt=function(e,t,n){e.writeOptObject(t,n)};n.read=function(e){var t={value:null};e.readObject(function(e){t.value=e},n);return t};n.readOpt=function(e,t){var i={value:undefined};e.readOptObject(t,function(e){i.value=e},n);return i};n.ice_staticId=function(){return n.__id};n.__instanceof=function(e){if(e===this){return true}for(var t in this.__implements){if(this.__implements[t].__instanceof(e)){return true}}if(this.__parent){return this.__parent.__instanceof(e)}return false};n.__ids=["::Ice::Object"];n.__id=n.__ids[0];n.__compactId=-1;n.__preserved=false;var i=function(e,t,r){if(r===undefined||r===n){return}t.startWriteSlice(r.__id,r.__compactId,r.__parent===n);if(r.prototype.__writeMemberImpl){r.prototype.__writeMemberImpl.call(e,t)}t.endWriteSlice();i(e,t,r.__parent)};var r=function(e,t,i){if(i===undefined||i===n){return}t.startReadSlice();if(i.prototype.__readMemberImpl){i.prototype.__readMemberImpl.call(e,t)}t.endReadSlice();r(e,t,i.__parent)};var s=function(e){e.startWriteObject(this.__slicedData);i(this,e,this.__mostDerivedType());e.endWriteObject()};var o=function(e){e.startReadObject();r(this,e,this.__mostDerivedType());this.__slicedData=e.endReadObject(true)};Ice.Object=n;var c=Ice.Slice;c.defineLocalObject=function(e,t){var n=e||function(){};if(t!==undefined){n.prototype=new t;n.__parent=t;n.prototype.constructor=e}return n};c.defineObject=function(e,t,i,r,c,a,u,l,h){var f=e||function(){};f.prototype=new t;f.__parent=t;f.__ids=c;f.__id=c[r];f.__compactId=a;f.__instanceof=n.__instanceof;f.__implements=i;f.write=function(e,t){e.writeObject(t)};f.writeOpt=function(e,t,n){e.writeOptObject(t,n)};f.read=function(e){var t={value:null};e.readObject(function(e){t.value=e},f);return t};f.readOpt=function(e,t){var n={value:undefined};e.readOptObject(t,function(e){n.value=e},f);return n};f.ice_staticId=function(){return c[r]};f.prototype.constructor=f;f.prototype.__mostDerivedType=function(){return f};if(h){f.prototype.__write=s;f.prototype.__read=o}f.prototype.__writeMemberImpl=u;f.prototype.__readMemberImpl=l;return f}})();(function(){var e=Ice.StringUtil;Ice.HashUtil={addBoolean:function(e,t){return(e<<5)+e^(t?0:1)},addString:function(t,n){if(n!==undefined&&n!==null){t=(t<<5)+t^e.hashCode(n)}return t},addNumber:function(e,t){return(e<<5)+e^t},addHashable:function(e,t){if(t!==undefined&&t!==null){e=(e<<5)+e^t.hashCode()}return e},addArray:function(e,t,n){if(t!==undefined&&t!==null){for(var i=0;ithis.capacity){this.reserve(e)}this._limit=e},clear:function(){this.b=null;this.v=null;this._position=0;this._limit=0},expand:function(e){var t=this.capacity===0?e:this._position+e;if(t>this._limit){this.resize(t)}},reset:function(){if(this._limit>0&&this._limit*22){this.reserve(this._limit);this._shrinkCounter=0}}else{this._shrinkCounter=0}this._limit=0;this._position=0},reserve:function(e){if(e>this.capacity){var t=Math.max(e,2*this.capacity);t=Math.max(1024,t);if(!this.b){this.b=new ArrayBuffer(t)}else{var n=new Uint8Array(t);n.set(new Uint8Array(this.b));this.b=n.buffer}this.v=new DataView(this.b)}else if(e=this._limit){throw new Error(i)}this.v.setUint8(e,t)},putArray:function(e){if(!(e instanceof Uint8Array)){throw new TypeError("argument is not a Uint8Array")}if(e.byteLength>0){if(this._position+e.length>this._limit){throw new Error(t)}new Uint8Array(this.b,0,this.b.byteLength).set(e,this._position);this._position+=e.byteLength}},putShort:function(e){if(this._position+2>this._limit){throw new Error(t)}this.v.setInt16(this._position,e,true);this._position+=2},putInt:function(e){if(this._position+4>this._limit){throw new Error(t)}this.v.setInt32(this._position,e,true);this._position+=4},putIntAt:function(e,t){if(e+4>this._limit||e<0){throw new Error(i)}this.v.setInt32(e,t,true)},putFloat:function(e){if(this._position+4>this._limit){throw new Error(t)}this.v.setFloat32(this._position,e,true);this._position+=4},putDouble:function(e){if(this._position+8>this._limit){throw new Error(t)}this.v.setFloat64(this._position,e,true);this._position+=8},putLong:function(e){if(this._position+8>this._limit){throw new Error(t)}this.v.setInt32(this._position,e.low,true);this._position+=4;this.v.setInt32(this._position,e.high,true);this._position+=4},writeString:function(e,t){var n=unescape(encodeURIComponent(t));e.writeSize(n.length);e.expand(n.length);this.putString(n,n.length)},putString:function(e,n){if(this._position+n>this._limit){throw new Error(t)}for(var i=0;i=this._limit){throw new Error(n)}var e=this.v.getUint8(this._position);this._position++;return e},getAt:function(e){if(e<0||e>=this._limit){throw new Error(i)}return this.v.getUint8(e)},getArray:function(e){if(this._position+e>this._limit){throw new Error(n)}var t=this.b.slice(this._position,this._position+e);this._position+=e;return new Uint8Array(t)},getArrayAt:function(e,t){if(e+t>this._limit){throw new Error(n)}t=t===undefined?this.b.byteLength-e:t;return new Uint8Array(this.b.slice(e,e+t));
+},getShort:function(){if(this._limit-this._position<2){throw new Error(n)}var e=this.v.getInt16(this._position,true);this._position+=2;return e},getInt:function(){if(this._limit-this._position<4){throw new Error(n)}var e=this.v.getInt32(this._position,true);this._position+=4;return e},getFloat:function(){if(this._limit-this._position<4){throw new Error(n)}var e=this.v.getFloat32(this._position,true);this._position+=4;return e},getDouble:function(){if(this._limit-this._position<8){throw new Error(n)}var e=this.v.getFloat64(this._position,true);this._position+=8;return e},getLong:function(){if(this._limit-this._position<8){throw new Error(n)}var t=new e;t.low=this.v.getUint32(this._position,true);this._position+=4;t.high=this.v.getUint32(this._position,true);this._position+=4;return t},getString:function(e){if(this._position+e>this._limit){throw new Error(n)}var t=new DataView(this.b,this._position,e);var i="";for(var r=0;r=0&&e<=this._limit){this._position=e}}});Object.defineProperty(s,"limit",{get:function(){return this._limit},set:function(e){if(e<=this.capacity){this._limit=e;if(this._position>e){this._position=e}}}});Object.defineProperty(s,"capacity",{get:function(){return this.b===null?0:this.b.byteLength}});Object.defineProperty(s,"remaining",{get:function(){return this._limit-this._position}});r.createNative=function(e){if(e===undefined){return new Uint8Array(0)}else{return new Uint8Array(e)}};Ice.Buffer=r})();(function(){var e=Ice.Buffer;var t={};var n="A".charCodeAt(0);var i="a".charCodeAt(0);var r="0".charCodeAt(0);t.encode=function(e){if(e===null||e.length===0){return""}var t=e.length*4/3+1;var n=t*2/76+1;var i=t+n;var r=[];var o;var c;var a;var u;var l;var h;var f;for(var d=0;d>2&255;l=((o&3)<<4|c>>4)&255;h=((c&15)<<2|a>>6)&255;f=a&63;r.push(s(u));r.push(s(l));if(d+176){_.push(p.substring(I,I+76));_.push("\r\n");I+=76}_.push(p.substring(I));return _.join("")};t.decode=function(n){var i=[];for(var r=0;r>4);if(_!="="){a.put((l&15)<<4|h>>2)}if(I!="="){a.put((h&3)<<6|f)}}return a.remaining>0?a.getArrayAt(0,a.position):a.getArrayAt(0)};t.isBase64=function(e){if(e>="A"&&e<="Z"){return true}if(e>="a"&&e<="z"){return true}if(e>="0"&&e<="9"){return true}if(e=="+"){return true}if(e=="/"){return true}if(e=="="){return true}return false};function s(e){if(e<26){return String.fromCharCode(n+e)}if(e<52){return String.fromCharCode(i+(e-26))}if(e<62){return String.fromCharCode(r+(e-52))}if(e==62){return"+"}return"/"}function o(e){if(e>="A"&&e<="Z"){return e.charCodeAt(0)-n}if(e>="a"&&e<="z"){return e.charCodeAt(0)-i+26}if(e>="0"&&e<="9"){return e.charCodeAt(0)-r+52}if(e=="+"){return 62}return 63}Ice.Base64=t})();(function(){Ice.Identity=t.defineStruct(function(e,t){this.name=e!==undefined?e:"";this.category=t!==undefined?t:""},true,function(e){e.writeString(this.name);e.writeString(this.category)},function(e){this.name=e.readString();this.category=e.readString()},2,false);t.defineDictionary(Ice,"ObjectDict","ObjectDictHelper","Ice.Identity","Ice.ObjectHelper",false,Ice.HashMap.compareEquals,"Ice.Object");t.defineSequence(Ice,"IdentitySeqHelper","Ice.Identity",false)})();(function(){})();(function(){Ice.ProtocolVersion=t.defineStruct(function(e,t){this.major=e!==undefined?e:0;this.minor=t!==undefined?t:0},true,function(e){e.writeByte(this.major);e.writeByte(this.minor)},function(e){this.major=e.readByte();this.minor=e.readByte()},2,true);Ice.EncodingVersion=t.defineStruct(function(e,t){this.major=e!==undefined?e:0;this.minor=t!==undefined?t:0},true,function(e){e.writeByte(this.major);e.writeByte(this.minor)},function(e){this.major=e.readByte();this.minor=e.readByte()},2,true)})();(function(){var e=function(){this.typeId="";this.compactId=-1;this.bytes=[];this.objects=[];this.hasOptionalMembers=false;this.isLastSlice=false};Ice.SliceInfo=e;var t=function(e){this.slices=e};Ice.SlicedData=t;var n=Ice.Class(Ice.Object,{__init__:function(e){this._unknownTypeId=e},getUnknownTypeId:function(){return this._unknownTypeId},__write:function(e){e.startWriteObject(this._slicedData);e.endWriteObject()},__read:function(e){e.startReadObject();this._slicedData=e.endReadObject(true)}});Ice.UnknownSlicedObject=n})();(function(){})();(function(){var e=Ice.HashMap;var t=Ice.Debug;var n=Ice.Class({__init__:function(){this._adapterEndpointsTable=new e;this._objectTable=new e(e.compareEquals)},clear:function(){this._adapterEndpointsTable.clear();this._objectTable.clear()},getAdapterEndpoints:function(e,t,n){if(t===0){n.value=false;return null}var i=this._adapterEndpointsTable.get(e);if(i!==undefined){n.value=this.checkTTL(i.time,t);return i.endpoints}n.value=false;return null},addAdapterEndpoints:function(e,t){this._adapterEndpointsTable.set(e,new i(Date.now(),t))},removeAdapterEndpoints:function(e){var t=this._adapterEndpointsTable.get(e);this._adapterEndpointsTable.delete(e);return t!==undefined?t.endpoints:null},getObjectReference:function(e,t,n){if(t===0){n.value=false;return null}var i=this._objectTable.get(e);if(i!==undefined){n.value=this.checkTTL(i.time,t);return i.reference}n.value=false;return null},addObjectReference:function(e,t){this._objectTable.set(e,new r(Date.now(),t))},removeObjectReference:function(e){var t=this._objectTable.get(e);this._objectTable.delete(e);return t!==undefined?t.reference:null},checkTTL:function(e,n){t.assert(n!==0);if(n<0){return true}else{return Date.now()-e<=n*1e3}}});Ice.LocatorTable=n;var i=function(e,t){this.time=e;this.endpoints=t};var r=function(e,t){this.time=e;this.reference=t}})();(function(){var e=Ice.Timer;var t={Pending:0,Success:1,Failed:2};var n=function(e,n){var i=e.__state===t.Success?n.onResponse:n.onException;try{if(typeof i!=="function"){n.promise.setState(e.__state,e._args)}else{var r=i.apply(null,e._args);if(r&&typeof r.then=="function"){r.then(function(){var e=arguments;n.promise.succeed.apply(n.promise,e)},function(){var e=arguments;n.promise.fail.apply(n.promise,e)})}else{n.promise.succeed(r)}}}catch(s){n.promise.fail.call(n.promise,s)}};var i=Ice.Class({__init__:function(){this.__state=t.Pending;this.__listeners=[]},then:function(t,n){var r=new i;var s=this;e.setImmediate(function(){s.__listeners.push({promise:r,onResponse:t,onException:n});s.resolve()});return r},exception:function(e){return this.then(null,e)},"finally":function(t){var n=new i;var r=this;var s=function(e){return function(){var i=arguments;try{var r=t.apply(null,i);if(r&&typeof r.then=="function"){var s=function(){e.apply(n,i)};r.then(s).exception(s)}else{e.apply(n,i)}}catch(o){e.apply(n,i)}}};e.setImmediate(function(){r.then(s(n.succeed),s(n.fail))});return n},delay:function(t){var n=new i;var r=this;var s=function(n,i){return function(){var r=arguments;e.setTimeout(function(){i.apply(n,r)},t)}};e.setImmediate(function(){r.then(s(n,n.succeed),s(n,n.fail))});return n},resolve:function(){if(this.__state===t.Pending){return}var e;while(e=this.__listeners.pop()){n(this,e)}},setState:function(n,i){if(this.__state===t.Pending&&n!==t.Pending){this.__state=n;this._args=i;var r=this;e.setImmediate(function(){r.resolve()})}},succeed:function(){var e=arguments;this.setState(t.Success,e);return this},fail:function(){var e=arguments;this.setState(t.Failed,e);return this},succeeded:function(){return this.__state===t.Success},failed:function(){return this.__state===t.Failed},completed:function(){return this.__state!==t.Pending}});i.all=function(){if(arguments.length===1&&arguments[0]instanceof Array){return i.all.apply(this,arguments[0])}var e=new i;var t=Array.prototype.slice.call(arguments);var n=new Array(arguments.length);var r=t.length;if(r===0){e.succeed.apply(e,n)}for(var s=0;s1){var t=new i;var n=Array.prototype.slice.call(arguments);e=n.pop();return t.succeed.apply(t,n).delay(e)}else{return(new i).succeed().delay(e)}};Ice.Promise=i})();(function(){var e=Ice.Class({__init__:function(e){if(e!==undefined&&e.length>0){this._prefix=e+": "}else{this._prefix=""}this._dateformat={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:false}},print:function(e){this.write(e,false)},trace:function(e,t){var n=[];var i=new Date;n.push("-- ");n.push(this.timestamp());n.push(" ");n.push(this._prefix);n.push(e);n.push(": ");n.push(t);this.write(n.join(""),true)},warning:function(e){var t=[];var n=new Date;t.push("-! ");t.push(this.timestamp());t.push(" ");t.push(this._prefix);t.push("warning: ");t.push(e);this.write(t.join(""),true)},error:function(e){var t=[];var n=new Date;t.push("!! ");t.push(this.timestamp());t.push(" ");t.push(this._prefix);t.push("error: ");t.push(e);this.write(t.join(""),true)},cloneWithPrefix:function(t){return new e(t)},write:function(e,t){if(t){e=e.replace(/\n/g,"\n ")}console.log(e)},timestamp:function(){var e=new Date;return e.toLocaleString("en-US",this._dateformat)+"."+e.getMilliseconds()}});Ice.Logger=e})();(function(){Ice.InitializationException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::InitializationException");Ice.PluginInitializationException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::PluginInitializationException");Ice.CollocationOptimizationException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::CollocationOptimizationException");Ice.AlreadyRegisteredException=t.defineLocalException(function(e,t,n){Ice.LocalException.call(this,n);this.kindOfObject=e!==undefined?e:"";this.id=t!==undefined?t:""},Ice.LocalException,"Ice::AlreadyRegisteredException");Ice.NotRegisteredException=t.defineLocalException(function(e,t,n){Ice.LocalException.call(this,n);this.kindOfObject=e!==undefined?e:"";this.id=t!==undefined?t:""},Ice.LocalException,"Ice::NotRegisteredException");Ice.TwowayOnlyException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.operation=e!==undefined?e:""},Ice.LocalException,"Ice::TwowayOnlyException");Ice.CloneNotImplementedException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::CloneNotImplementedException");Ice.UnknownException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.unknown=e!==undefined?e:""},Ice.LocalException,"Ice::UnknownException");Ice.UnknownLocalException=t.defineLocalException(function(e,t){Ice.UnknownException.call(this,e,t)},Ice.UnknownException,"Ice::UnknownLocalException");Ice.UnknownUserException=t.defineLocalException(function(e,t){Ice.UnknownException.call(this,e,t)},Ice.UnknownException,"Ice::UnknownUserException");Ice.VersionMismatchException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::VersionMismatchException");Ice.CommunicatorDestroyedException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::CommunicatorDestroyedException");Ice.ObjectAdapterDeactivatedException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.name=e!==undefined?e:""},Ice.LocalException,"Ice::ObjectAdapterDeactivatedException");Ice.ObjectAdapterIdInUseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.id=e!==undefined?e:""},Ice.LocalException,"Ice::ObjectAdapterIdInUseException");Ice.NoEndpointException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.proxy=e!==undefined?e:""},Ice.LocalException,"Ice::NoEndpointException");Ice.EndpointParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::EndpointParseException");Ice.EndpointSelectionTypeParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::EndpointSelectionTypeParseException");Ice.VersionParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::VersionParseException");Ice.IdentityParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::IdentityParseException");Ice.ProxyParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::ProxyParseException");Ice.IllegalIdentityException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.id=e!==undefined?e:new Ice.Identity},Ice.LocalException,"Ice::IllegalIdentityException");Ice.IllegalServantException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::IllegalServantException");Ice.RequestFailedException=t.defineLocalException(function(e,t,n,i){Ice.LocalException.call(this,i);this.id=e!==undefined?e:new Ice.Identity;this.facet=t!==undefined?t:"";this.operation=n!==undefined?n:""},Ice.LocalException,"Ice::RequestFailedException");Ice.ObjectNotExistException=t.defineLocalException(function(e,t,n,i){Ice.RequestFailedException.call(this,e,t,n,i)},Ice.RequestFailedException,"Ice::ObjectNotExistException");Ice.FacetNotExistException=t.defineLocalException(function(e,t,n,i){Ice.RequestFailedException.call(this,e,t,n,i)},Ice.RequestFailedException,"Ice::FacetNotExistException");Ice.OperationNotExistException=t.defineLocalException(function(e,t,n,i){Ice.RequestFailedException.call(this,e,t,n,i)},Ice.RequestFailedException,"Ice::OperationNotExistException");Ice.SyscallException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.error=e!==undefined?e:0},Ice.LocalException,"Ice::SyscallException");Ice.SocketException=t.defineLocalException(function(e,t){Ice.SyscallException.call(this,e,t)},Ice.SyscallException,"Ice::SocketException");Ice.FileException=t.defineLocalException(function(e,t,n){Ice.SyscallException.call(this,e,n);this.path=t!==undefined?t:""},Ice.SyscallException,"Ice::FileException");Ice.ConnectFailedException=t.defineLocalException(function(e,t){Ice.SocketException.call(this,e,t)},Ice.SocketException,"Ice::ConnectFailedException");Ice.ConnectionRefusedException=t.defineLocalException(function(e,t){Ice.ConnectFailedException.call(this,e,t)},Ice.ConnectFailedException,"Ice::ConnectionRefusedException");Ice.ConnectionLostException=t.defineLocalException(function(e,t){Ice.SocketException.call(this,e,t)},Ice.SocketException,"Ice::ConnectionLostException");Ice.DNSException=t.defineLocalException(function(e,t,n){Ice.LocalException.call(this,n);this.error=e!==undefined?e:0;this.host=t!==undefined?t:""},Ice.LocalException,"Ice::DNSException");Ice.OperationInterruptedException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::OperationInterruptedException");Ice.TimeoutException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::TimeoutException");Ice.ConnectTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::ConnectTimeoutException");Ice.CloseTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::CloseTimeoutException");Ice.ConnectionTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::ConnectionTimeoutException");Ice.InvocationTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::InvocationTimeoutException");Ice.InvocationCanceledException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::InvocationCanceledException");Ice.ProtocolException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::ProtocolException");Ice.BadMagicException=t.defineLocalException(function(e,t,n){Ice.ProtocolException.call(this,e,n);this.badMagic=t!==undefined?t:null},Ice.ProtocolException,"Ice::BadMagicException");Ice.UnsupportedProtocolException=t.defineLocalException(function(e,t,n,i){Ice.ProtocolException.call(this,e,i);this.bad=t!==undefined?t:new Ice.ProtocolVersion;this.supported=n!==undefined?n:new Ice.ProtocolVersion},Ice.ProtocolException,"Ice::UnsupportedProtocolException");Ice.UnsupportedEncodingException=t.defineLocalException(function(e,t,n,i){Ice.ProtocolException.call(this,e,i);this.bad=t!==undefined?t:new Ice.EncodingVersion;this.supported=n!==undefined?n:new Ice.EncodingVersion},Ice.ProtocolException,"Ice::UnsupportedEncodingException");Ice.UnknownMessageException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::UnknownMessageException");Ice.ConnectionNotValidatedException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::ConnectionNotValidatedException");Ice.UnknownRequestIdException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::UnknownRequestIdException");Ice.UnknownReplyStatusException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::UnknownReplyStatusException");Ice.CloseConnectionException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::CloseConnectionException");Ice.ForcedCloseConnectionException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::ForcedCloseConnectionException");Ice.IllegalMessageSizeException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::IllegalMessageSizeException");Ice.CompressionException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::CompressionException");Ice.DatagramLimitException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::DatagramLimitException");Ice.MarshalException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::MarshalException");Ice.ProxyUnmarshalException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::ProxyUnmarshalException");Ice.UnmarshalOutOfBoundsException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::UnmarshalOutOfBoundsException");Ice.NoObjectFactoryException=t.defineLocalException(function(e,t,n){Ice.MarshalException.call(this,e,n);this.type=t!==undefined?t:""},Ice.MarshalException,"Ice::NoObjectFactoryException");Ice.UnexpectedObjectException=t.defineLocalException(function(e,t,n,i){Ice.MarshalException.call(this,e,i);this.type=t!==undefined?t:"";this.expectedType=n!==undefined?n:""},Ice.MarshalException,"Ice::UnexpectedObjectException");Ice.MemoryLimitException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::MemoryLimitException");Ice.StringConversionException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::StringConversionException");Ice.EncapsulationException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::EncapsulationException");Ice.FeatureNotSupportedException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.unsupportedFeature=e!==undefined?e:""},Ice.LocalException,"Ice::FeatureNotSupportedException");Ice.SecurityException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::SecurityException");Ice.FixedProxyException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::FixedProxyException");Ice.ResponseSentException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::ResponseSentException")})();(function(){var e=Ice.StringUtil;var t={};Ice.Encoding_1_0=new Ice.EncodingVersion(1,0);Ice.Encoding_1_1=new Ice.EncodingVersion(1,1);Ice.Protocol_1_0=new Ice.ProtocolVersion(1,0);t.headerSize=14;t.magic=Ice.Buffer.createNative([73,99,101,80]);t.protocolMajor=1;t.protocolMinor=0;t.protocolEncodingMajor=1;t.protocolEncodingMinor=0;t.encodingMajor=1;t.encodingMinor=1;t.requestMsg=0;t.requestBatchMsg=1;t.replyMsg=2;t.validateConnectionMsg=3;t.closeConnectionMsg=4;t.replyOK=0;t.replyUserException=1;t.replyObjectNotExist=2;t.replyFacetNotExist=3;t.replyOperationNotExist=4;t.replyUnknownLocalException=5;t.replyUnknownUserException=6;t.replyUnknownException=7;t.requestHdr=Ice.Buffer.createNative([t.magic[0],t.magic[1],t.magic[2],t.magic[3],t.protocolMajor,t.protocolMinor,t.protocolEncodingMajor,t.protocolEncodingMinor,t.requestMsg,0,0,0,0,0,0,0,0,0]);t.requestBatchHdr=Ice.Buffer.createNative([t.magic[0],t.magic[1],t.magic[2],t.magic[3],t.protocolMajor,t.protocolMinor,t.protocolEncodingMajor,t.protocolEncodingMinor,t.requestBatchMsg,0,0,0,0,0,0,0,0,0]);t.replyHdr=Ice.Buffer.createNative([t.magic[0],t.magic[1],t.magic[2],t.magic[3],t.protocolMajor,t.protocolMinor,t.protocolEncodingMajor,t.protocolEncodingMinor,t.replyMsg,0,0,0,0,0]);t.currentProtocol=new Ice.ProtocolVersion(t.protocolMajor,t.protocolMinor);t.currentProtocolEncoding=new Ice.EncodingVersion(t.protocolEncodingMajor,t.protocolEncodingMinor);t.currentEncoding=new Ice.EncodingVersion(t.encodingMajor,t.encodingMinor);t.checkSupportedProtocol=function(e){if(e.major!==t.currentProtocol.major||e.minor>t.currentProtocol.minor){throw new Ice.UnsupportedProtocolException("",e,t.currentProtocol)}};t.checkSupportedProtocolEncoding=function(e){if(e.major!==t.currentProtocolEncoding.major||e.minor>t.currentProtocolEncoding.minor){throw new Ice.UnsupportedEncodingException("",e,t.currentProtocolEncoding)}};t.checkSupportedEncoding=function(e){if(e.major!==t.currentEncoding.major||e.minor>t.currentEncoding.minor){throw new Ice.UnsupportedEncodingException("",e,t.currentEncoding)}};t.getCompatibleProtocol=function(e){if(e.major!==t.currentProtocol.major){return e}else if(e.minor255){throw new Ice.VersionParseException("range error in version `"+t+"'")}return r}function i(t){var n=t.indexOf(".");if(n===-1){throw new Ice.VersionParseException("malformed version value `"+t+"'")}var i=t.substring(n+1);var r;try{r=e.toInt(i)}catch(s){throw new Ice.VersionParseException("invalid version value `"+t+"'")}if(r<0||r>255){throw new Ice.VersionParseException("range error in version `"+t+"'")}return r}function r(e,t){return e+"."+t}})();(function(){var e=function t(e,n,i){this._pattern=e;this._deprecated=n;this._deprecatedBy=i};Object.defineProperty(e.prototype,"pattern",{get:function(){return this._pattern}});Object.defineProperty(e.prototype,"deprecated",{get:function(){return this._deprecated}});Object.defineProperty(e.prototype,"deprecatedBy",{get:function(){return this._deprecatedBy}});Ice.Property=e})();(function(){var e={};var t=Ice.Property;e.IceProps=[new t("/^Ice.ACM.Client/",true,null),new t("/^Ice.ACM.Server/",true,null),new t("/^Ice.ACM.Timeout/",false,null),new t("/^Ice.ACM.Heartbeat/",false,null),new t("/^Ice.ACM.Close/",false,null),new t("/^Ice.ACM/",false,null),new t("/^Ice.ACM.Client.Timeout/",false,null),new t("/^Ice.ACM.Client.Heartbeat/",false,null),new t("/^Ice.ACM.Client.Close/",false,null),new t("/^Ice.ACM.Client/",false,null),new t("/^Ice.ACM.Server.Timeout/",false,null),new t("/^Ice.ACM.Server.Heartbeat/",false,null),new t("/^Ice.ACM.Server.Close/",false,null),new t("/^Ice.ACM.Server/",false,null),new t("/^Ice.Admin.ACM.Timeout/",false,null),new t("/^Ice.Admin.ACM.Heartbeat/",false,null),new t("/^Ice.Admin.ACM.Close/",false,null),new t("/^Ice.Admin.ACM/",false,null),new t("/^Ice.Admin.AdapterId/",false,null),new t("/^Ice.Admin.Endpoints/",false,null),new t("/^Ice.Admin.Locator.EndpointSelection/",false,null),new t("/^Ice.Admin.Locator.ConnectionCached/",false,null),new t("/^Ice.Admin.Locator.PreferSecure/",false,null),new t("/^Ice.Admin.Locator.LocatorCacheTimeout/",false,null),new t("/^Ice.Admin.Locator.InvocationTimeout/",false,null),new t("/^Ice.Admin.Locator.Locator/",false,null),new t("/^Ice.Admin.Locator.Router/",false,null),new t("/^Ice.Admin.Locator.CollocationOptimized/",false,null),new t("/^Ice.Admin.Locator.Context../",false,null),new t("/^Ice.Admin.Locator/",false,null),new t("/^Ice.Admin.PublishedEndpoints/",false,null),new t("/^Ice.Admin.ReplicaGroupId/",false,null),new t("/^Ice.Admin.Router.EndpointSelection/",false,null),new t("/^Ice.Admin.Router.ConnectionCached/",false,null),new t("/^Ice.Admin.Router.PreferSecure/",false,null),new t("/^Ice.Admin.Router.LocatorCacheTimeout/",false,null),new t("/^Ice.Admin.Router.InvocationTimeout/",false,null),new t("/^Ice.Admin.Router.Locator/",false,null),new t("/^Ice.Admin.Router.Router/",false,null),new t("/^Ice.Admin.Router.CollocationOptimized/",false,null),new t("/^Ice.Admin.Router.Context../",false,null),new t("/^Ice.Admin.Router/",false,null),new t("/^Ice.Admin.ProxyOptions/",false,null),new t("/^Ice.Admin.ThreadPool.Size/",false,null),new t("/^Ice.Admin.ThreadPool.SizeMax/",false,null),new t("/^Ice.Admin.ThreadPool.SizeWarn/",false,null),new t("/^Ice.Admin.ThreadPool.StackSize/",false,null),new t("/^Ice.Admin.ThreadPool.Serialize/",false,null),new t("/^Ice.Admin.ThreadPool.ThreadIdleTime/",false,null),new t("/^Ice.Admin.ThreadPool.ThreadPriority/",false,null),new t("/^Ice.Admin.MessageSizeMax/",false,null),new t("/^Ice.Admin.DelayCreation/",false,null),new t("/^Ice.Admin.Enabled/",false,null),new t("/^Ice.Admin.Facets/",false,null),new t("/^Ice.Admin.InstanceName/",false,null),new t("/^Ice.Admin.Logger.KeepLogs/",false,null),new t("/^Ice.Admin.Logger.KeepTraces/",false,null),new t("/^Ice.Admin.Logger.Properties/",false,null),new t("/^Ice.Admin.ServerId/",false,null),new t("/^Ice.BackgroundLocatorCacheUpdates/",false,null),new t("/^Ice.BatchAutoFlush/",true,null),new t("/^Ice.BatchAutoFlushSize/",false,null),new t("/^Ice.ChangeUser/",false,null),new t("/^Ice.ClassGraphDepthMax/",false,null),new t("/^Ice.ClientAccessPolicyProtocol/",false,null),new t("/^Ice.Compression.Level/",false,null),new t("/^Ice.CollectObjects/",false,null),new t("/^Ice.Config/",false,null),new t("/^Ice.ConsoleListener/",false,null),new t("/^Ice.Default.CollocationOptimized/",false,null),new t("/^Ice.Default.EncodingVersion/",false,null),new t("/^Ice.Default.EndpointSelection/",false,null),new t("/^Ice.Default.Host/",false,null),new t("/^Ice.Default.Locator.EndpointSelection/",false,null),new t("/^Ice.Default.Locator.ConnectionCached/",false,null),new t("/^Ice.Default.Locator.PreferSecure/",false,null),new t("/^Ice.Default.Locator.LocatorCacheTimeout/",false,null),new t("/^Ice.Default.Locator.InvocationTimeout/",false,null),new t("/^Ice.Default.Locator.Locator/",false,null),new t("/^Ice.Default.Locator.Router/",false,null),new t("/^Ice.Default.Locator.CollocationOptimized/",false,null),new t("/^Ice.Default.Locator.Context../",false,null),new t("/^Ice.Default.Locator/",false,null),new t("/^Ice.Default.LocatorCacheTimeout/",false,null),new t("/^Ice.Default.InvocationTimeout/",false,null),new t("/^Ice.Default.Package/",false,null),new t("/^Ice.Default.PreferSecure/",false,null),new t("/^Ice.Default.Protocol/",false,null),new t("/^Ice.Default.Router.EndpointSelection/",false,null),new t("/^Ice.Default.Router.ConnectionCached/",false,null),new t("/^Ice.Default.Router.PreferSecure/",false,null),new t("/^Ice.Default.Router.LocatorCacheTimeout/",false,null),new t("/^Ice.Default.Router.InvocationTimeout/",false,null),new t("/^Ice.Default.Router.Locator/",false,null),new t("/^Ice.Default.Router.Router/",false,null),new t("/^Ice.Default.Router.CollocationOptimized/",false,null),new t("/^Ice.Default.Router.Context../",false,null),new t("/^Ice.Default.Router/",false,null),new t("/^Ice.Default.SlicedFormat/",false,null),new t("/^Ice.Default.SourceAddress/",false,null),new t("/^Ice.Default.Timeout/",false,null),new t("/^Ice.EventLog.Source/",false,null),new t("/^Ice.FactoryAssemblies/",false,null),new t("/^Ice.HTTPProxyHost/",false,null),new t("/^Ice.HTTPProxyPort/",false,null),new t("/^Ice.ImplicitContext/",false,null),new t("/^Ice.InitPlugins/",false,null),new t("/^Ice.IPv4/",false,null),new t("/^Ice.IPv6/",false,null),new t("/^Ice.LogFile/",false,null),new t("/^Ice.LogFile.SizeMax/",false,null),new t("/^Ice.LogStdErr.Convert/",false,null),new t("/^Ice.MessageSizeMax/",false,null),new t("/^Ice.Nohup/",false,null),new t("/^Ice.NullHandleAbort/",false,null),new t("/^Ice.Override.CloseTimeout/",false,null),new t("/^Ice.Override.Compress/",false,null),new t("/^Ice.Override.ConnectTimeout/",false,null),new t("/^Ice.Override.Timeout/",false,null),new t("/^Ice.Override.Secure/",false,null),new t("/^Ice.Package../",false,null),new t("/^Ice.Plugin../",false,null),new t("/^Ice.PluginLoadOrder/",false,null),new t("/^Ice.PreferIPv6Address/",false,null),new t("/^Ice.PrintAdapterReady/",false,null),new t("/^Ice.PrintProcessId/",false,null),new t("/^Ice.PrintStackTraces/",false,null),new t("/^Ice.ProgramName/",false,null),new t("/^Ice.RetryIntervals/",false,null),new t("/^Ice.ServerIdleTime/",false,null),new t("/^Ice.SOCKSProxyHost/",false,null),new t("/^Ice.SOCKSProxyPort/",false,null),new t("/^Ice.StdErr/",false,null),new t("/^Ice.StdOut/",false,null),new t("/^Ice.SyslogFacility/",false,null),new t("/^Ice.ThreadPool.Client.Size/",false,null),new t("/^Ice.ThreadPool.Client.SizeMax/",false,null),new t("/^Ice.ThreadPool.Client.SizeWarn/",false,null),new t("/^Ice.ThreadPool.Client.StackSize/",false,null),new t("/^Ice.ThreadPool.Client.Serialize/",false,null),new t("/^Ice.ThreadPool.Client.ThreadIdleTime/",false,null),new t("/^Ice.ThreadPool.Client.ThreadPriority/",false,null),new t("/^Ice.ThreadPool.Server.Size/",false,null),new t("/^Ice.ThreadPool.Server.SizeMax/",false,null),new t("/^Ice.ThreadPool.Server.SizeWarn/",false,null),new t("/^Ice.ThreadPool.Server.StackSize/",false,null),new t("/^Ice.ThreadPool.Server.Serialize/",false,null),new t("/^Ice.ThreadPool.Server.ThreadIdleTime/",false,null),new t("/^Ice.ThreadPool.Server.ThreadPriority/",false,null),new t("/^Ice.ThreadPriority/",false,null),new t("/^Ice.Trace.Admin.Properties/",false,null),new t("/^Ice.Trace.Admin.Logger/",false,null),new t("/^Ice.Trace.Locator/",false,null),new t("/^Ice.Trace.Network/",false,null),new t("/^Ice.Trace.Protocol/",false,null),new t("/^Ice.Trace.Retry/",false,null),new t("/^Ice.Trace.Slicing/",false,null),new t("/^Ice.Trace.ThreadPool/",false,null),new t("/^Ice.UDP.RcvSize/",false,null),new t("/^Ice.UDP.SndSize/",false,null),new t("/^Ice.TCP.Backlog/",false,null),new t("/^Ice.TCP.RcvSize/",false,null),new t("/^Ice.TCP.SndSize/",false,null),new t("/^Ice.UseApplicationClassLoader/",false,null),new t("/^Ice.UseSyslog/",false,null),new t("/^Ice.Warn.AMICallback/",false,null),new t("/^Ice.Warn.Connections/",false,null),new t("/^Ice.Warn.Datagrams/",false,null),new t("/^Ice.Warn.Dispatch/",false,null),new t("/^Ice.Warn.Endpoints/",false,null),new t("/^Ice.Warn.UnknownProperties/",false,null),new t("/^Ice.Warn.UnusedProperties/",false,null),new t("/^Ice.CacheMessageBuffers/",false,null),new t("/^Ice.ThreadInterruptSafe/",false,null),new t("/^Ice.Voip/",false,null)];
+e.validProps=[e.IceProps];e.clPropNames=["Ice"];Ice.PropertyNames=e})();(function(){var e=Ice.HashMap;var t=Ice.AlreadyRegisteredException;var n=Ice.NotRegisteredException;var i=Ice.Class({__init__:function(){this._factoryMap=new e},add:function(e,n){var i,r;i=this._factoryMap.get(n);if(i!==undefined){r=new t;r.id=n;r.kindOfObject="object factory";throw r}this._factoryMap.set(n,e)},remove:function(e){var t,i;t=this._factoryMap.get(e);if(t===undefined){i=new n;i.id=e;i.kindOfObject="object factory";throw i}this._factoryMap.delete(e);t.destroy()},find:function(e){return this._factoryMap.get(e)},destroy:function(){var t=this._factoryMap,n=t.entries;this._factoryMap=new e;while(n!==null){n.value.destroy();n=n.next}}});Ice.ObjectFactoryManager=i})();(function(){var e=Ice.Promise;var t=Ice.Class(e,{__init__:function(t,n,i,r,s){e.call(this);if(t!==undefined){this._communicator=t;this._instance=t!==null?t.instance:null;this._operation=n;this._connection=i;this._proxy=r;this._adapter=s}}});var n=t.prototype;var i=Object.defineProperty;i(n,"communicator",{get:function(){return this._communicator}});i(n,"connection",{get:function(){return this._connection}});i(n,"proxy",{get:function(){return this._proxy}});i(n,"adapter",{get:function(){return this._adapter}});i(n,"operation",{get:function(){return this._operation}});Ice.AsyncResultBase=t})();(function(){t.defineDictionary(Ice,"Context","ContextHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined);Ice.OperationMode=t.defineEnum([["Normal",0],["Nonmutating",1],["Idempotent",2]]);Ice.Current=t.defineStruct(function(e,t,n,i,r,s,o,c,a){this.adapter=e!==undefined?e:null;this.con=t!==undefined?t:null;this.id=n!==undefined?n:new Ice.Identity;this.facet=i!==undefined?i:"";this.operation=r!==undefined?r:"";this.mode=s!==undefined?s:Ice.OperationMode.Normal;this.ctx=o!==undefined?o:null;this.requestId=c!==undefined?c:0;this.encoding=a!==undefined?a:new Ice.EncodingVersion},false)})();(function(){Ice.ObjectFactory=Ice.Class({create:function(e){throw new Error("not implemented")},destroy:function(){throw new Error("not implemented")}})})();(function(){var e=Ice.Class(Error,{__init__:function(t){if(t instanceof Ice.LocalException){this._ex=t}else{Ice.Debug.assert(t instanceof e);this._ex=t._ex}}});var t=e.prototype;Object.defineProperty(t,"inner",{get:function(){return this._ex}});Ice.RetryException=e})();(function(){Ice.EndpointSelectionType=t.defineEnum([["Random",0],["Ordered",1]])})();(function(){var e=Ice.Promise;var t=Ice.ReferenceMode;var n=Ice.Class({__init__:function(e,n,i){this._reference=e;this._response=e.getMode()==t.ModeTwoway;this._connection=n;this._compress=i},update:function(e,t){try{if(e===this){return t}else if(e.getConnection()===this._connection){return t}}catch(n){}return this},sendAsyncRequest:function(e){return e.__invokeRemote(this._connection,this._compress,this._response)},asyncRequestCanceled:function(e){return this._connection.asyncRequestCanceled(e)},getReference:function(){return this._reference},getConnection:function(){return this._connection}});Ice.ConnectionRequestHandler=n})();(function(){var e=Ice.Debug;var t=Ice.HashMap;var n=Ice.Protocol;var i=Ice.StringUtil;var r=Ice.OperationMode;var s=Ice.Identity;var o={};o.traceSend=function(e,t,n){if(n.protocol>=1){var i=e.pos;e.pos=0;var r=[];var s=_(r,e);t.trace(n.protocolCat,"sending "+I(s)+" "+r.join(""));e.pos=i}};o.traceRecv=function(e,t,n){if(n.protocol>=1){var i=e.pos;e.pos=0;var r=[];var s=_(r,e);t.trace(n.protocolCat,"received "+I(s)+" "+r.join(""));e.pos=i}};o.trace=function(e,t,n,i){if(i.protocol>=1){var r=t.pos;t.pos=0;var s=[];s.push(e);_(s,t);n.trace(i.protocolCat,s.join(""));t.pos=r}};var c=new t;function a(e,t,n,i){if(!c.has(t)){var r="unknown "+e+" type `"+t+"'";i.trace(n,r);c.set(t,1)}}o.dumpStream=function(e){var t=e.pos;e.pos=0;var n=e.readBlob(e.size());o.dumpOctets(n);e.pos=t};o.dumpOctets=function(e){var t=8;var n=[];for(var i=0;i=32&&e[r]<127){n.push(String.fromCharCode(e[r]))}else{n.push(".")}}n.push('"\n')}console.log(n.join(""))};Ice.TraceUtil=o;function u(e,t){var n=new s;n.__read(t);e.push("\nidentity = "+t.instance.identityToString(n));var r=Ice.StringSeqHelper.read(t);e.push("\nfacet = ");if(r.length>0){e.push(i.escapeString(r[0],""))}var o=t.readString();e.push("\noperation = "+o)}function l(e,t){var n=t.readInt();e.push("\nrequest id = "+n);if(n===0){e.push(" (oneway)")}d(e,t)}function h(e,t){var n=t.readInt();e.push("\nnumber of requests = "+n);for(var i=0;i0){var s=t.readString();var o=t.readString();e.push(s+"/"+o);if(i>0){e.push(", ")}}var c=t.skipEncaps();if(!c.equals(Ice.Encoding_1_0)){e.push("\nencoding = ");e.push(Ice.encodingVersionToString(c))}}function p(e,t){t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();var n=t.readByte();e.push("\nmessage type = "+n+" ("+I(n)+")");var i=t.readByte();e.push("\ncompression status = "+i+" ");switch(i){case 0:{e.push("(not compressed; do not compress response, if any)");break}case 1:{e.push("(not compressed; compress response, if any)");break}case 2:{e.push("(compressed; compress response, if any)");break}default:{e.push("(unknown)");break}}var r=t.readInt();e.push("\nmessage size = "+r);return n}function _(e,t){var i=p(e,t);switch(i){case n.closeConnectionMsg:case n.validateConnectionMsg:{break}case n.requestMsg:{l(e,t);break}case n.requestBatchMsg:{h(e,t);break}case n.replyMsg:{f(e,t);break}default:{break}}return i}function I(e){switch(e){case n.requestMsg:return"request";case n.requestBatchMsg:return"batch request";case n.replyMsg:return"reply";case n.closeConnectionMsg:return"close connection";case n.validateConnectionMsg:return"validate connection";default:return"unknown"}}})();(function(){var e=Ice.Logger;var t=null;Ice.getProcessLogger=function(){if(t===null){t=new e("","")}return t};Ice.setProcessLogger=function(e){t=e}})();(function(){var e=Ice.UnexpectedObjectException;var t=Ice.MemoryLimitException;Ice.ExUtil={throwUOE:function(t,n){var i=n.ice_id();throw new e("expected element of type `"+t+"' but received '"+i,i,t)},throwMemoryLimitException:function(e,n){throw new t("requested "+e+" bytes, maximum allowed is "+n+" bytes (see Ice.MessageSizeMax)")}}})();(function(){var e=Ice.StringUtil;var t=Ice.HashMap;var n=Ice.Promise;var i=Ice.PropertyNames;var r=Ice.Debug;var s=Ice.ProcessLogger;var o=Ice.getProcessLogger;var c=Ice.InitializationException;var a=0;var u=1;var l=Ice.Class({__init__:function(e,n){this._properties=new t;if(n!==undefined&&n!==null){for(var i=n._properties.entries;i!==null;i=i.next){this._properties.set(i.key,{value:i.value.value,used:false})}}if(e!==undefined&&e!==null){var r=this.parseIceCommandLineOptions(e);e.length=0;for(var s=0;s0){var g=this._properties.get(e);if(g!==undefined){g.value=t}else{this._properties.set(e,{value:t,used:false})}}else{this._properties.delete(e)}},getCommandLineOptions:function(){var e=[];for(var t=this._properties.entries;t!==null;t=t.next){e.push("--"+t.key+"="+t.pv.value)}return e},parseCommandLineOptions:function(e,t){if(e.length>0&&e.charAt(e.length-1)!="."){e+="."}e="--"+e;var n=[];var i=this;t.forEach(function(t){if(t.indexOf(e)===0){if(t.indexOf("=")===-1){t+="=1"}i.parseLine(t.substring(2))}else{n.push(t)}});return n},parseIceCommandLineOptions:function(e){var t=e.slice();for(var n=0;n0){c.id+=" -f "+n.escapeString(s,"")}throw c}}o.set(s,i)},addDefaultServant:function(t,n){e.assert(this._instance!==null);var i=this._defaultServantMap.get(n);if(i!==undefined){var r=new Ice.AlreadyRegisteredException;r.kindOfObject="default servant";r.id=n;throw r}this._defaultServantMap.set(n,t)},removeServant:function(t,i){e.assert(this._instance!==null);if(i===null){i=""}var r=this._servantMapMap.get(t);if(r===undefined||!r.has(i)){var s=new Ice.NotRegisteredException;s.id=this._instance.identityToString(t);s.kindOfObject="servant";if(i.length>0){s.id+=" -f "+n.escapeString(i,"")}throw s}var o=r.get(i);r.delete(i);if(r.size===0){this._servantMapMap.delete(t)}return o},removeDefaultServant:function(t){e.assert(this._instance!==null);var n=this._defaultServantMap.get(t);if(n===undefined){var i=new Ice.NotRegisteredException;i.kindOfObject="default servant";i.id=t;throw i}this._defaultServantMap.delete(t);return n},removeAllFacets:function(t){e.assert(this._instance!==null);var n=this._servantMapMap.get(t);if(n===undefined){var i=new Ice.NotRegisteredException;i.id=this._instance.identityToString(t);i.kindOfObject="servant";throw i}this._servantMapMap.delete(t);return n},findServant:function(e,t){if(t===null){t=""}var n=this._servantMapMap.get(e);var i=null;if(n===undefined){i=this._defaultServantMap.get(e.category);if(i===undefined){i=this._defaultServantMap.get("")}}else{i=n.get(t)}return i===undefined?null:i},findDefaultServant:function(t){e.assert(this._instance!==null);var n=this._defaultServantMap.get(t);return n===undefined?null:n},findAllFacets:function(n){e.assert(this._instance!==null);var i=this._servantMapMap.get(n);if(i!==undefined){return i.clone()}return new t},hasServant:function(t){var n=this._servantMapMap.get(t);if(n===undefined){return false}else{e.assert(n.size>0);return true}},addServantLocator:function(t,i){e.assert(this._instance!==null);var r=this._locatorMap.get(i);if(r!==undefined){var s=new Ice.AlreadyRegisteredException;s.id=n.escapeString(i,"");s.kindOfObject="servant locator";throw s}this._locatorMap.set(i,t)},removeServantLocator:function(t){e.assert(this._instance!==null);var i=this._locatorMap.get(t);if(i===undefined){var r=new Ice.NotRegisteredException;r.id=n.escapeString(t,"");r.kindOfObject="servant locator";throw r}this._locatorMap.delete(t);return i},findServantLocator:function(e){var t=this._locatorMap.get(e);return t===undefined?null:t},destroy:function(){e.assert(this._instance!==null);var t=this._instance.initializationData().logger;this._servantMapMap.clear();this._defaultServantMap.clear();var n=this._locatorMap.clone();this._locatorMap.clear();this._instance=null;for(var i=n.entries;i!==null;i=i.next){var r=i.value;try{r.deactivate(i.key)}catch(s){var o="exception during locator deactivation:\n"+"object adapter: `"+this._adapterName+"'\n"+"locator category: `"+i.key+"'\n"+s.toString();t.error(o)}}}});Ice.ServantManager=i})();(function(){var e=Ice.__M;var t=Ice.Debug;var n=Ice.ExUtil;var i=Ice.FormatType;var r=Ice.HashMap;var s=Ice.Object;var o=Ice.OptionalFormat;var c=Ice.Protocol;var a=Ice.TraceUtil;var u=Ice.ArrayUtil;var l=Ice.SlicedData;var h={};h.NoSlice=0;h.ObjectSlice=1;h.ExceptionSlice=2;var f=255;var d=1<<0;var p=1<<1;var _=1<<1|1<<0;var I=1<<2;var g=1<<3;var v=1<<4;var m=1<<5;Number.isNaN=Number.isNaN||function(e){return typeof e==="number"&&isNaN(e)};var y=function(e,t){this.index=e;this.patcher=t};var w=Ice.Class;var E=w({__init__:function(e,t,n,i){this._stream=e;this._encaps=t;this._sliceObjects=n;this._servantFactoryManager=i;this._patchMap=null;this._unmarshaledMap=new r;this._typeIdMap=null;this._typeIdIndex=0;this._objectList=null},readOpt:function(){return false},readPendingObjects:function(){},readTypeId:function(e){var t,n;if(this._typeIdMap===null){this._typeIdMap=new r}if(e){n=this._stream.readSize();t=this._typeIdMap.get(n);if(t===undefined){throw new Ice.UnmarshalOutOfBoundsException}}else{t=this._stream.readString();this._typeIdMap.set(++this._typeIdIndex,t)}return t},newInstance:function(e){var t=this._servantFactoryManager.find(e);var n=null;if(t!==undefined){n=t.create(e)}if(n===null||n===undefined){t=this._servantFactoryManager.find("");if(t!==undefined){n=t.create(e)}}if(n===null||n===undefined){n=this._stream.createObject(e)}return n},addPatchEntry:function(e,n){t.assert(e>0);var i=this._unmarshaledMap.get(e);if(i!==undefined&&i!==null){n.call(null,i);return}if(this._patchMap===null){this._patchMap=new r}var s=this._patchMap.get(e);if(s===undefined){s=[];this._patchMap.set(e,s)}s.push(n)},unmarshal:function(e,n){var i,r,s;this._unmarshaledMap.set(e,n);n.__read(this._stream);if(this._patchMap!==null){s=this._patchMap.get(e);if(s!==undefined){t.assert(s.length>0);for(i=0,r=s.length;i0){throw new Ice.MarshalException("invalid object id")}n=-n;if(n===0){e.call(null,null)}else{this.addPatchEntry(n,e)}},throwException:function(){t.assert(this._sliceType===h.NoSlice);var e=this._stream.readBool();this._sliceType=h.ExceptionSlice;this._skipFirstSlice=false;this.startSlice();var n=this._typeId;while(true){var i=this._stream.createUserException(this._typeId);if(i!==null){i.__read(this._stream);if(e){this.readPendingObjects()}throw i}this.skipSlice();try{this.startSlice()}catch(r){if(r instanceof Ice.UnmarshalOutOfBoundsException){r.reason="unknown exception type `"+n+"'"}throw r}}},startInstance:function(e){t.assert(this._sliceType===e);this._skipFirstSlice=true},endInstance:function(){var e;if(this._sliceType===h.ObjectSlice){this.startSlice();e=this._stream.readSize();if(e!==0){throw new Ice.MarshalException("invalid Object slice")}this.endSlice()}this._sliceType=h.NoSlice;return null},startSlice:function(){var e;if(this._skipFirstSlice){this._skipFirstSlice=false;return this._typeId}if(this._sliceType===h.ObjectSlice){e=this._stream.readBool();this._typeId=this.readTypeId(e)}else{this._typeId=this._stream.readString()}this._sliceSize=this._stream.readInt();if(this._sliceSize<4){throw new Ice.UnmarshalOutOfBoundsException}return this._typeId},endSlice:function(){},skipSlice:function(){if(this._stream.instance.traceLevels().slicing>0){var e=this._stream.instance.initializationData().logger;if(this._sliceType===h.ObjectSlice){a.traceSlicing("object",this._typeId,this._stream.instance.traceLevels().slicingCat,e)}else{a.traceSlicing("exception",this._typeId,this._stream.instance.traceLevels().slicingCat,e)}}t.assert(this._sliceSize>=4);this._stream.skip(this._sliceSize-4)},readPendingObjects:function(){var e,t;do{t=this._stream.readSize();for(e=t;e>0;--e){this.readInstance()}}while(t>0);if(this._patchMap!==null&&this._patchMap.size!==0){throw new Ice.MarshalException("index for class received, but no instance")}},readInstance:function(){var e=this._stream.readInt(),t,n=null;if(e<=0){throw new Ice.MarshalException("invalid object id")}this._sliceType=h.ObjectSlice;this._skipFirstSlice=false;this.startSlice();t=this._typeId;while(true){if(this._typeId==s.ice_staticId()){throw new Ice.NoObjectFactoryException("",t)}n=this.newInstance(this._typeId);if(n){break}if(!this._sliceObjects){throw new Ice.NoObjectFactoryException("no object factory found and object slicing is disabled",this._typeId)}this.skipSlice();this.startSlice()}this.unmarshal(e,n)}});var S=w(E,{__init__:function(e,t,n,i){E.call(this,e,t,n,i);this._current=null;this._objectIdIndex=1},readObject:function(e){t.assert(e!==undefined);var n=this._stream.readSize();if(n<0){throw new Ice.MarshalException("invalid object id")}if(n===0){if(e!==null){e.call(null,null)}}else if(this._current!==null&&(this._current.sliceFlags&g)!==0){if(e!==null){if(this._current.indirectPatchList===null){this._current.indirectPatchList=[]}var i=new y;i.index=n-1;i.patcher=e;this._current.indirectPatchList.push(i)}}else{this.readInstance(n,e)}},throwException:function(){t.assert(this._current===null);this.push(h.ExceptionSlice);this.startSlice();var e=this._current.typeId;while(true){var n=this._stream.createUserException(this._current.typeId);if(n!==null){n.__read(this._stream);throw n}this.skipSlice();if((this._current.sliceFlags&m)!==0){if(e.indexOf("::")===0){throw new Ice.UnknownUserException(e.substr(2))}throw new Ice.UnknownUserException(e)}this.startSlice()}},startInstance:function(e){t.assert(e!==undefined);t.assert(this._current.sliceType!==null&&this._current.sliceType===e);this._current.skipFirstSlice=true},endInstance:function(e){var t=null;if(e){t=this.readSlicedData()}if(this._current.slices!==null){this._current.slices.length=0;this._current.indirectionTables.length=0}this._current=this._current.previous;return t},startSlice:function(){if(this._current.skipFirstSlice){this._current.skipFirstSlice=false;return this._current.typeId}this._current.sliceFlags=this._stream.readByte();if(this._current.sliceType===h.ObjectSlice){if((this._current.sliceFlags&_)===_){this._current.typeId="";this._current.compactId=this._stream.readSize()}else if((this._current.sliceFlags&(p|d))!==0){this._current.typeId=this.readTypeId((this._current.sliceFlags&p)!==0);this._current.compactId=-1}else{this._current.typeId="";this._current.compactId=-1}}else{this._current.typeId=this._stream.readString();this._current.compactId=-1}if((this._current.sliceFlags&v)!==0){this._current.sliceSize=this._stream.readInt();if(this._current.sliceSize<4){throw new Ice.UnmarshalOutOfBoundsException}}else{this._current.sliceSize=0}return this._current.typeId},endSlice:function(){var e,n,i=[],r;if((this._current.sliceFlags&I)!==0){this._stream.skipOpts()}if((this._current.sliceFlags&g)!==0){r=this._stream.readAndCheckSeqSize(1);for(n=0;n=0);if(e.index>=i.length){throw new Ice.MarshalException("indirection out of range")}this.addPatchEntry(i[e.index],e.patcher)}this._current.indirectPatchList.length=0}}},skipSlice:function(){if(this._stream.instance.traceLevels().slicing>0){var e=this._stream.instance.initializationData().logger;var n=this._stream.instance.traceLevels().slicingCat;if(this._current.sliceType===h.ExceptionSlice){a.traceSlicing("exception",this._current.typeId,n,e)}else{a.traceSlicing("object",this._current.typeId,n,e)}}var i=this._stream.pos;if((this._current.sliceFlags&v)!==0){t.assert(this._current.sliceSize>=4);this._stream.skip(this._current.sliceSize-4)}else{if(this._current.sliceType===h.ObjectSlice){throw new Ice.NoObjectFactoryException("no object factory found and compact format prevents slicing "+"(the sender should use the sliced format instead)",this._current.typeId)}if(this._current.typeId.indexOf("::")===0){throw new Ice.UnknownUserException(this._current.typeId.substring(2))}throw new Ice.UnknownUserException(this._current.typeId)}var r=new Ice.SliceInfo;r.typeId=this._current.typeId;r.compactId=this._current.compactId;r.hasOptionalMembers=(this._current.sliceFlags&I)!==0;r.isLastSlice=(this._current.sliceFlags&m)!==0;var s=this._stream._buf;var o=s.position;var c=o;if(r.hasOptionalMembers){--c}s.position=i;r.bytes=s.getArray(c-i);s.position=o;if(this._current.slices===null){this._current.slices=[];this._current.indirectionTables=[]}if((this._current.sliceFlags&g)!==0){var u=this._stream.readAndCheckSeqSize(1);var l=[];for(var f=0;f0);var i,r=null;if(e>1){if(n!==null){this.addPatchEntry(e,n)}return e}this.push(h.ObjectSlice);e=++this._objectIdIndex;this.startSlice();i=this._current.typeId;while(true){if(this._current.compactId>=0){this._current.typeId="";if(this._current.typeId.length===0){this._current.typeId=this._stream.getTypeId(this._current.compactId)}}if(this._current.typeId.length>0){r=this.newInstance(this._current.typeId);if(r!==null&&r!==undefined){break}}if(!this._sliceObjects){throw new Ice.NoObjectFactoryException("no object factory found and object slicing is disabled",this._current.typeId)}this.skipSlice();if((this._current.sliceFlags&m)!==0){r=new Ice.UnknownSlicedObject(i);break}this.startSlice()}this.unmarshal(e,r);if(this._current===null&&this._patchMap!==null&&this._patchMap.size!==0){throw new Ice.MarshalException("index for class received, but no instance")}if(n!==null){n.call(null,r)}return e},readSlicedData:function(){var e,n,i,r,o,c;if(this._current.slices===null){return null}t.assert(this._current.slices.length===this._current.indirectionTables.length);for(e=0,n=this._current.slices.length;e0){this._marshaledMap.merge(this._toBeMarshaledMap);n=this._toBeMarshaledMap;this._toBeMarshaledMap=new r;this._stream.writeSize(n.size);n.forEach(t)}this._stream.writeSize(0)},registerObject:function(e){t.assert(e!==null);var n=this._toBeMarshaledMap.get(e);if(n!==undefined){return n}n=this._marshaledMap.get(e);if(n!==undefined){return n}this._toBeMarshaledMap.set(e,++this._objectIdIndex);return this._objectIdIndex}});var M=w(C,{__init__:function(e,t){C.call(this,e,t);this._current=null;this._objectIdIndex=1},writeObject:function(e){t.assert(e!==undefined);var n,s;if(e===null){this._stream.writeSize(0)}else if(this._current!==null&&this._encaps.format===i.SlicedFormat){if(this._current.indirectionTable===null){this._current.indirectionTable=[];this._current.indirectionMap=new r}n=this._current.indirectionMap.get(e);if(n===undefined){this._current.indirectionTable.push(e);s=this._current.indirectionTable.length;this._current.indirectionMap.set(e,s);this._stream.writeSize(s)}else{this._stream.writeSize(n)}}else{this.writeInstance(e)}},writePendingObjects:function(){return undefined},writeUserException:function(e){t.assert(e!==null&&e!==undefined);e.__write(this._stream)},startInstance:function(e,t){if(this._current===null){this._current=new M.InstanceData(null)}else{this._current=this._current.next===null?new M.InstanceData(this._current):this._current.next}this._current.sliceType=e;this._current.firstSlice=true;if(t!==null&&t!==undefined){this.writeSlicedData(t)}},endInstance:function(){this._current=this._current.previous},startSlice:function(e,n,r){t.assert((this._current.indirectionTable===null||this._current.indirectionTable.length===0)&&(this._current.indirectionMap===null||this._current.indirectionMap.size===0));this._current.sliceFlagsPos=this._stream.pos;this._current.sliceFlags=0;if(this._encaps.format===i.SlicedFormat){this._current.sliceFlags|=v}if(r){this._current.sliceFlags|=m}this._stream.writeByte(0);if(this._current.sliceType===h.ObjectSlice){if(this._encaps.format===i.SlicedFormat||this._current.firstSlice){if(n>=0){this._current.sliceFlags|=_;this._stream.writeSize(n)}else{var s=this.registerTypeId(e);if(s<0){this._current.sliceFlags|=d;this._stream.writeString(e)}else{this._current.sliceFlags|=p;this._stream.writeSize(s)}}}}else{this._stream.writeString(e)}if((this._current.sliceFlags&v)!==0){
+this._stream.writeInt(0)}this._current.writeSlice=this._stream.pos;this._current.firstSlice=false},endSlice:function(){var e,n,r;if((this._current.sliceFlags&I)!==0){this._stream.writeByte(f)}if((this._current.sliceFlags&v)!==0){e=this._stream.pos-this._current.writeSlice+4;this._stream.rewriteInt(e,this._current.writeSlice-4)}if(this._current.indirectionTable!==null&&this._current.indirectionTable.length!==0){t.assert(this._encaps.format===i.SlicedFormat);this._current.sliceFlags|=g;this._stream.writeSize(this._current.indirectionTable.length);for(n=0,r=this._current.indirectionTable.length;n0){if(this._current.indirectionTable===null){this._current.indirectionTable=[];this._current.indirectionMap=new r}for(c=0,a=o.objects.length;cthis._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}this._readEncapsStack.sz=t;var n=new Ice.EncodingVersion;n.__read(this);c.checkSupportedEncoding(n);this._readEncapsStack.setEncoding(n);return n},endReadEncaps:function(){t.assert(this._readEncapsStack!==null);if(!this._readEncapsStack.encoding_1_0){this.skipOpts();if(this._buf.position!==this._readEncapsStack.start+this._readEncapsStack.sz){throw new Ice.EncapsulationException}}else if(this._buf.position!==this._readEncapsStack.start+this._readEncapsStack.sz){if(this._buf.position+1!==this._readEncapsStack.start+this._readEncapsStack.sz){throw new Ice.EncapsulationException}try{this._buf.get()}catch(e){throw new Ice.UnmarshalOutOfBoundsException}}var n=this._readEncapsStack;this._readEncapsStack=n.next;n.next=this._readEncapsCache;this._readEncapsCache=n;this._readEncapsCache.reset()},skipEmptyEncaps:function(){var e=this.readInt();if(e<6){throw new Ice.EncapsulationException}if(e-4>this._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}var t=new Ice.EncodingVersion;t.__read(this);if(t.equals(Ice.Encoding_1_0)){if(e!=6){throw new Ice.EncapsulationException}}else{this._buf.position=this._buf.position+e-6}return t},endReadEncapsChecked:function(){if(this._readEncapsStack===null){throw new Ice.EncapsulationException("not in an encapsulation")}this.endReadEncaps()},readEncaps:function(e){t.assert(e!==undefined);var n=this.readInt();if(n<6){throw new Ice.UnmarshalOutOfBoundsException}if(n-4>this._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}if(e!==null){e.__read(this);this._buf.position=this._buf.position-6}else{this._buf.position=this._buf.position-4}try{return this._buf.getArray(n)}catch(i){throw new Ice.UnmarshalOutOfBoundsException}},getReadEncoding:function(){return this._readEncapsStack!==null?this._readEncapsStack.encoding:this._encoding},getReadEncapsSize:function(){t.assert(this._readEncapsStack!==null);return this._readEncapsStack.sz-6},skipEncaps:function(){var e=this.readInt();if(e<6){throw new Ice.UnmarshalOutOfBoundsException}var t=new Ice.EncodingVersion;t.__read(this);try{this._buf.position=this._buf.position+e-6}catch(n){throw new Ice.UnmarshalOutOfBoundsException}return t},startWriteSlice:function(e,n,i){t.assert(this._writeEncapsStack!==null&&this._writeEncapsStack.encoder!==null);this._writeEncapsStack.encoder.startSlice(e,n,i)},endWriteSlice:function(){t.assert(this._writeEncapsStack!==null&&this._writeEncapsStack.encoder!==null);this._writeEncapsStack.encoder.endSlice()},startReadSlice:function(){t.assert(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null);return this._readEncapsStack.decoder.startSlice()},endReadSlice:function(){t.assert(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null);this._readEncapsStack.decoder.endSlice()},skipSlice:function(){t.assert(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null);this._readEncapsStack.decoder.skipSlice()},readPendingObjects:function(){if(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null){this._readEncapsStack.decoder.readPendingObjects()}else if(this._readEncapsStack!==null&&this._readEncapsStack.encoding_1_0||this._readEncapsStack===null&&this._encoding.equals(Ice.Encoding_1_0)){this.skipSize()}},writePendingObjects:function(){if(this._writeEncapsStack!==null&&this._writeEncapsStack.encoder!==null){this._writeEncapsStack.encoder.writePendingObjects()}else if(this._writeEncapsStack!==null&&this._writeEncapsStack.encoding_1_0||this._writeEncapsStack===null&&this._encoding.equals(Ice.Encoding_1_0)){this.writeSize(0)}},writeSize:function(e){if(e>254){this.expand(5);this._buf.put(255);this._buf.putInt(e)}else{this.expand(1);this._buf.put(e)}},readSize:function(){try{var e=this._buf.get();if(e===255){var t=this._buf.getInt();if(t<0){throw new Ice.UnmarshalOutOfBoundsException}return t}return e}catch(n){throw new Ice.UnmarshalOutOfBoundsException}},readAndCheckSeqSize:function(e){var t=this.readSize();if(t===0){return t}if(this._startSeq===-1||this._buf.position>this._startSeq+this._minSeqSize){this._startSeq=this._buf.position;this._minSeqSize=t*e}else{this._minSeqSize+=t*e}if(this._startSeq+this._minSeqSize>this._buf.limit){throw new Ice.UnmarshalOutOfBoundsException}return t},startSize:function(){var e=this._buf.position;this.writeInt(0);return e},endSize:function(e){t.assert(e>=0);this.rewriteInt(this._buf.position-e-4,e)},writeBlob:function(e){if(e===null){return}this.expand(e.length);this._buf.putArray(e)},readBlob:function(e){if(this._buf.remaining=this._readEncapsStack.start+this._readEncapsStack.sz){return false}i=this.readByte();if(i===f){this._buf.position-=1;return false}r=o.valueOf(i&7);s=i>>3;if(s===30){s=this.readSize()}if(s>e){c=s<30?1:s<255?2:6;this._buf.position-=c;return false}if(s=this._readEncapsStack.start+this._readEncapsStack.sz){return}e=this.readByte();t=e<0?e+256:e;if(t===f){return}n=o.valueOf(t&7);if(t>>3===30){this.skipSize()}this.skipOpt(n)}},skip:function(e){if(e>this._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}this._buf.position+=e},skipSize:function(){var e=this.readByte();if(e===255){this.skip(4)}},isEmpty:function(){return this._buf.empty()},expand:function(e){this._buf.expand(e)},createObject:function(t){var n=null,i;try{var r=t.length>2?t.substr(2).replace(/::/g,"."):"";i=e.type(r);if(i!==undefined){n=new i}}catch(s){throw new Ice.NoObjectFactoryException("no object factory",t,s)}return n},getTypeId:function(e){var t=Ice.CompactIdRegistry.get(e);return t===undefined?"":t},isReadEncoding_1_0:function(){return this._readEncapsStack!==null?this._readEncapsStack.encoding_1_0:this._encoding.equals(Ice.Encoding_1_0)},isWriteEncoding_1_0:function(){return this._writeEncapsStack?this._writeEncapsStack.encoding_1_0:this._encoding.equals(Ice.Encoding_1_0)},initReadEncaps:function(){if(this._readEncapsStack===null){this._readEncapsStack=this._readEncapsCache;if(this._readEncapsStack!==null){this._readEncapsCache=this._readEncapsCache.next}else{this._readEncapsStack=new O}this._readEncapsStack.setEncoding(this._encoding);this._readEncapsStack.sz=this._buf.limit}if(this._readEncapsStack.decoder===null){var e=this._instance.servantFactoryManager();if(this._readEncapsStack.encoding_1_0){this._readEncapsStack.decoder=new x(this,this._readEncapsStack,this._sliceObjects,e)}else{this._readEncapsStack.decoder=new S(this,this._readEncapsStack,this._sliceObjects,e)}}},initWriteEncaps:function(){if(!this._writeEncapsStack){this._writeEncapsStack=this._writeEncapsCache;if(this._writeEncapsStack){this._writeEncapsCache=this._writeEncapsCache.next}else{this._writeEncapsStack=new k}this._writeEncapsStack.setEncoding(this._encoding)}if(this._writeEncapsStack.format===i.DefaultFormat){this._writeEncapsStack.format=this._instance.defaultsAndOverrides().defaultFormat}if(!this._writeEncapsStack.encoder){if(this._writeEncapsStack.encoding_1_0){this._writeEncapsStack.encoder=new P(this,this._writeEncapsStack)}else{this._writeEncapsStack.encoder=new M(this,this._writeEncapsStack)}}},createUserException:function(t){var n=null,i;try{var r=t.length>2?t.substr(2).replace(/::/g,"."):"";i=e.type(r);if(i!==undefined){n=new i}}catch(s){throw new Ice.MarshalException(s)}return n}});var T=Object.defineProperty;T(A.prototype,"pos",{get:function(){return this._buf.position},set:function(e){this._buf.position=e}});T(A.prototype,"size",{get:function(){return this._buf.limit}});T(A.prototype,"instance",{get:function(){return this._instance}});T(A.prototype,"closure",{get:function(){return this._type},set:function(e){this._type=e}});T(A.prototype,"buffer",{get:function(){return this._buf}});var L=function(e,t,n,i,r,s){var o={write:function(t,n){return e.call(t,n)},read:function(e){return t.call(e)},writeOpt:function(t,n,r){t.writeOptValue(n,i,e,r)},readOpt:function(e,n){return e.readOptValue(n,i,t)}};if(r!==undefined&&s!==undefined){o.validate=function(e){return e>=r&&e<=s}}T(o,"minWireSize",{get:function(){return n}});return o};var F=A.prototype;var R=0;var D=255;var j=-32768;var z=32767;var q=0;var B=4294967295;var U=-2147483648;var H=2147483647;var N=-3.4028234664e38;var W=3.4028234664e38;Ice.ByteHelper=L(F.writeByte,F.readByte,1,Ice.OptionalFormat.F1,R,D);Ice.ShortHelper=L(F.writeShort,F.readShort,2,Ice.OptionalFormat.F2,j,z);Ice.IntHelper=L(F.writeInt,F.readInt,4,Ice.OptionalFormat.F4,U,H);Ice.FloatHelper=L(F.writeFloat,F.readFloat,4,Ice.OptionalFormat.F4,N,W);Ice.FloatHelper.validate=function(e){return Number.isNaN(e)||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY||e>=N&&e<=W};Ice.DoubleHelper=L(F.writeDouble,F.readDouble,8,Ice.OptionalFormat.F8,-Number.MAX_VALUE,Number.MAX_VALUE);Ice.DoubleHelper.validate=function(e){return Number.isNaN(e)||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY||e>=-Number.MAX_VALUE&&e<=Number.MAX_VALUE};Ice.BoolHelper=L(F.writeBool,F.readBool,1,Ice.OptionalFormat.F1);Ice.LongHelper=L(F.writeLong,F.readLong,8,Ice.OptionalFormat.F8);Ice.LongHelper.validate=function(e){return e.low>=q&&e.low<=B&&e.high>=q&&e.high<=B};Ice.StringHelper=L(F.writeString,F.readString,1,Ice.OptionalFormat.VSize);Ice.ObjectHelper={write:function(e,t){e.writeObject(t)},read:function(e){var t;e.readObject(function(e){t=e},Ice.Object);return t},writeOpt:function(e,t,n){e.writeOptValue(t,Ice.OptionalFormat.Class,F.writeObject,n)},readOpt:function(e,t){var n;e.readOptObject(t,function(e){n=e},Ice.Object);return n}};T(Ice.ObjectHelper,"minWireSize",{get:function(){return 1}});Ice.BasicStream=A})();(function(){Ice.SocketOperation={None:0,Read:1,Write:2,Connect:2}})();(function(){var e=Ice.Class({__init__:function(e,t,n,i){this._instance=e;this._traceLevel=e.traceLevels().network;this._traceCategory=e.traceLevels().networkCat;this._logger=e.initializationData().logger;this._properties=e.initializationData().properties;this._type=t;this._protocol=n;this._secure=i},traceLevel:function(){return this._traceLevel},traceCategory:function(){return this._traceCategory},logger:function(){return this._logger},protocol:function(){return this._protocol},type:function(){return this._type},secure:function(){return this._secure},properties:function(){return this._properties},defaultHost:function(){return this._instance.defaultsAndOverrides().defaultHost},defaultSourceAddress:function(){return this._instance.defaultsAndOverrides().defaultSourceAddress},defaultEncoding:function(){return this._instance.defaultsAndOverrides().defaultEncoding},defaultTimeout:function(){return this._instance.defaultsAndOverrides().defaultTimeout},messageSizeMax:function(){return this._instance.messageSizeMax()}});Ice.ProtocolInstance=e})();(function(){t.defineSequence(Ice,"EndpointSeqHelper","Ice.ObjectHelper",false,"Ice.Endpoint")})();(function(){var e=Ice.AsyncResultBase;var t=Ice.Debug;var n=Ice.Promise;var i=Ice.Protocol;var r=Ice.UserException;var s=Ice.BasicStream;var o=Ice.Class(e,{__init__:function(t,n,r,o,c,a){e.call(this,t,n,r,o,c);if(t===undefined){return}this._completed=a;this._is=null;this._os=t!==null?new s(this._instance,i.currentProtocolEncoding):null;this._state=0;this._exception=null;this._sentSynchronously=false},cancel:function(){this.__cancel(new Ice.InvocationCanceledException)},isCompleted:function(){return(this._state&o.Done)>0},isSent:function(){return(this._state&o.Sent)>0},throwLocalException:function(){if(this._exception!==null){throw this._exception}},sentSynchronously:function(){return this._sentSynchronously},__markSent:function(e){t.assert((this._state&o.Done)===0);this._state|=o.Sent;if(e){this._state|=o.Done|o.OK;this._cancellationHandler=null;this.succeed(this)}},__markFinished:function(e,n){t.assert((this._state&o.Done)===0);this._state|=o.Done;if(e){this._state|=o.OK}this._cancellationHandler=null;if(n){n(this)}else{this.succeed(this)}},__markFinishedEx:function(e){t.assert((this._state&o.Done)===0);this._exception=e;this._state|=o.Done;this._cancellationHandler=null;this.fail(e,this)},__cancel:function(e){this._cancellationException=e;if(this._cancellationHandler){this._cancellationHandler.asyncRequestCanceled(this,e)}},__cancelable:function(e){if(this._cancellationException){try{throw this._cancellationException}finally{this._cancellationException=null}}this._cancellationHandler=e},__os:function(){return this._os},__is:function(){return this._is},__startReadParams:function(){this._is.startReadEncaps();return this._is},__endReadParams:function(){this._is.endReadEncaps()},__readEmptyParams:function(){this._is.skipEmptyEncaps()},__readParamEncaps:function(){return this._is.readEncaps(null)},__throwUserException:function(){t.assert((this._state&o.Done)!==0);if((this._state&o.OK)===0){try{this._is.startReadEncaps();this._is.throwException()}catch(e){if(e instanceof r){this._is.endReadEncaps()}throw e}}}});o.OK=1;o.Done=2;o.Sent=4;Ice.AsyncResult=o})();(function(){Ice.Address=function(e,t){this.host=e;this.port=t}})();(function(){var e=Ice.BasicStream;var t=Ice.Debug;var n=Ice.ExUtil;var i=Ice.Class;var r=Ice.Protocol;var s=20+8;var o=i({__init__:function(t,n){this._batchStreamInUse=false;this._batchRequestNum=0;this._batchStream=new e(t,r.currentProtocolEncoding);this._batchStream.writeBlob(r.requestBatchHdr);this._batchMarker=this._batchStream.size;this._exception=null;this._maxSize=t.batchAutoFlushSize();if(this._maxSize>0&&n){var i=t.initializationData().properties;var o=i.getPropertyAsIntWithDefault("Ice.UDP.SndSize",65535-s);if(o0&&this._batchStream.size>=this._maxSize){n.ice_flushBatchRequests()}t.assert(this._batchMarker=0){this._requests.splice(t,1)}},cancel:function(e){var t=this._requests.indexOf(e);if(t>=0){this._requests.splice(t,1);return this._instance.timer().cancel(e.token)}return false}});Ice.RetryQueue=t;var n=e({__init__:function(e,t,n,i){this._instance=e;this._queue=t;this._outAsync=n},run:function(){this._outAsync.__retry();this._queue.remove(this)},destroy:function(){try{this._outAsync.__abort(new Ice.CommunicatorDestroyedException)}catch(e){}},asyncRequestCanceled:function(e,t){if(this._queue.cancel(this)){if(this._instance.traceLevels().retry>=1){this._instance.initializationData().logger.trace(this._instance.traceLevels().retryCat,"operation retry canceled\n"+t.toString())}this._outAsync.__completedEx(t)}}})})();(function(){var e=Ice.ArrayUtil;var t=Ice.Debug;var n=Ice.HashMap;var i=Ice.Promise;var r=Ice.Class({__init__:function(e){this._router=e;t.assert(this._router!==null);this._clientEndpoints=null;this._serverEndpoints=null;this._adapter=null;this._identities=new n(n.compareEquals);this._evictedIdentities=[]},destroy:function(){this._clientEndpoints=[];this._serverEndpoints=[];this._adapter=null;this._identities.clear()},equals:function(e){if(this===e){return true}if(e instanceof r){return this._router.equals(e._router)}return false},hashCode:function(){return this._router.hashCode()},getRouter:function(){return this._router},getClientEndpoints:function(){var e=new i;if(this._clientEndpoints!==null){e.succeed(this._clientEndpoints)}else{var t=this;this._router.getClientProxy().then(function(n){t.setClientEndpoints(n,e)}).exception(function(t){e.fail(t)})}return e},getServerEndpoints:function(){if(this._serverEndpoints!==null){return(new i).succeed(this._serverEndpoints)}else{var e=this;return this._router.getServerProxy().then(function(t){return e.setServerEndpoints(t)})}},addProxy:function(e){t.assert(e!==null);if(this._identities.has(e.ice_getIdentity())){return(new i).succeed()}else{var n=this;return this._router.addProxies([e]).then(function(t){n.addAndEvictProxies(e,t)})}},setAdapter:function(e){this._adapter=e},getAdapter:function(){return this._adapter},clearCache:function(e){this._identities.delete(e.getIdentity())},setClientEndpoints:function(e,t){if(this._clientEndpoints===null){if(e===null){this._clientEndpoints=this._router.__reference().getEndpoints();t.succeed(this._clientEndpoints)}else{e=e.ice_router(null);var n=this;this._router.ice_getConnection().then(function(i){var r=e.ice_timeout(i.timeout());n._clientEndpoints=r.__reference().getEndpoints();t.succeed(n._clientEndpoints)}).exception(function(e){t.fail(e)})}}else{t.succeed(this._clientEndpoints)}},setServerEndpoints:function(e){if(e===null){throw new Ice.NoEndpointException}e=e.ice_router(null);this._serverEndpoints=e.__reference().getEndpoints();return this._serverEndpoints},addAndEvictProxies:function(t,n){var i=e.indexOf(this._evictedIdentities,t.ice_getIdentity(),function(e,t){return e.equals(t);
+});if(i>=0){this._evictedIdentities.splice(i,1)}else{this._identities.set(t.ice_getIdentity(),1)}for(var r=0;r0){var i=this;this._timeoutToken=this._instance.timer().schedule(function(){i.__cancel(new Ice.InvocationTimeoutException)},n)}}while(true){try{this._sent=false;this._handler=this._proxy.__getRequestHandler();var r=this._handler.sendAsyncRequest(this);if((r&e.Sent)>0){if(t){this._sentSynchronously=true}}return}catch(o){if(o instanceof s){this._proxy.__updateRequestHandler(this._handler,null)}else{var c=this.__handleException(o);if(c>0){this._instance.retryQueue().add(this,c);return}}}}}catch(o){this.__markFinishedEx(o)}},__markSent:function(e){this._sent=true;if(e){if(this._timeoutToken){this._instance.timer().cancel(this._timeoutToken)}}u.prototype.__markSent.call(this,e)},__markFinishedEx:function(e){if(this._timeoutToken){this._instance.timer().cancel(this._timeoutToken)}u.prototype.__markFinishedEx.call(this,e)},__handleException:function(e){var t={value:0};this._cnt=this._proxy.__handleException(e,this._handler,this._mode,this._sent,t,this._cnt);return t.value}});var h=Ice.Class(l,{__init__:function(e,t,n){if(e!==undefined){l.call(this,e,t);this._encoding=c.getCompatibleEncoding(this._proxy.__reference().getEncoding());this._completed=n}else{l.call(this)}},__prepare:function(e,t,n){c.checkSupportedProtocol(c.getCompatibleProtocol(this._proxy.__reference().getProtocol()));this._mode=t;if(n===null){n=h._emptyContext}if(this._proxy.ice_isBatchOneway()||this._proxy.ice_isBatchDatagram()){this._proxy.__getBatchRequestQueue().prepareBatchRequest(this._os)}else{this._os.writeBlob(c.requestHdr)}var i=this._proxy.__reference();i.getIdentity().__write(this._os);var s=i.getFacet();if(s===null||s.length===0){Ice.StringSeqHelper.write(this._os,null)}else{Ice.StringSeqHelper.write(this._os,[s])}this._os.writeString(this._operation);this._os.writeByte(t.value);if(n!==undefined){if(n!==null&&!(n instanceof r)){throw new Error("illegal context value, expecting null or HashMap")}Ice.ContextHelper.write(this._os,n)}else{var o=i.getInstance().getImplicitContext();var a=i.getContext();if(o===null){Ice.ContextHelper.write(this._os,a)}else{o.write(a,this._os)}}},__sent:function(){this.__markSent(!this._proxy.ice_isTwoway())},__invokeRemote:function(e,t,n){return e.sendAsyncRequest(this,t,n,0)},__abort:function(e){if(this._proxy.ice_isBatchOneway()||this._proxy.ice_isBatchDatagram()){this._proxy.__getBatchRequestQueue().abortBatchRequest(this._os)}l.prototype.__abort.call(this,e)},__invoke:function(){if(this._proxy.ice_isBatchOneway()||this._proxy.ice_isBatchDatagram()){this._sentSynchronously=true;this._proxy.__getBatchRequestQueue().finishBatchRequest(this._os,this._proxy,this._operation);this.__markFinished(true);return}this.__invokeImpl(true)},__completed:function(e){i.assert(this._proxy.ice_isTwoway());var t;try{if(this._is===null){this._is=new n(this._instance,c.currentProtocolEncoding)}this._is.swap(e);t=this._is.readByte();switch(t){case c.replyOK:case c.replyUserException:{break}case c.replyObjectNotExist:case c.replyFacetNotExist:case c.replyOperationNotExist:{var r=new a;r.__read(this._is);var s=Ice.StringSeqHelper.read(this._is);var o;if(s.length>0){if(s.length>1){throw new Ice.MarshalException}o=s[0]}else{o=""}var u=this._is.readString();var l=null;switch(t){case c.replyObjectNotExist:{l=new Ice.ObjectNotExistException;break}case c.replyFacetNotExist:{l=new Ice.FacetNotExistException;break}case c.replyOperationNotExist:{l=new Ice.OperationNotExistException;break}default:{i.assert(false);break}}l.id=r;l.facet=o;l.operation=u;throw l}case c.replyUnknownException:case c.replyUnknownLocalException:case c.replyUnknownUserException:{var h=this._is.readString();var f=null;switch(t){case c.replyUnknownException:{f=new Ice.UnknownException;break}case c.replyUnknownLocalException:{f=new Ice.UnknownLocalException;break}case c.replyUnknownUserException:{f=new Ice.UnknownUserException;break}default:{i.assert(false);break}}f.unknown=h;throw f}default:{throw new Ice.UnknownReplyStatusException}}this.__markFinished(t==c.replyOK,this._completed)}catch(d){this.__completedEx(d)}},__startWriteParams:function(e){this._os.startWriteEncaps(this._encoding,e);return this._os},__endWriteParams:function(){this._os.endWriteEncaps()},__writeEmptyParams:function(){this._os.writeEmptyEncaps(this._encoding)},__writeParamEncaps:function(e){if(e===null||e.length===0){this._os.writeEmptyEncaps(this._encoding)}else{this._os.writeEncaps(e)}},__is:function(){return this._is},__startReadParams:function(){this._is.startReadEncaps();return this._is},__endReadParams:function(){this._is.endReadEncaps()},__readEmptyParams:function(){this._is.skipEmptyEncaps()},__readParamEncaps:function(){return this._is.readEncaps(null)},__throwUserException:function(){i.assert((this._state&t.Done)!==0);if((this._state&t.OK)===0){try{this._is.startReadEncaps();this._is.throwException()}catch(e){if(e instanceof Ice.UserException){this._is.endReadEncaps()}throw e}}}});h._emptyContext=new r;var f=Ice.Class(l,{__init__:function(e,t){l.call(this,e,t);this._batchRequestNum=e.__getBatchRequestQueue().swap(this._os)},__invokeRemote:function(t,n,i){if(this._batchRequestNum===0){this.__sent();return e.Sent}return t.sendAsyncRequest(this,n,i,this._batchRequestNum)},__invoke:function(){c.checkSupportedProtocol(c.getCompatibleProtocol(this._proxy.__reference().getProtocol()));this.__invokeImpl(true)}});var d=Ice.Class(l,{__init__:function(e,t){l.call(this,e,t)},__invokeRemote:function(t,n,i){this.__markFinished(true,function(e){e.succeed(t)});return e.Sent},__invoke:function(){this.__invokeImpl(true)}});var p=Ice.Class(u,{__init__:function(e,t,n){u.call(this,t,n,e,null,null)},__invoke:function(){try{var t=this._connection.getBatchRequestQueue().swap(this._os);var n;if(t===0){this.__sent();n=e.Sent}else{n=this._connection.sendAsyncRequest(this,false,false,t)}if((n&e.Sent)>0){this._sentSynchronously=true}}catch(i){this.__completedEx(i)}}});Ice.OutgoingAsync=h;Ice.ProxyFlushBatch=f;Ice.ProxyGetConnection=d;Ice.ConnectionFlushBatch=p})();(function(){var e=Ice.ArrayUtil;var t=Ice.AsyncResultBase;var n=Ice.AsyncResult;var i=Ice.Debug;var r=Ice.FormatType;var s=Ice.HashMap;var o=Ice.OutgoingAsync;var c=Ice.ProxyFlushBatch;var a=Ice.ProxyGetConnection;var u=Ice.ReferenceMode;var l=Ice.OperationMode;var h=Ice.Class({__init__:function(){this._reference=null;this._requestHandler=null},hashCode:function(e){return this._reference.hashCode()},ice_getCommunicator:function(){return this._reference.getCommunicator()},toString:function(){return this._reference.toString()},ice_getIdentity:function(){return this._reference.getIdentity().clone()},ice_identity:function(e){if(e===undefined||e===null||e.name.length===0){throw new Ice.IllegalIdentityException}if(e.equals(this._reference.getIdentity())){return this}else{var t=new h;t.__setup(this._reference.changeIdentity(e));return t}},ice_getContext:function(){return new s(this._reference.getContext())},ice_context:function(e){return this.__newInstance(this._reference.changeContext(e))},ice_getFacet:function(){return this._reference.getFacet()},ice_facet:function(e){if(e===undefined||e===null){e=""}if(e===this._reference.getFacet()){return this}else{var t=new h;t.__setup(this._reference.changeFacet(e));return t}},ice_getAdapterId:function(){return this._reference.getAdapterId()},ice_adapterId:function(e){if(e===undefined||e===null){e=""}if(e===this._reference.getAdapterId()){return this}else{return this.__newInstance(this._reference.changeAdapterId(e))}},ice_getEndpoints:function(){return e.clone(this._reference.getEndpoints())},ice_endpoints:function(t){if(t===undefined||t===null){t=[]}if(e.equals(t,this._reference.getEndpoints())){return this}else{return this.__newInstance(this._reference.changeEndpoints(t))}},ice_getLocatorCacheTimeout:function(){return this._reference.getLocatorCacheTimeout()},ice_locatorCacheTimeout:function(e){if(e<-1){throw new Error("invalid value passed to ice_locatorCacheTimeout: "+e)}if(e===this._reference.getLocatorCacheTimeout()){return this}else{return this.__newInstance(this._reference.changeLocatorCacheTimeout(e))}},ice_getInvocationTimeout:function(){return this._reference.getInvocationTimeout()},ice_invocationTimeout:function(e){if(e<1&&e!==-1){throw new Error("invalid value passed to ice_invocationTimeout: "+e)}if(e===this._reference.getInvocationTimeout()){return this}else{return this.__newInstance(this._reference.changeInvocationTimeout(e))}},ice_isConnectionCached:function(){return this._reference.getCacheConnection()},ice_connectionCached:function(e){if(e===this._reference.getCacheConnection()){return this}else{return this.__newInstance(this._reference.changeCacheConnection(e))}},ice_getEndpointSelection:function(){return this._reference.getEndpointSelection()},ice_endpointSelection:function(e){if(e===this._reference.getEndpointSelection()){return this}else{return this.__newInstance(this._reference.changeEndpointSelection(e))}},ice_isSecure:function(){return this._reference.getSecure()},ice_secure:function(e){if(e===this._reference.getSecure()){return this}else{return this.__newInstance(this._reference.changeSecure(e))}},ice_getEncodingVersion:function(){return this._reference.getEncoding().clone()},ice_encodingVersion:function(e){if(e.equals(this._reference.getEncoding())){return this}else{return this.__newInstance(this._reference.changeEncoding(e))}},ice_isPreferSecure:function(){return this._reference.getPreferSecure()},ice_preferSecure:function(e){if(e===this._reference.getPreferSecure()){return this}else{return this.__newInstance(this._reference.changePreferSecure(e))}},ice_getRouter:function(){var e=this._reference.getRouterInfo();return e!==null?e.getRouter():null},ice_router:function(e){var t=this._reference.changeRouter(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_getLocator:function(){var e=this._reference.getLocatorInfo();return e!==null?e.getLocator():null},ice_locator:function(e){var t=this._reference.changeLocator(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_isTwoway:function(){return this._reference.getMode()===u.ModeTwoway},ice_twoway:function(){if(this._reference.getMode()===u.ModeTwoway){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeTwoway))}},ice_isOneway:function(){return this._reference.getMode()===u.ModeOneway},ice_oneway:function(){if(this._reference.getMode()===u.ModeOneway){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeOneway))}},ice_isBatchOneway:function(){return this._reference.getMode()===u.ModeBatchOneway},ice_batchOneway:function(){if(this._reference.getMode()===u.ModeBatchOneway){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeBatchOneway))}},ice_isDatagram:function(){return this._reference.getMode()===u.ModeDatagram},ice_datagram:function(){if(this._reference.getMode()===u.ModeDatagram){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeDatagram))}},ice_isBatchDatagram:function(){return this._reference.getMode()===u.ModeBatchDatagram},ice_batchDatagram:function(){if(this._reference.getMode()===u.ModeBatchDatagram){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeBatchDatagram))}},ice_compress:function(e){var t=this._reference.changeCompress(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_timeout:function(e){if(e<1&&e!==-1){throw new Error("invalid value passed to ice_timeout: "+e)}var t=this._reference.changeTimeout(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_getConnectionId:function(){return this._reference.getConnectionId()},ice_connectionId:function(e){var t=this._reference.changeConnectionId(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_getConnection:function(){var e=new a(this,"ice_getConnection");try{e.__invoke()}catch(t){e.__abort(t)}return e},ice_getCachedConnection:function(){return this._requestHandler?this._requestHandler.getConnection():null},ice_flushBatchRequests:function(){var e=new c(this,"ice_flushBatchRequests");try{e.__invoke()}catch(t){e.__abort(t)}return e},equals:function(e){if(this===e){return true}if(e instanceof h){return this._reference.equals(e._reference)}return false},__reference:function(){return this._reference},__copyFrom:function(e){i.assert(this._reference===null);i.assert(this._requestHandler===null);this._reference=e._reference;this._requestHandler=e._requestHandler},__handleException:function(e,t,n,i,r,s){this.__updateRequestHandler(t,null);if(e instanceof Ice.LocalException&&(!i||n==l.Nonmutating||n==l.Idempotent||e instanceof Ice.CloseConnectionException||e instanceof Ice.ObjectNotExistException)){try{return this._reference.getInstance().proxyFactory().checkRetryAfterException(e,this._reference,r,s)}catch(o){if(o instanceof Ice.CommunicatorDestroyedException){throw e}else{throw o}}}else{throw e}},__checkAsyncTwowayOnly:function(e){if(!this.ice_isTwoway()){throw new Error("`"+e+"' can only be called with a twoway proxy")}},__getRequestHandler:function(){if(this._reference.getCacheConnection()){if(this._requestHandler){return this._requestHandler}}return this._reference.getRequestHandler(this)},__getBatchRequestQueue:function(){if(!this._batchRequestQueue){this._batchRequestQueue=this._reference.getBatchRequestQueue()}return this._batchRequestQueue},__setRequestHandler:function(e){if(this._reference.getCacheConnection()){if(!this._requestHandler){this._requestHandler=e}return this._requestHandler}return e},__updateRequestHandler:function(e,t){if(this._reference.getCacheConnection()&&e!==null){if(this._requestHandler&&this._requestHandler!==t){this._requestHandler=this._requestHandler.update(e,t)}}},__setup:function(e){i.assert(this._reference===null);this._reference=e},__newInstance:function(e){var t=new this.constructor;t.__setup(e);return t},ice_instanceof:function(e){if(e){if(this instanceof e){return true}return this.constructor.__instanceof(e)}return false}});h.__invoke=function(e,t,n,i,r,s,c,a,u){if(c!==null||a.length>0){e.__checkAsyncTwowayOnly(t)}var l=new o(e,t,function(e){h.__completed(e,c,a)});try{l.__prepare(t,n,r);if(s===null){l.__writeEmptyParams()}else{var f=l.__startWriteParams(i);s.call(null,f,u);l.__endWriteParams()}l.__invoke()}catch(d){l.__abort(d)}return l};h.__completed=function(e,t,n){if(!h.__check(e,n)){return}try{if(t===null){e.__readEmptyParams();e.succeed(e)}else{var i=t(e);e.succeed.apply(e,i)}}catch(r){h.__dispatchLocalException(e,r);return}};h.__returns_bool=function(e,t){t.push(e.readBool())};h.__returns_byte=function(e,t){t.push(e.readByte())};h.__returns_short=function(e,t){t.push(e.readShort())};h.__returns_int=function(e,t){t.push(e.readInt())};h.__returns_long=function(e,t){t.push(e.readLong())};h.__returns_float=function(e,t){t.push(e.readFloat())};h.__returns_double=function(e,t){t.push(e.readDouble())};h.__returns_string=function(e,t){t.push(e.readString())};h.__returns_ObjectPrx=function(e,t){t.push(e.readProxy())};h.__returns_Object=function(e,t){e.readObject(function(e){t.push(e)},Ice.Object);e.readPendingObjects()};h.__check=function(e,t){try{e.__throwUserException()}catch(n){if(n instanceof Ice.UserException){if(t!==null){for(var i=0;i0){throw new Error("ice_response called with invalid arguments")}else{this.incomingAsync.__writeEmptyParams()}}else{var t=this.incomingAsync.__startWriteParams(this.op.format);var n;if(this.op.returns&&!this.op.returns.tag){n=this.op.returns}c(t,e,n,this.op.outParams,this.op.outParamsOpt,this.op.returnsClasses);this.incomingAsync.__endWriteParams(true)}},__checkException:function(e){for(var t=0;t0&&(t.sendsClasses||t.inParamsOpt.length>0)){for(var d=0;d1&&!(g instanceof Array)){throw new Ice.MarshalException("operation `"+t.servantMethod+"' should return an array of length "+I)}else if(I===1){g=[g]}u.__sendResponse(g);return Ice.DispatchStatus.DispatchOK}}catch(_){if(u.__checkException(_)){u.__sendException(_);return Ice.DispatchStatus.DispatchUserException}else{throw _}}};function l(e,t,n){var i;for(var r=0;i===undefined&&r0){a=function(e,t){var n,i,r;for(n=0;n0){u=function(e){var t=[];var n=e.__startReadParams();var i;if(s.returns&&!s.returns.tag){i=s.returns}o(n,i,s.outParams,s.outParamsOpt,s.returnsClasses,t,0);e.__endReadParams();if(s.returnsClasses||s.outParamsOpt.length>0){var r=0;if(s.returns&&s.returns.isObject&&t[s.returns.pos+r]!==undefined){t[s.returns.pos+r]=t[s.returns.pos+r].value}for(var c=0;c0){e+=" -h ";var t=this._host.indexOf(":")!=-1;if(t){e+='"'}e+=this._host;if(t){e+='"'}}e+=" -p "+this._port;if(this._sourceAddr!==null&&this._sourceAddr.length>0){e+=" --sourceAddr "+this._sourceAddr}return e},compareTo:function(e){if(this===e){return 0}if(e===null){return 1}if(!(e instanceof s)){return this.type()65535){throw new r("port value `"+t+"' out of range in endpoint "+i)}}else if(e==="--sourceAddress"){if(t===null){throw new r("no argument provided for --sourceAddress option in endpoint "+i)}this._sourceAddr=t}else{return false}return true}});Ice.IPEndpointI=s})();(function(){Object.defineProperty(IceSSL,"EndpointType",{value:Ice.SSLEndpointType});IceSSL.EndpointInfo=t.defineLocalObject(function(e,t,n,i,r){Ice.IPEndpointInfo.call(this,e,t,n,i,r)},Ice.IPEndpointInfo);IceSSL.WSSEndpointInfo=t.defineLocalObject(function(e,t,n,i,r,s){IceSSL.EndpointInfo.call(this,e,t,n,i,r);this.resource=s!==undefined?s:""},IceSSL.EndpointInfo)})();(function(){Ice.ConnectionInfo=t.defineLocalObject(function(e,t,n,i,r){this.incoming=e!==undefined?e:false;this.adapterName=t!==undefined?t:"";this.connectionId=n!==undefined?n:"";this.rcvSize=i!==undefined?i:0;this.sndSize=r!==undefined?r:0});Ice.ConnectionCallback=t.defineLocalObject();Ice.ACMClose=t.defineEnum([["CloseOff",0],["CloseOnIdle",1],["CloseOnInvocation",2],["CloseOnInvocationAndIdle",3],["CloseOnIdleForceful",4]]);Ice.ACMHeartbeat=t.defineEnum([["HeartbeatOff",0],["HeartbeatOnInvocation",1],["HeartbeatOnIdle",2],["HeartbeatAlways",3]]);Ice.ACM=t.defineStruct(function(e,t,n){this.timeout=e!==undefined?e:0;this.close=t!==undefined?t:Ice.ACMClose.CloseOff;this.heartbeat=n!==undefined?n:Ice.ACMHeartbeat.HeartbeatOff},true);Ice.Connection=t.defineLocalObject();Ice.IPConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a){Ice.ConnectionInfo.call(this,e,t,n,i,r);this.localAddress=s!==undefined?s:"";
+this.localPort=o!==undefined?o:-1;this.remoteAddress=c!==undefined?c:"";this.remotePort=a!==undefined?a:-1},Ice.ConnectionInfo);Ice.TCPConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a){Ice.IPConnectionInfo.call(this,e,t,n,i,r,s,o,c,a)},Ice.IPConnectionInfo);Ice.UDPConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a,u,l){Ice.IPConnectionInfo.call(this,e,t,n,i,r,s,o,c,a);this.mcastAddress=u!==undefined?u:"";this.mcastPort=l!==undefined?l:-1},Ice.IPConnectionInfo);t.defineDictionary(Ice,"HeaderDict","HeaderDictHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined);Ice.WSConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a,u){Ice.TCPConnectionInfo.call(this,e,t,n,i,r,s,o,c,a);this.headers=u!==undefined?u:null},Ice.TCPConnectionInfo)})();(function(){Ice.TraceLevels=function(e){var t="Network";var n="Protocol";var i="Retry";var r="Locator";var s="Slicing";var o="Ice.Trace.";var c=e.getPropertyAsInt(o+t);var a=e.getPropertyAsInt(o+n);var u=e.getPropertyAsInt(o+i);var l=e.getPropertyAsInt(o+r);var h=e.getPropertyAsInt(o+s);e.getPropertyAsInt(o+"ThreadPool");return Object.create(null,{network:{get:function(){return c}},networkCat:{get:function(){return t}},protocol:{get:function(){return a}},protocolCat:{get:function(){return n}},retry:{get:function(){return u}},retryCat:{get:function(){return i}},location:{get:function(){return l}},locationCat:{get:function(){return r}},slicing:{get:function(){return h}},slicingCat:{get:function(){return s}}})}})();(function(){var e=Ice.Base64;var t=Ice.Debug;var n=Ice.HashUtil;var i=Ice.Protocol;var r=Ice.StringUtil;var s=Ice.EndpointParseException;var o=Ice.Class;var c=o(Ice.EndpointI,{__init__:function(e){this._rawEncoding=Ice.Encoding_1_0;this._type=e===undefined?-1:e;this._rawBytes=null},streamWrite:function(e){e.startWriteEncaps(this._rawEncoding,Ice.FormatType.DefaultFormat);e.writeBlob(this._rawBytes);e.endWriteEncaps()},getInfo:function(){return new a((-1),false,this._rawEncoding,this._rawBytes,this._type)},type:function(){return this._type},protocol:function(){return"opaque"},timeout:function(){return-1},changeTimeout:function(e){return this},changeConnectionId:function(e){return this},compress:function(){return false},changeCompress:function(e){return this},datagram:function(){return false},secure:function(){return false},rawBytes:function(){return this._rawBytes},transceiver:function(e){e.value=null;return null},acceptor:function(e,t){e.value=this;return null},connect:function(){return null},hashCode:function(){if(this._hashCode===undefined){var e=5381;e=n.addNumber(e,this._type);e=n.addHashable(e,this._rawEncoding);e=n.addArray(e,this._rawBytes,n.addNumber);this._hashCode=e}return this._hashCode},options:function(){var t="";t+=" -t "+this._type;t+=" -e "+Ice.encodingVersionToString(this._rawEncoding);t+=" -v "+e.encode(this._rawBytes);return t},equals:function(e){if(!(e instanceof c)){return false}if(this===e){return true}if(this._type!==e._type){return false}if(!this._rawEncoding.equals(e._rawEncoding)){return false}if(this._rawBytes.length!==e._rawBytes.length){return false}for(var t=0;t-1){throw new s("multiple -t options in endpoint "+i)}if(n===null){throw new s("no argument provided for -t option in endpoint "+i)}var o;try{o=r.toInt(n)}catch(c){throw new s("invalid type value `"+n+"' in endpoint "+i)}if(o<0||o>65535){throw new s("type value `"+n+"' out of range in endpoint "+i)}this._type=o;return true}case"v":{if(this._rawBytes){throw new s("multiple -v options in endpoint "+i)}if(n===null||n.length===0){throw new s("no argument provided for -v option in endpoint "+i)}for(var a=0;a1){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);if(e instanceof Ice.ObjectNotExistException){this._os.writeByte(o.replyObjectNotExist)}else if(e instanceof Ice.FacetNotExistException){this._os.writeByte(o.replyFacetNotExist)}else if(e instanceof Ice.OperationNotExistException){this._os.writeByte(o.replyOperationNotExist)}else{n.assert(false)}e.id.__write(this._os);if(e.facet===null||e.facet.length===0){Ice.StringSeqHelper.write(this._os,null)}else{Ice.StringSeqHelper.write(this._os,[e.facet])}this._os.writeString(e.operation);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UnknownLocalException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownLocalException);this._os.writeString(e.unknown);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UnknownUserException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownUserException);this._os.writeString(e.unknown);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UnknownException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownException);this._os.writeString(e.unknown);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.LocalException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownLocalException);r=[e.ice_name()];if(e.stack){r.push("\n");r.push(e.stack)}this._os.writeString(r.join(""));this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UserException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownUserException);r=[e.ice_name()];if(e.stack){r.push("\n");r.push(e.stack)}this._os.writeString(r.join(""));this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else{if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownException);this._os.writeString(e.stack?e.stack:"");this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}if(!t){throw new Ice.ServantError(e)}}this._connection=null},invoke:function(e,t){this._is=t;var s=this._is.pos;this._current.id.__read(this._is);var c=Ice.StringSeqHelper.read(this._is);if(c.length>0){if(c.length>1){throw new Ice.MarshalException}this._current.facet=c[0]}else{this._current.facet=""}this._current.operation=this._is.readString();this._current.mode=Ice.OperationMode.valueOf(this._is.readByte());this._current.ctx=new r;var a=this._is.readSize();while(a-- >0){var u=this._is.readString();var l=this._is.readString();this._current.ctx.set(u,l)}if(e!==null){this._servant=e.findServant(this._current.id,this._current.facet);if(this._servant===null){this._locator=e.findServantLocator(this._current.id.category);if(this._locator===null&&this._current.id.category.length>0){this._locator=e.findServantLocator("")}if(this._locator!==null){try{this._servant=this._locator.locate(this._current,this._cookie)}catch(h){if(h instanceof Ice.UserException){var f=this._is.skipEncaps();if(this._response){this._os.writeByte(o.replyUserException);this._os.startWriteEncaps(f,i.DefaultFormat);this._os.writeUserException(h);this._os.endWriteEncaps();this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}this._connection=null;return}else{this._is.skipEncaps();this.__handleException(h,false);return}}}}}try{if(this._servant!==null){if(this._servant.__dispatch(this,this._current)===Ice.DispatchStatus.DispatchAsync){return}if(this._locator!==null&&!this.__servantLocatorFinished(false)){return}}else{this._is.skipEncaps();if(e!==null&&e.hasServant(this._current.id)){throw new Ice.FacetNotExistException(this._current.id,this._current.facet,this._current.operation)}else{throw new Ice.ObjectNotExistException(this._current.id,this._current.facet,this._current.operation)}}}catch(h){if(this._servant!==null&&this._locator!==null&&!this.__servantLocatorFinished(false)){return}this.__handleException(h,false);return}n.assert(this._connection!==null);if(this._response){this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}this._connection=null},startReadParams:function(){this._current.encoding=this._is.startReadEncaps();return this._is},endReadParams:function(){this._is.endReadEncaps()},readEmptyParams:function(){this._current.encoding=this._is.skipEmptyEncaps()},readParamEncaps:function(){this._current.encoding=new Ice.EncodingVersion;return this._is.readEncaps(this._current.encoding)},__response:function(){try{if(this._locator!==null&&!this.__servantLocatorFinished(true)){return}n.assert(this._connection!==null);if(this._response){this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}this._connection=null}catch(e){this._connection.invokeException(e,1)}},__exception:function(e){try{if(this._locator!==null&&!this.__servantLocatorFinished(true)){return}this.__handleException(e,true)}catch(t){this._connection.invokeException(t,1)}},__validateResponse:function(e){if(!this._active){return false}this._active=false;return true},ice_exception:function(e){if(!this._active){return}this._active=false;if(this._connection!==null){this.__exception(e)}else{if(this._instance.initializationData().properties.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}}}});Ice.IncomingAsync=a})();(function(){var e=Ice.AsyncResult;var t=Ice.AsyncStatus;var n=Ice.BasicStream;var i=Ice.ConnectionRequestHandler;var r=Ice.Debug;var s=Ice.ExUtil;var o=Ice.RetryException;var c=Ice.OutgoingAsync;var a=Ice.Protocol;var u=Ice.ReferenceMode;var l=Ice.LocalException;var h=Ice.Promise;var f=Ice.Class({__init__:function(e,t){this._reference=e;this._response=e.getMode()===u.ModeTwoway;this._proxy=t;this._proxies=[];this._initialized=false;this._connection=null;this._compress=false;this._exception=null;this._requests=[]},connect:function(e){if(!this.initialized()){this._proxies.push(e)}return this._requestHandler?this._requestHandler:this},update:function(e,t){return e===this?t:this},sendAsyncRequest:function(e){if(!this._initialized){e.__cancelable(this)}if(!this.initialized()){this._requests.push(e);return t.Queued}return e.__invokeRemote(this._connection,this._compress,this._response)},asyncRequestCanceled:function(e,t){if(this._exception!==null){return}if(!this.initialized()){for(var n=0;n=5?5:.2;return Math.min(e,25)},setCallbacks:function(e,t,n){this._connectedCallback=e;this._bytesAvailableCallback=t;this._bytesWrittenCallback=n},initialize:function(e,t){try{if(this._exception){throw this._exception}if(this._state===l){this._state=h;this._fd=new WebSocket(this._url,"ice.zeroc.com");this._fd.binaryType="arraybuffer";var i=this;this._fd.onopen=function(e){i.socketConnected(e)};this._fd.onmessage=function(e){i.socketBytesAvailable(e.data)};this._fd.onclose=function(e){i.socketClosed(e)};return s.Connect}else if(this._state===h){this._desc=I(this._addr);this._state=f}}catch(r){if(!this._exception){this._exception=g(this._state,r)}throw this._exception}n.assert(this._state===f);return s.None},register:function(){this._registered=true;if(this._hasBytesAvailable||this._exception){this._bytesAvailableCallback();this._hasBytesAvailable=false}},unregister:function(){this._registered=false},close:function(){if(this._fd===null){n.assert(this._exception);return}if(t&&this._fd.readyState===WebSocket.CONNECTING){this._state=d;return}n.assert(this._fd!==null);try{this._state=p;this._fd.close()}catch(e){throw g(this._state,e)}finally{this._fd=null}},write:function(e){if(this._exception){throw this._exception}else if(e.remaining===0){return true}n.assert(this._fd);var t=this;var i=function(){if(t._fd){if(t._fd.bufferedAmount+s<=t._maxSendPacketSize){t._bytesWrittenCallback(0,0)}else{u.setTimeout(i,t.writeReadyTimeout())}}};var r=e.position;while(true){var s=this._maxSendPacketSize>0&&e.remaining>this._maxSendPacketSize?this._maxSendPacketSize:e.remaining;if(e.remaining===0){break}n.assert(s>0);if(this._fd.bufferedAmount+s>this._maxSendPacketSize){u.setTimeout(i,this.writeReadyTimeout());return false}this._writeReadyTimeout=0;var o=e.b.slice(e.position,e.position+s);this._fd.send(o);e.position=e.position+s}return true},read:function(e,t){if(this._exception){throw this._exception}t.value=false;if(this._readBuffers.length===0){return false}var i=this._readBuffers[0].byteLength-this._readPosition;n.assert(i>0);var r=e.remaining;while(e.remaining>0){if(i>e.remaining){i=e.remaining}new Uint8Array(e.b).set(new Uint8Array(this._readBuffers[0],this._readPosition,i),e.position);e.position+=i;this._readPosition+=i;if(this._readPosition===this._readBuffers[0].byteLength){this._readPosition=0;this._readBuffers.shift();if(this._readBuffers.length===0){break}else{i=this._readBuffers[0].byteLength}}}t.value=this._readBuffers.byteLength>0;return e.remaining===0},type:function(){return this._secure?"wss":"ws"},getInfo:function(){n.assert(this._fd!==null);var t=this._secure?new e.WSSConnectionInfo:new Ice.WSConnectionInfo;t.localAddress="";t.localPort=-1;t.remoteAddress=this._addr.host;t.remotePort=this._addr.port;t.rcvSize=-1;t.sndSize=this._maxSendPacketSize;t.headers={};return t},checkSendSize:function(e){},setBufferSize:function(e,t){this._maxSendPacketSize=t},toString:function(){return this._desc},socketConnected:function(e){if(this._state==d){this.close();return}n.assert(this._connectedCallback!==null);this._connectedCallback()},socketBytesAvailable:function(e){n.assert(this._bytesAvailableCallback!==null);if(e.byteLength>0){this._readBuffers.push(e);if(this._registered){this._bytesAvailableCallback()}else if(!this._hasBytesAvailable){this._hasBytesAvailable=true}}},socketClosed:function(e){if(this._state==d){this.close();return}this._exception=g(this._state,e);if(this._state\nremote address = "+e.host+":"+e.port}function g(e,t){if(e\nremote address = "+n.host+":"+n.port;r._state=l;r._secure=t;r._exception=null;return r};Ice.WSTransceiver=_})();(function(){Ice.Router=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::Router"],-1,undefined,undefined,false);Ice.RouterPrx=t.defineProxy(Ice.ObjectPrx,Ice.Router.ice_staticId,undefined);t.defineOperations(Ice.Router,Ice.RouterPrx,{getClientProxy:[,2,1,,,[9],,,,,],getServerProxy:[,2,1,,,[9],,,,,],addProxies:[,2,2,,,["Ice.ObjectProxySeqHelper"],[["Ice.ObjectProxySeqHelper"]],,,,]});Ice.RouterFinder=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::RouterFinder"],-1,undefined,undefined,false);Ice.RouterFinderPrx=t.defineProxy(Ice.ObjectPrx,Ice.RouterFinder.ice_staticId,undefined);t.defineOperations(Ice.RouterFinder,Ice.RouterFinderPrx,{getRouter:[,,,,,["Ice.RouterPrx"],,,,,]})})();(function(){Ice.AdapterNotFoundException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::AdapterNotFoundException",undefined,undefined,false,false);Ice.InvalidReplicaGroupIdException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::InvalidReplicaGroupIdException",undefined,undefined,false,false);Ice.AdapterAlreadyActiveException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::AdapterAlreadyActiveException",undefined,undefined,false,false);Ice.ObjectNotFoundException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::ObjectNotFoundException",undefined,undefined,false,false);Ice.ServerNotFoundException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::ServerNotFoundException",undefined,undefined,false,false);Ice.Locator=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::Locator","::Ice::Object"],-1,undefined,undefined,false);Ice.LocatorPrx=t.defineProxy(Ice.ObjectPrx,Ice.Locator.ice_staticId,undefined);t.defineOperations(Ice.Locator,Ice.LocatorPrx,{findObjectById:[,2,1,1,,[9],[[Ice.Identity]],,[Ice.ObjectNotFoundException],,],findAdapterById:[,2,1,1,,[9],[[7]],,[Ice.AdapterNotFoundException],,],getRegistry:[,2,1,,,["Ice.LocatorRegistryPrx"],,,,,]});Ice.LocatorRegistry=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::LocatorRegistry","::Ice::Object"],-1,undefined,undefined,false);Ice.LocatorRegistryPrx=t.defineProxy(Ice.ObjectPrx,Ice.LocatorRegistry.ice_staticId,undefined);t.defineOperations(Ice.LocatorRegistry,Ice.LocatorRegistryPrx,{setAdapterDirectProxy:[,2,2,1,,,[[7],[9]],,[Ice.AdapterAlreadyActiveException,Ice.AdapterNotFoundException],,],setReplicatedAdapterDirectProxy:[,2,2,1,,,[[7],[7],[9]],,[Ice.AdapterAlreadyActiveException,Ice.AdapterNotFoundException,Ice.InvalidReplicaGroupIdException],,],setServerProcessProxy:[,2,2,1,,,[[7],["Ice.ProcessPrx"]],,[Ice.ServerNotFoundException],,]});Ice.LocatorFinder=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::LocatorFinder","::Ice::Object"],-1,undefined,undefined,false);Ice.LocatorFinderPrx=t.defineProxy(Ice.ObjectPrx,Ice.LocatorFinder.ice_staticId,undefined);t.defineOperations(Ice.LocatorFinder,Ice.LocatorFinderPrx,{getLocator:[,,,,,["Ice.LocatorPrx"],,,,,]})})();(function(){var e=Ice.Debug;var t=Ice.HashUtil;var n=Ice.StringUtil;var i=typeof Ice.TcpTransceiver!=="undefined"?Ice.TcpTransceiver:null;var r=Ice.Class;var s=r(Ice.IPEndpointI,{__init__:function(e,t,n,i,r,s,o){Ice.IPEndpointI.call(this,e,t,n,i,s);this._timeout=r===undefined?e?e.defaultTimeout():undefined:r;this._compress=o===undefined?false:o},getInfo:function(){var e=this.secure()?new IceSSL.EndpointInfo:new Ice.TCPEndpointInfo;this.fillEndpointInfo(e);return e},timeout:function(){return this._timeout},changeTimeout:function(e){if(e===this._timeout){return this}else{return new s(this._instance,this._host,this._port,this._sourceAddr,e,this._connectionId,this._compress)}},changeConnectionId:function(e){if(e===this._connectionId){return this}else{return new s(this._instance,this._host,this._port,this._sourceAddr,this._timeout,e,this._compress)}},compress:function(){return this._compress},changeCompress:function(e){if(e===this._compress){return this}else{return new s(this._instance,this._host,this._port,this._sourceAddr,this._timeout,this._connectionId,e)}},datagram:function(){return false},connectable:function(){return i!==null&&!this.secure()},connect:function(){e.assert(!this.secure());return i.createOutgoing(this._instance,this.getAddress(),this._sourceAddr)},options:function(){var e=Ice.IPEndpointI.prototype.options.call(this);if(this._timeout==-1){e+=" -t infinite"}else{e+=" -t "+this._timeout}if(this._compress){e+=" -z"}return e},compareTo:function(e){if(this===e){return 0}if(e===null){return 1}if(!(e instanceof s)){return this.type()0;this._warnUdp=t.initializationData().properties.getPropertyAsInt("Ice.Warn.Datagrams")>0;this._acmLastActivity=this._monitor!==null&&this._monitor.getACM().timeout>0?Date.now():-1;this._nextRequestId=1;this._messageSizeMax=u?u.messageSizeMax():t.messageSizeMax();this._batchRequestQueue=new i(t,o.datagram());this._sendStreams=[];this._readStream=new n(t,h.currentProtocolEncoding);this._readHeader=false;this._writeStream=new n(t,h.currentProtocolEncoding);this._readStreamPos=-1;this._writeStreamPos=-1;this._dispatchCount=0;this._state=y;this._shutdownInitiated=false;this._initialized=false;this._validated=false;this._readProtocol=new _;this._readProtocolEncoding=new I;this._asyncRequests=new c;this._exception=null;this._startPromise=null;this._closePromises=[];this._holdPromises=[];this._finishedPromises=[];if(this._adapter!==null){this._servantManager=this._adapter.getServantManager()}else{this._servantManager=null}this._callback=null},start:function(){s.assert(this._startPromise===null);
+try{if(this._state>=b){s.assert(this._exception!==null);return(new l).fail(this._exception)}this._startPromise=new l;var e=this;this._transceiver.setCallbacks(function(){e.message(f.Write)},function(){e.message(f.Read)},function(t,n){e.message(f.Write);if(e._instance.traceLevels().network>=3&&t>0){var i=[];i.push("sent ");i.push(t);if(!e._endpoint.datagram()){i.push(" of ");i.push(n)}i.push(" bytes via ");i.push(e._endpoint.protocol());i.push("\n");i.push(this.toString());e._instance.initializationData().logger.trace(e._instance.traceLevels().networkCat,i.join(""))}});this.initialize()}catch(t){if(t instanceof Ice.LocalException){this.exception(t)}return(new l).fail(t)}return this._startPromise},activate:function(){if(this._state<=w){return}if(this._acmLastActivity>0){this._acmLastActivity=Date.now()}this.setState(E)},hold:function(){if(this._state<=w){return}this.setState(x)},destroy:function(e){switch(e){case O.ObjectAdapterDeactivated:{this.setState(S,new Ice.ObjectAdapterDeactivatedException);break}case O.CommunicatorDestroyed:{this.setState(S,new Ice.CommunicatorDestroyedException);break}}},close:function(e){var n=new t(this._communicator,"close",this,null,null);if(e){this.setState(b,new Ice.ForcedCloseConnectionException);n.succeed(n)}else{this._closePromises.push(n);this.checkClose()}return n},checkClose:function(){if(this._asyncRequests.size===0&&this._closePromises.length>0){this.setState(S,new Ice.CloseConnectionException);for(var e=0;ew&&this._state=S);throw this._exception}},waitUntilHolding:function(){var e=new l;this._holdPromises.push(e);this.checkState();return e},waitUntilFinished:function(){var e=new l;this._finishedPromises.push(e);this.checkState();return e},monitor:function(e,t){if(this._state!==E){return}if(t.heartbeat==Ice.ACMHeartbeat.HeartbeatAlways||t.heartbeat!=Ice.ACMHeartbeat.HeartbeatOff&&this._writeStream.isEmpty()&&e>=this._acmLastActivity+t.timeout/4){if(t.heartbeat!=Ice.ACMHeartbeat.HeartbeatOnInvocation||this._dispatchCount>0){this.heartbeat()}}if(this._readStream.size>h.headerSize||!this._writeStream.isEmpty()){return}if(t.close!=Ice.ACMClose.CloseOff&&e>=this._acmLastActivity+t.timeout){if(t.close==Ice.ACMClose.CloseOnIdleForceful||t.close!=Ice.ACMClose.CloseOnIdle&&this._asyncRequests.size>0){this.setState(b,new Ice.ConnectionTimeoutException)}else if(t.close!=Ice.ACMClose.CloseOnInvocation&&this._dispatchCount===0&&this._batchRequestQueue.isEmpty()&&this._asyncRequests.size===0){this.setState(S,new Ice.ConnectionTimeoutException)}}},sendAsyncRequest:function(e,t,n,i){var r=0;var o=e.__os();if(this._exception!==null){throw new u(this._exception)}s.assert(this._state>w);s.assert(this._state0){o.pos=h.headerSize;o.writeInt(i)}var c;try{c=this.sendMessage(k.create(e,e.__os(),t,r))}catch(a){if(a instanceof Ice.LocalException){this.setState(b,a);s.assert(this._exception!==null);throw this._exception}else{throw a}}if(n){this._asyncRequests.set(r,e)}return c},getBatchRequestQueue:function(){return this._batchRequestQueue},flushBatchRequests:function(){var e=new r(this,this._communicator,"flushBatchRequests");e.__invoke();return e},setCallback:function(e){if(this._state>=b){if(e!==null){var t=this;d.setImmediate(function(){try{e.closed(this)}catch(n){t._logger.error("connection callback exception:\n"+n+"\n"+t._desc)}})}}else{this._callback=e}},setACM:function(e,t,n){if(this._monitor===null||this._state>=b){return}if(this._state==E){this._monitor.remove(this)}this._monitor=this._monitor.acm(e,t,n);if(this._state==E){this._monitor.add(this)}if(this._monitor.getACM().timeout<=0){this._acmLastActivity=-1}else if(this._state==E&&this._acmLastActivity==-1){this._acmLastActivity=Date.now()}},getACM:function(){return this._monitor!==null?this._monitor.getACM():new g(0,v.CloseOff,m.HeartbeatOff)},asyncRequestCanceled:function(e,t){for(var n=0;n0){this._asyncRequests.delete(i.requestId)}i.canceled();if(n!==0){this._sendStreams.splice(n,1)}e.__completedEx(t);return}}if(e instanceof Ice.OutgoingAsync){for(var r=this._asyncRequests.entries;r!==null;r=r.next){if(r.value===e){this._asyncRequests.delete(r.key);e.__completedEx(t);return}}}},sendResponse:function(e,t){s.assert(this._state>w);try{if(--this._dispatchCount===0){if(this._state===C){this.reap()}this.checkState()}if(this._state>=b){s.assert(this._exception!==null);throw this._exception}this.sendMessage(k.createForStream(e,t!==0,true));if(this._state===S&&this._dispatchCount===0){this.initiateShutdown()}}catch(n){if(n instanceof Ice.LocalException){this.setState(b,n)}else{throw n}}},sendNoResponse:function(){s.assert(this._state>w);try{if(--this._dispatchCount===0){if(this._state===C){this.reap()}this.checkState()}if(this._state>=b){s.assert(this._exception!==null);throw this._exception}if(this._state===S&&this._dispatchCount===0){this.initiateShutdown()}}catch(e){if(e instanceof Ice.LocalException){this.setState(b,e)}else{throw e}}},endpoint:function(){return this._endpoint},setAdapter:function(e){if(this._state<=w||this._state>=S){return}s.assert(this._state=b){return}this.unscheduleTimeout(e);this._hasMoreData.value=(e&f.Read)!==0;var t=null;try{if((e&f.Write)!==0&&this._writeStream.buffer.remaining>0){if(!this.write(this._writeStream.buffer)){s.assert(!this._writeStream.isEmpty());this.scheduleTimeout(f.Write,this._endpoint.timeout());return}s.assert(this._writeStream.buffer.remaining===0)}if((e&f.Read)!==0&&!this._readStream.isEmpty()){if(this._readHeader){if(!this.read(this._readStream.buffer)){return}s.assert(this._readStream.buffer.remaining===0);this._readHeader=false;var n=this._readStream.pos;if(nthis._messageSizeMax){o.throwMemoryLimitException(l,this._messageSizeMax)}if(l>this._readStream.size){this._readStream.resize(l)}this._readStream.pos=n}if(this._readStream.pos!=this._readStream.size){if(this._endpoint.datagram()){throw new Ice.DatagramLimitException}else{if(!this.read(this._readStream.buffer)){s.assert(!this._readStream.isEmpty());this.scheduleTimeout(f.Read,this._endpoint.timeout());return}s.assert(this._readStream.buffer.remaining===0)}}}if(this._state<=w){if(this._state===y&&!this.initialize()){return}if(this._state<=w&&!this.validate()){return}this._transceiver.unregister();this.setState(x);if(this._startPromise!==null){++this._dispatchCount}}else{s.assert(this._state<=S);if((e&f.Read)!==0){t=this.parseMessage()}if((e&f.Write)!==0){this.sendNextMessage()}}}catch(p){if(p instanceof Ice.DatagramLimitException){if(this._warnUdp){this._logger.warning("maximum datagram size of "+this._readStream.pos+" exceeded")}this._readStream.resize(h.headerSize);this._readStream.pos=0;this._readHeader=true;return}else if(p instanceof Ice.SocketException){this.setState(b,p);return}else if(p instanceof Ice.LocalException){if(this._endpoint.datagram()){if(this._warn){this._logger.warning("datagram connection exception:\n"+p+"\n"+this._desc)}this._readStream.resize(h.headerSize);this._readStream.pos=0;this._readHeader=true}else{this.setState(b,p)}return}else{throw p}}if(this._acmLastActivity>0){this._acmLastActivity=Date.now()}this.dispatch(t);if(this._hasMoreData.value){var _=this;d.setImmediate(function(){_.message(f.Read)})}},dispatch:function(e){var t=0;if(this._startPromise!==null){this._startPromise.succeed();this._startPromise=null;++t}if(e!==null){if(e.outAsync!==null){e.outAsync.__completed(e.stream);++t}if(e.invokeNum>0){this.invokeAll(e.stream,e.invokeNum,e.requestId,e.compress,e.servantManager,e.adapter)}if(e.heartbeatCallback){try{e.heartbeatCallback.heartbeat(this)}catch(n){this._logger.error("connection callback exception:\n"+n+"\n"+this._desc)}e.heartbeatCallback=null;++t}}if(t>0){this._dispatchCount-=t;if(this._dispatchCount===0){if(this._state===S&&!this._shutdownInitiated){try{this.initiateShutdown()}catch(n){if(n instanceof Ice.LocalException){this.setState(b,n)}else{throw n}}}else if(this._state===C){this.reap()}this.checkState()}}},finish:function(){s.assert(this._state===b);this.unscheduleTimeout(f.Read|f.Write|f.Connect);var e;var t=this._instance.traceLevels();if(!this._initialized){if(t.network>=2){e=[];e.push("failed to establish ");e.push(this._endpoint.protocol());e.push(" connection\n");e.push(this.toString());e.push("\n");e.push(this._exception.toString());this._instance.initializationData().logger.trace(t.networkCat,e.join(""))}}else{if(t.network>=1){e=[];e.push("closed ");e.push(this._endpoint.protocol());e.push(" connection\n");e.push(this.toString());if(!(this._exception instanceof Ice.CloseConnectionException||this._exception instanceof Ice.ForcedCloseConnectionException||this._exception instanceof Ice.ConnectionTimeoutException||this._exception instanceof Ice.CommunicatorDestroyedException||this._exception instanceof Ice.ObjectAdapterDeactivatedException)){e.push("\n");e.push(this._exception.toString())}this._instance.initializationData().logger.trace(t.networkCat,e.join(""))}}if(this._startPromise!==null){this._startPromise.fail(this._exception);this._startPromise=null}if(this._sendStreams.length>0){if(!this._writeStream.isEmpty()){var n=this._sendStreams[0];this._writeStream.swap(n.stream)}for(var i=0;i0){this._asyncRequests.delete(r.requestId)}r.completed(this._exception)}this._sendStreams=[]}for(var o=this._asyncRequests.entries;o!==null;o=o.next){o.value.__completedEx(this._exception)}this._asyncRequests.clear();this._readStream.clear();this._readStream.buffer.clear();this._writeStream.clear();this._writeStream.buffer.clear();if(this._callback!==null){try{this._callback.closed(this)}catch(c){this._logger.error("connection callback exception:\n"+c+"\n"+this._desc)}this._callback=null}if(this._dispatchCount===0){this.reap()}this.setState(C)},toString:function(){return this._desc},timedOut:function(e){if(this._state<=w){this.setState(b,new Ice.ConnectTimeoutException)}else if(this._state=b){throw this._exception}var e=this._transceiver.getInfo();e.adapterName=this._adapter!==null?this._adapter.getName():"";e.incoming=this._incoming;return e},setBufferSize:function(e,t){if(this._state>=b){throw this._exception}this._transceiver.setBufferSize(e,t)},exception:function(e){this.setState(b,e)},invokeException:function(e,t){this.setState(b,e);if(t>0){s.assert(this._dispatchCount>0);this._dispatchCount-=t;s.assert(this._dispatchCount>=0);if(this._dispatchCount===0){if(this._state===C){this.reap()}this.checkState()}}},setState:function(e,t){if(t!==undefined){s.assert(t instanceof Ice.LocalException);s.assert(e>=S);if(this._state===e){return}if(this._exception===null){this._exception=t;if(this._warn&&this._validated){if(!(this._exception instanceof Ice.CloseConnectionException||this._exception instanceof Ice.ForcedCloseConnectionException||this._exception instanceof Ice.ConnectionTimeoutException||this._exception instanceof Ice.CommunicatorDestroyedException||this._exception instanceof Ice.ObjectAdapterDeactivatedException||this._exception instanceof Ice.ConnectionLostException&&this._state===S)){this.warning("connection exception",this._exception)}}}}if(this._endpoint.datagram()&&e===S){e=b}if(this._state<=w&&e===S){e=b}if(this._state===e){return}try{switch(e){case y:{s.assert(false);break}case w:{if(this._state!==y){s.assert(this._state===b);return}if(!this._endpoint.datagram()&&!this._incoming){this._transceiver.register()}break}case E:{if(this._state!==x&&this._state!==w){return}this._transceiver.register();break}case x:{if(this._state!==E&&this._state!==w){return}if(this._state===E){this._transceiver.unregister()}break}case S:{if(this._state>=b){return}if(this._state===x){this._transceiver.register()}break}case b:{if(this._state===C){return}this._batchRequestQueue.destroy(this._exception);this._transceiver.unregister();break}case C:{s.assert(this._state===b);this._transceiver.close();this._communicator=null;break}}}catch(t){if(t instanceof Ice.LocalException){var n="unexpected connection exception:\n "+this._desc+"\n"+t.toString();this._instance.initializationData().logger.error(n)}else{throw t}}if(this._monitor!==null){if(e===E){this._monitor.add(this);if(this._acmLastActivity>0){this._acmLastActivity=Date.now()}}else if(this._state===E){this._monitor.remove(this)}}this._state=e;if(this._state===S&&this._dispatchCount===0){try{this.initiateShutdown()}catch(t){if(t instanceof Ice.LocalException){this.setState(b,t)}else{throw t}}}else if(this._state===b){this.finish()}this.checkState()},initiateShutdown:function(){s.assert(this._state===S);s.assert(this._dispatchCount===0);s.assert(!this._shutdownInitiated);if(!this._endpoint.datagram()){var t=new n(this._instance,h.currentProtocolEncoding);t.writeBlob(h.magic);h.currentProtocol.__write(t);h.currentProtocolEncoding.__write(t);t.writeByte(h.closeConnectionMsg);t.writeByte(0);t.writeInt(h.headerSize);var i=this.sendMessage(k.createForStream(t,false,false));if((i&e.Sent)>0){this.scheduleTimeout(f.Write,this.closeTimeout())}}},heartbeat:function(){s.assert(this._state===E);if(!this._endpoint.datagram()){var e=new n(this._instance,h.currentProtocolEncoding);e.writeBlob(h.magic);h.currentProtocol.__write(e);h.currentProtocolEncoding.__write(e);e.writeByte(h.validateConnectionMsg);e.writeByte(0);e.writeInt(h.headerSize);try{this.sendMessage(k.createForStream(e,false,false))}catch(t){this.setState(b,t);s.assert(this._exception!==null)}}},initialize:function(){var e=this._transceiver.initialize(this._readStream.buffer,this._writeStream.buffer);if(e!=f.None){this.scheduleTimeout(e,this.connectTimeout());return false}this._desc=this._transceiver.toString();this._initialized=true;this.setState(w);return true},validate:function(){if(!this._endpoint.datagram()){if(this._adapter!==null){if(this._writeStream.size===0){this._writeStream.writeBlob(h.magic);h.currentProtocol.__write(this._writeStream);h.currentProtocolEncoding.__write(this._writeStream);this._writeStream.writeByte(h.validateConnectionMsg);this._writeStream.writeByte(0);this._writeStream.writeInt(h.headerSize);p.traceSend(this._writeStream,this._logger,this._traceLevels);this._writeStream.prepareWrite()}if(this._writeStream.pos!=this._writeStream.size&&!this.write(this._writeStream.buffer)){this.scheduleTimeout(f.Write,this.connectTimeout());return false}}else{if(this._readStream.size===0){this._readStream.resize(h.headerSize);this._readStream.pos=0}if(this._readStream.pos!==this._readStream.size&&!this.read(this._readStream.buffer)){this.scheduleTimeout(f.Read,this.connectTimeout());return false}s.assert(this._readStream.pos===h.headerSize);this._readStream.pos=0;var e=this._readStream.readBlob(4);if(e[0]!==h.magic[0]||e[1]!==h.magic[1]||e[2]!==h.magic[2]||e[3]!==h.magic[3]){var t=new Ice.BadMagicException;t.badMagic=e;throw t}this._readProtocol.__read(this._readStream);h.checkSupportedProtocol(this._readProtocol);this._readProtocolEncoding.__read(this._readStream);h.checkSupportedProtocolEncoding(this._readProtocolEncoding);var n=this._readStream.readByte();if(n!==h.validateConnectionMsg){throw new Ice.ConnectionNotValidatedException}this._readStream.readByte();var i=this._readStream.readInt();if(i!==h.headerSize){throw new Ice.IllegalMessageSizeException}p.traceRecv(this._readStream,this._logger,this._traceLevels);this._validated=true}}this._writeStream.resize(0);this._writeStream.pos=0;this._readStream.resize(h.headerSize);this._readHeader=true;this._readStream.pos=0;var r=this._instance.traceLevels();if(r.network>=1){var o=[];if(this._endpoint.datagram()){o.push("starting to send ");o.push(this._endpoint.protocol());o.push(" messages\n");o.push(this._transceiver.toDetailedString())}else{o=[];o.push("established ");o.push(this._endpoint.protocol());o.push(" connection\n");o.push(this.toString())}this._instance.initializationData().logger.trace(r.networkCat,o.join(""))}return true},sendNextMessage:function(){if(this._sendStreams.length===0){return}s.assert(!this._writeStream.isEmpty()&&this._writeStream.pos===this._writeStream.size);try{while(true){var e=this._sendStreams.shift();this._writeStream.swap(e.stream);e.sent();if(this._sendStreams.length===0){break}if(this._state>=b){return}e=this._sendStreams[0];s.assert(!e.prepared);var t=e.stream;t.pos=10;t.writeInt(t.size);t.prepareWrite();e.prepared=true;if(e.outAsync!==null){p.trace("sending asynchronous request",t,this._logger,this._traceLevels)}else{p.traceSend(t,this._logger,this._traceLevels)}this._writeStream.swap(e.stream);if(this._writeStream.pos!=this._writeStream.size&&!this.write(this._writeStream.buffer)){s.assert(!this._writeStream.isEmpty());this.scheduleTimeout(f.Write,this._endpoint.timeout());return}}}catch(n){if(n instanceof Ice.LocalException){this.setState(b,n);return}else{throw n}}s.assert(this._writeStream.isEmpty());if(this._state===S){this.scheduleTimeout(f.Write,this.closeTimeout())}},sendMessage:function(t){if(this._sendStreams.length>0){t.doAdopt();this._sendStreams.push(t);return e.Queued}s.assert(this._state0){this._acmLastActivity=Date.now()}return e.Sent}t.doAdopt();this._writeStream.swap(t.stream);this._sendStreams.push(t);this.scheduleTimeout(f.Write,this._endpoint.timeout());return e.Queued},parseMessage:function(){s.assert(this._state>w&&this._state0){var c=!this._endpoint.datagram()&&n!==0;o=new a(this._instance,this,s,c,i,n);o.invoke(r,e);--t;o=null}e.clear()}catch(u){if(u instanceof Ice.LocalException){this.invokeException(u,t)}else if(u instanceof Ice.ServantError){}else{this._logger.error("unexpected exception:\n"+u.toString());this.invokeException(new Ice.UnknownException(u),t)}}},scheduleTimeout:function(e,t){if(t<0){return}var n=this;if((e&f.Read)!==0){this._readTimeoutId=this._timer.schedule(function(){n.timedOut()},t);this._readTimeoutScheduled=true}if((e&(f.Write|f.Connect))!==0){this._writeTimeoutId=this._timer.schedule(function(){n.timedOut()},t);this._writeTimeoutScheduled=true}},unscheduleTimeout:function(e){if((e&f.Read)!==0&&this._readTimeoutScheduled){this._timer.cancel(this._readTimeoutId);this._readTimeoutScheduled=false}if((e&(f.Write|f.Connect))!==0&&this._writeTimeoutScheduled){this._timer.cancel(this._writeTimeoutId);this._writeTimeoutScheduled=false}},connectTimeout:function(){var e=this._instance.defaultsAndOverrides();if(e.overrideConnectTimeout){return e.overrideConnectTimeoutValue}else{return this._endpoint.timeout()}},closeTimeout:function(){var e=this._instance.defaultsAndOverrides();if(e.overrideCloseTimeout){return e.overrideCloseTimeoutValue}else{return this._endpoint.timeout()}},warning:function(e,t){this._logger.warning(e+":\n"+this._desc+"\n"+t.toString())},checkState:function(){if(this._state0){return}var e;if(this._holdPromises.length>0){for(e=0;e0){this._adapter=null;for(e=0;e=3&&e.position!=t){var i=[];i.push("received ");if(this._endpoint.datagram()){i.push(e.limit)}else{i.push(e.position-t);i.push(" of ");i.push(e.limit-t)}i.push(" bytes via ");i.push(this._endpoint.protocol());i.push("\n");i.push(this.toString());this._instance.initializationData().logger.trace(this._instance.traceLevels().networkCat,i.join(""))}return n},write:function(e){var t=e.position;var n=this._transceiver.write(e);if(this._instance.traceLevels().network>=3&&e.position!=t){var i=[];i.push("sent ");i.push(e.position-t);if(!this._endpoint.datagram()){i.push(" of ");i.push(e.limit-t)}i.push(" bytes via ");i.push(this._endpoint.protocol());i.push("\n");i.push(this.toString());this._instance.initializationData().logger.trace(this._instance.traceLevels().networkCat,i.join(""))}return n}});O.ObjectAdapterDeactivated=0;O.CommunicatorDestroyed=1;Ice.ConnectionI=O;var k=M({__init__:function(){this.stream=null;this.outAsync=null;this.compress=false;this.requestId=0;this.prepared=false},canceled:function(){s.assert(this.outAsync!==null);this.outAsync=null},doAdopt:function(){if(this.adopt){var e=new n(this.stream.instance,h.currentProtocolEncoding);e.swap(this.stream);this.stream=e;this.adopt=false}},sent:function(){if(this.outAsync!==null){this.outAsync.__sent()}},completed:function(e){if(this.outAsync!==null){this.outAsync.__completedEx(e)}}});k.createForStream=function(e,t,n){var i=new k;i.stream=e;i.compress=t;i.adopt=n;i.isSent=false;i.requestId=0;i.outAsync=null;return i};k.create=function(e,t,n,i){var r=new k;r.stream=t;r.compress=n;r.outAsync=e;r.requestId=i;r.isSent=false;r.adopt=false;return r}})();(function(){var e=Ice.__M.module("IceSSL");var t=Ice.HashUtil;var n=Ice.StringUtil;var i=Ice.EndpointI;var r=Ice.Class;var s=r(i,{__init__:function(e,t,n){this._instance=e;this._delegate=t;this._resource=n||"/"},getInfo:function(){var t=this._delegate.secure()?new e.WSSEndpointInfo:new Ice.WSEndpointInfo;t.resource=this._resource;this._delegate.fillEndpointInfo(t);return t},type:function(){return this._delegate.type()},protocol:function(){return this._delegate.protocol()},streamWrite:function(e){e.startWriteEncaps();this._delegate.streamWriteImpl(e);e.writeString(this._resource);e.endWriteEncaps()},timeout:function(){return this._delegate.timeout()},changeTimeout:function(e){if(e===this._delegate.timeout()){return this}else{return new s(this._instance,this._delegate.changeTimeout(e),this._resource)}},changeConnectionId:function(e){if(e===this._delegate.connectionId()){return this}else{return new s(this._instance,this._delegate.changeConnectionId(e),this._resource)}},compress:function(){return this._delegate.compress()},changeCompress:function(e){if(e===this._delegate.compress()){return this}else{return new s(this._instance,this._delegate.changeCompress(e),this._resource)}},datagram:function(){return this._delegate.datagram()},secure:function(){return this._delegate.secure()},connect:function(){return Ice.WSTransceiver.createOutgoing(this._instance,this._delegate.secure(),this._delegate.getAddress(),this._resource)},hashCode:function(){if(this._hashCode===undefined){this._hashCode=this._delegate.hashCode();this._hashCode=t.addString(this._hashCode,this._resource)}return this._hashCode},compareTo:function(e){if(this===e){return 0}if(e===null){return 1}if(!(e instanceof s)){return this.type()0){e+=" -r ";e+=this._resource.indexOf(":")!==-1?'"'+this._resource+'"':this._resource}return e},toConnectorString:function(){return this._delegate.toConnectorString()},initWithStream:function(e){this._resource=e.readString()},checkOption:function(e,t,n){if(e==="-r"){if(t===null){throw new Ice.EndpointParseException("no argument provided for -r option in endpoint "+n)}this._resource=t}else{return false}return true}});if(typeof Ice.WSTransceiver!=="undefined"){s.prototype.connectable=function(){return true}}else{s.prototype.connectable=function(){return false}}Ice.WSEndpoint=s})();(function(){var e=Ice.HashMap;var t=Ice.RouterInfo;var n=Ice.RouterPrx;var i=Ice.Class({__init__:function(){this._table=new e(e.compareEquals)},destroy:function(){for(var e=this._table.entries;e!==null;e=e.next){e.value.destroy()}this._table.clear()},find:function(e){if(e===null){return null}var i=n.uncheckedCast(e.ice_router(null));var r=this._table.get(i);if(r===undefined){r=new t(i);this._table.set(i,r)}return r},erase:function(e){var t=null;if(e!==null){var i=n.uncheckedCast(e.ice_router(null));t=this._table.get(i);this._table.delete(i)}return t}});Ice.RouterManager=i})();(function(){var e=Ice.Class;var t=Ice.Debug;var n=e({__init__:function(e,t,n,i){if(e===undefined){this.timeout=60*1e3;this.heartbeat=Ice.ACMHeartbeat.HeartbeatOnInvocation;this.close=Ice.ACMClose.CloseOnInvocationAndIdle;return}var r;if((n=="Ice.ACM.Client"||n=="Ice.ACM.Server")&&e.getProperty(n+".Timeout").length===0){r=n}else{r=n+".Timeout"}this.timeout=e.getPropertyAsIntWithDefault(r,i.timeout/1e3)*1e3;var s=e.getPropertyAsIntWithDefault(n+".Heartbeat",i.heartbeat.value);if(s>=0&&s<=Ice.ACMHeartbeat.maxValue){this.heartbeat=Ice.ACMHeartbeat.valueOf(s)}else{t.warning("invalid value for property `"+n+".Heartbeat"+"', default value will be used instead");this.heartbeat=i.heartbeat}var o=e.getPropertyAsIntWithDefault(n+".Close",i.close.value);if(o>=0&&o<=Ice.ACMClose.maxValue){this.close=Ice.ACMClose.valueOf(o)}else{t.warning("invalid value for property `"+n+".Close"+"', default value will be used instead");this.close=i.close}}});var i=e({add:function(e){t.assert(false)},remove:function(e){t.assert(false)},reap:function(e){t.assert(false)},acm:function(e){t.assert(false);return null},getACM:function(){t.assert(false);return 0}});var r=e(i,{__init__:function(e,t){this._instance=e;this._config=t;this._reapedConnections=[];this._connections=[]},destroy:function(){if(this._instance===null){return}this._instance=null},add:function(e){if(this._config.timeout===0){return}this._connections.push(e);if(this._connections.length==1){var t=this;this._timerToken=this._instance.timer().scheduleRepeated(function(){t.runTimerTask()},this._config.timeout/2)}},remove:function(e){if(this._config.timeout===0){return}var n=this._connections.indexOf(e);t.assert(n>=0);this._connections.splice(n,1);if(this._connections.length===0){this._instance.timer().cancel(this._timerToken);return}},reap:function(e){this._reapedConnections.push(e)},acm:function(e,i,r){t.assert(this._instance!==null);var o=new n;o.timeout=this._config.timeout;o.close=this._config.close;o.heartbeat=this._config.heartbeat;if(e!==undefined){o.timeout=e*1e3}if(i!==undefined){o.close=i}if(r!==undefined){o.heartbeat=r}return new s(this,this._instance.timer(),o)},getACM:function(){return new Ice.ACM(this._config.timeout/1e3,this._config.close,this._config.heartbeat)},swapReapedConnections:function(){if(this._reapedConnections.length===0){return null}var e=this._reapedConnections;this._reapedConnections=[];return e},runTimerTask:function(){if(this._instance===null){this._connections=null;return}var e=Date.now();for(var t=0;t0){var n=this;this._timerToken=this._timer.scheduleRepeated(function(){n.runTimerTask()},this._config.timeout/2)}},remove:function(e){t.assert(this._connection===e);this._connection=null;if(this._config.timeout>0){this._timer.cancel(this._timerToken)}},reap:function(e){this._parent.reap(e)},acm:function(e,t,n){return this._parent.acm(e,t,n)},getACM:function(){return new Ice.ACM(this._config.timeout/1e3,this._config.close,this._config.heartbeat);
+},runTimerTask:function(){try{this._connection.monitor(Date.now(),this._config)}catch(e){this._parent.handleException(e)}}});Ice.FactoryACMMonitor=r;Ice.ACMConfig=n})();(function(){var e=Ice.Context;var t=Ice.InitializationException;var n=Ice.Class({__init__:function(){this._context=new e},getContext:function(){return new e(this._context)},setContext:function(t){if(t!==null&&t.size>0){this._context=new e(t)}else{this._context.clear()}},containsKey:function(e){if(e===null){e=""}return this._context.has(e)},get:function(e){if(e===null){e=""}var t=this._context.get(e);if(t===null){t=""}return t},put:function(e,t){if(e===null){e=""}if(t===null){t=""}var n=this._context.get(e);if(n===null){n=""}this._context.set(e,t);return n},remove:function(e){if(e===null){e=""}var t=this._context.get(e);this._context.delete(e);if(t===null){t=""}return t},write:function(t,n){if(t.size===0){Ice.ContextHelper.write(n,this._context)}else{var i=null;if(this._context.size===0){i=t}else{i=new e(this._context);i.merge(t)}Ice.ContextHelper.write(n,i)}}});n.create=function(e){if(e.length===0||e==="None"){return null}else if(e==="Shared"){return new n}else{throw new t("'"+e+"' is not a valid value for Ice.ImplicitContext")}};Ice.ImplicitContextI=n})();(function(){var e=Ice.ArrayUtil;var t=Ice.Debug;var n=Ice.BatchRequestQueue;var i=Ice.HashMap;var r=Ice.HashUtil;var s=Ice.OpaqueEndpointI;var o=Ice.Promise;var c=Ice.Protocol;var a=Ice.ReferenceMode;var u=Ice.StringUtil;var l=Ice.StringSeqHelper;var h=Ice.EndpointSelectionType;var f=Ice.Identity;var d=Ice.RouterPrx;var p=Ice.LocatorPrx;var _=Ice.PropertyNames;var I=Ice.ConnectionRequestHandler;var g=Ice.Class;var v=["EndpointSelection","ConnectionCached","PreferSecure","EncodingVersion","LocatorCacheTimeout","InvocationTimeout","Locator","Router","CollocationOptimized"];var m=g({__init__:function(e,t){this._instance=e;this._communicator=t;this._defaultRouter=null;this._defaultLocator=null},create:function(e,t,n,i){if(e.name.length===0&&e.category.length===0){return null}return this.createImpl(e,t,n.getMode(),n.getSecure(),n.getProtocol(),n.getEncoding(),i,null,null)},createWithAdapterId:function(e,t,n,i){if(e.name.length===0&&e.category.length===0){return null}return this.createImpl(e,t,n.getMode(),n.getSecure(),n.getProtocol(),n.getEncoding(),null,i,null)},createFixed:function(e,t){if(e.name.length===0&&e.category.length===0){return null}var n=new w(this._instance,this._communicator,e,"",t.endpoint().datagram()?a.ModeDatagram:a.ModeTwoway,t.endpoint().secure(),this._instance.defaultsAndOverrides().defaultEncoding,t);return n},copy:function(e){var t=e.getIdentity();if(t.name.length===0&&t.category.length===0){return null}return e.clone()},createFromString:function(e,n){if(e===undefined||e===null||e.length===0){return null}var i=" \t\n\r";var r;var s=0;r=u.findFirstNotOf(e,i,s);if(r==-1){throw new Ice.ProxyParseException("no non-whitespace characters found in `"+e+"'")}var o=null;s=u.checkQuote(e,r);if(s===-1){throw new Ice.ProxyParseException("mismatched quotes around identity in `"+e+"'")}else if(s===0){s=u.findFirstOf(e,i+":@",r);if(s===-1){s=e.length}o=e.substring(r,s)}else{r++;o=e.substring(r,s);s++}if(r===s){throw new Ice.ProxyParseException("no identity in `"+e+"'")}var c=this._instance.stringToIdentity(o);if(c.name.length===0){if(c.category.length>0){throw new Ice.IllegalIdentityException(c)}else if(u.findFirstNotOf(e,i,s)!=-1){throw new Ice.ProxyParseException("invalid characters after identity in `"+e+"'")}else{return null}}var l="";var h=a.ModeTwoway;var f=false;var d=this._instance.defaultsAndOverrides().defaultEncoding;var p=Ice.Protocol_1_0;var _="";while(true){r=u.findFirstNotOf(e,i,s);if(r===-1){break}if(e.charAt(r)==":"||e.charAt(r)=="@"){break}s=u.findFirstOf(e,i+":@",r);if(s==-1){s=e.length}if(r==s){break}var I=e.substring(r,s);if(I.length!=2||I.charAt(0)!="-"){throw new Ice.ProxyParseException("expected a proxy option but found `"+I+"' in `"+e+"'")}var g=null;var v=u.findFirstNotOf(e,i,s);if(v!=-1){var m=e.charAt(v);if(m!="@"&&m!=":"&&m!="-"){r=v;s=u.checkQuote(e,r);if(s==-1){throw new Ice.ProxyParseException("mismatched quotes around value for "+I+" option in `"+e+"'")}else if(s===0){s=u.findFirstOf(e,i+":@",r);if(s===-1){s=e.length}g=e.substring(r,s)}else{r++;g=e.substring(r,s);s++}}}switch(I.charAt(1)){case"f":{if(g===null){throw new Ice.ProxyParseException("no argument provided for -f option in `"+e+"'")}try{l=u.unescapeString(g,0,g.length)}catch(y){throw new Ice.ProxyParseException("invalid facet in `"+e+"': "+y.message)}break}case"t":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -t option in `"+e+"'")}h=a.ModeTwoway;break}case"o":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -o option in `"+e+"'")}h=a.ModeOneway;break}case"O":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -O option in `"+e+"'")}h=a.ModeBatchOneway;break}case"d":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -d option in `"+e+"'")}h=a.ModeDatagram;break}case"D":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -D option in `"+e+"'")}h=a.ModeBatchDatagram;break}case"s":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -s option in `"+e+"'")}f=true;break}case"e":{if(g===null){throw new Ice.ProxyParseException("no argument provided for -e option in `"+e+"'")}try{d=Ice.stringToEncodingVersion(g)}catch(w){throw new Ice.ProxyParseException("invalid encoding version `"+g+"' in `"+e+"':\n"+w.str)}break}case"p":{if(g===null){throw new Ice.ProxyParseException("no argument provided for -p option in `"+e+"'")}try{p=Ice.stringToProtocolVersion(g)}catch(w){throw new Ice.ProxyParseException("invalid protocol version `"+g+"' in `"+e+"':\n"+w.str)}break}default:{throw new Ice.ProxyParseException("unknown option `"+I+"' in `"+e+"'")}}}if(r===-1){return this.createImpl(c,l,h,f,p,d,null,null,n)}var E=[];if(e.charAt(r)==":"){var x=[];s=r;while(s0);throw new Ice.EndpointParseException("invalid endpoint `"+x[0]+"' in `"+e+"'")}else if(x.length!==0&&this._instance.initializationData().properties.getPropertyAsIntWithDefault("Ice.Warn.Endpoints",1)>0){var M=[];M.push("Proxy contains unknown endpoints:");for(var O=0;O0){if(n.length>1){throw new Ice.ProxyUnmarshalException}i=n[0]}else{i=""}var r=t.readByte();if(r<0||r>a.ModeLast){throw new Ice.ProxyUnmarshalException}var s=t.readBool();var o=null;var c=null;if(!t.getReadEncoding().equals(Ice.Encoding_1_0)){o=new Ice.ProtocolVersion;o.__read(t);c=new Ice.EncodingVersion;c.__read(t)}else{o=Ice.Protocol_1_0;c=Ice.Encoding_1_0}var u=null;var h=null;var f=t.readSize();if(f>0){u=[];for(var d=0;d0){var c=[];c.push("found unknown properties for proxy '");c.push(e);c.push("':");for(n=0,i=t.length;n0){var y=this._instance.initializationData().properties;if(y.getPropertyAsIntWithDefault("Ice.Warn.UnknownProperties",1)>0){this.checkForUnknownProperties(a)}var w;w=a+".Locator";var x=p.uncheckedCast(this._communicator.propertyToProxy(w));if(x!==null){if(!x.__reference().getEncoding().equals(s)){l=this._instance.locatorManager().find(x.ice_encodingVersion(s))}else{l=this._instance.locatorManager().find(x)}}w=a+".Router";var S=d.uncheckedCast(this._communicator.propertyToProxy(w));if(S!==null){var b=".Router";if(a.lastIndexOf(b)==a.length-b.length){var C="`"+w+"="+y.getProperty(w)+"': cannot set a router on a router; setting ignored";this._instance.initializationData().logger.warning(C)}else{f=this._instance.routerManager().find(S)}}w=a+".ConnectionCached";_=y.getPropertyAsIntWithDefault(w,_?1:0)>0;w=a+".PreferSecure";I=y.getPropertyAsIntWithDefault(w,I?1:0)>0;w=a+".EndpointSelection";if(y.getProperty(w).length>0){var P=y.getProperty(w);if(P=="Random"){g=h.Random}else if(P=="Ordered"){g=h.Ordered}else{throw new Ice.EndpointSelectionTypeParseException("illegal value `"+P+"'; expected `Random' or `Ordered'")}}w=a+".LocatorCacheTimeout";var M=y.getProperty(w);if(M.length!==0){v=y.getPropertyAsIntWithDefault(w,v);if(v<-1){v=-1;this._instance.initializationData().logger.warning("invalid value for"+w+"`"+y.getProperty(w)+"': defaulting to -1")}}w=a+".InvocationTimeout";M=y.getProperty(w);if(M.length!==0){m=y.getPropertyAsIntWithDefault(w,m);if(m<1&&m!==-1){m=-1;this._instance.initializationData().logger.warning("invalid value for"+w+"`"+y.getProperty(w)+"': defaulting to -1")}}}return new E(this._instance,this._communicator,e,t,n,i,r,s,o,c,l,f,_,I,g,v,m)}});Ice.ReferenceFactory=m;var y=g({__init__:function(e,n,i,r,s,o,c,a,u){t.assert(i===undefined||i.name!==null);t.assert(i===undefined||i.category!==null);t.assert(r===undefined||r!==null);this._instance=e;this._communicator=n;this._mode=s;this._secure=o;this._identity=i;this._context=y._emptyContext;this._facet=r;this._protocol=c;this._encoding=a;this._invocationTimeout=u;this._hashInitialized=false;this._overrideCompress=false;this._compress=false},getMode:function(){return this._mode},getSecure:function(){return this._secure},getProtocol:function(){return this._protocol},getEncoding:function(){return this._encoding},getIdentity:function(){return this._identity},getFacet:function(){return this._facet},getInstance:function(){return this._instance},getContext:function(){return this._context},getInvocationTimeout:function(){return this._invocationTimeout},getCommunicator:function(){return this._communicator},getEndpoints:function(){t.assert(false);return null},getAdapterId:function(){t.assert(false);return""},getRouterInfo:function(){t.assert(false);return null},getLocatorInfo:function(){t.assert(false);return null},getCacheConnection:function(){t.assert(false);return false},getPreferSecure:function(){t.assert(false);return false},getEndpointSelection:function(){t.assert(false);return null},getLocatorCacheTimeout:function(){t.assert(false);return 0},getConnectionId:function(){t.assert(false);return""},changeContext:function(e){if(e===undefined||e===null){e=y._emptyContext}var t=this._instance.referenceFactory().copy(this);if(e.size===0){t._context=y._emptyContext}else{t._context=new i(e)}return t},changeMode:function(e){if(e===this._mode){return this}var t=this._instance.referenceFactory().copy(this);t._mode=e;return t},changeSecure:function(e){if(e===this._secure){return this}var t=this._instance.referenceFactory().copy(this);t._secure=e;return t},changeIdentity:function(e){if(e.equals(this._identity)){return this}var t=this._instance.referenceFactory().copy(this);t._identity=new f(e.name,e.category);return t},changeFacet:function(e){if(e===this._facet){return this}var t=this._instance.referenceFactory().copy(this);t._facet=e;return t},changeInvocationTimeout:function(e){if(e===this._invocationTimeout){return this}var t=this._instance.referenceFactory().copy(this);t._invocationTimeout=e;return t},changeEncoding:function(e){if(e.equals(this._encoding)){return this}var t=this._instance.referenceFactory().copy(this);t._encoding=e;return t},changeCompress:function(e){if(this._overrideCompress&&this._compress===e){return this}var t=this._instance.referenceFactory().copy(this);t._compress=e;t._overrideCompress=true;return t},changeAdapterId:function(e){t.assert(false);return null},changeEndpoints:function(e){t.assert(false);return null},changeLocator:function(e){t.assert(false);return null},changeRouter:function(e){t.assert(false);return null},changeCacheConnection:function(e){t.assert(false);return null},changePreferSecure:function(e){t.assert(false);return null},changeEndpointSelection:function(e){t.assert(false);return null},changeLocatorCacheTimeout:function(e){t.assert(false);return null},changeTimeout:function(e){t.assert(false);return null},changeConnectionId:function(e){t.assert(false);return null},hashCode:function(){if(this._hashInitialized){return this._hashValue}var e=5381;e=r.addNumber(e,this._mode);e=r.addBoolean(e,this._secure);e=r.addHashable(e,this._identity);if(this._context!==null&&this._context!==undefined){for(var t=this._context.entries;t!==null;t=t.next){e=r.addString(e,t.key);e=r.addString(e,t.value)}}e=r.addString(e,this._facet);e=r.addBoolean(e,this._overrideCompress);if(this._overrideCompress){e=r.addBoolean(e,this._compress)}e=r.addHashable(e,this._protocol);e=r.addHashable(e,this._encoding);e=r.addNumber(e,this._invocationTimeout);this._hashValue=e;this._hashInitialized=true;return this._hashValue},isIndirect:function(){t.assert(false);return false},isWellKnown:function(){t.assert(false);return false},streamWrite:function(e){if(this._facet.length===0){e.writeSize(0)}else{e.writeSize(1);e.writeString(this._facet)}e.writeByte(this._mode);e.writeBool(this._secure);if(!e.getWriteEncoding().equals(Ice.Encoding_1_0)){this._protocol.__write(e);this._encoding.__write(e)}},toString:function(){var e=[];var t=this._instance.identityToString(this._identity);if(t.search(/[ :@]/)!=-1){e.push('"');e.push(t);e.push('"')}else{e.push(t)}if(this._facet.length>0){e.push(" -f ");var n=u.escapeString(this._facet,"");if(n.search(/[ :@]/)!=-1){e.push('"');e.push(n);e.push('"')}else{e.push(n)}}switch(this._mode){case a.ModeTwoway:{e.push(" -t");break}case a.ModeOneway:{e.push(" -o");break}case a.ModeBatchOneway:{e.push(" -O");break}case a.ModeDatagram:{e.push(" -d");break}case a.ModeBatchDatagram:{e.push(" -D");break}}if(this._secure){e.push(" -s")}if(!this._protocol.equals(Ice.Protocol_1_0)){e.push(" -p ");e.push(Ice.protocolVersionToString(this._protocol))}e.push(" -e ");e.push(Ice.encodingVersionToString(this._encoding));return e.join("")},toProperty:function(e){t.assert(false);return null},getRequestHandler:function(e){t.assert(false)},getBatchRequestQueue:function(){t.assert(false)},equals:function(e){if(this._mode!==e._mode){return false}if(this._secure!==e._secure){return false}if(!this._identity.equals(e._identity)){return false}if(!this._context.equals(e._context)){return false}if(this._facet!==e._facet){return false}if(this._overrideCompress!==e._overrideCompress){return false}if(this._overrideCompress&&this._compress!==e._compress){return false}if(!this._protocol.equals(e._protocol)){return false}if(!this._encoding.equals(e._encoding)){return false}if(this._invocationTimeout!==e._invocationTimeout){return false}return true},clone:function(){t.assert(false);return null},copyMembers:function(e){e._context=this._context;e._overrideCompress=this._overrideCompress;e._compress=this._compress}});y._emptyContext=new i;y._emptyEndpoints=[];Ice.Reference=y;var w=g(y,{__init__:function(e,t,n,i,r,s,o,c){y.call(this,e,t,n,i,r,s,Ice.Protocol_1_0,o);this._fixedConnection=c},getEndpoints:function(){return y._emptyEndpoints},getAdapterId:function(){return""},getRouterInfo:function(){return null},getLocatorInfo:function(){return null},getCacheConnection:function(){return true},getPreferSecure:function(){return false},getEndpointSelection:function(){return h.Random},getLocatorCacheTimeout:function(){return 0},getConnectionId:function(){return""},changeAdapterId:function(e){throw new Ice.FixedProxyException},changeEndpoints:function(e){throw new Ice.FixedProxyException},changeLocator:function(e){throw new Ice.FixedProxyException},changeRouter:function(e){throw new Ice.FixedProxyException},changeCacheConnection:function(e){throw new Ice.FixedProxyException},changePreferSecure:function(e){throw new Ice.FixedProxyException},changeEndpointSelection:function(e){throw new Ice.FixedProxyException},changeLocatorCacheTimeout:function(e){throw new Ice.FixedProxyException},changeTimeout:function(e){throw new Ice.FixedProxyException},changeConnectionId:function(e){throw new Ice.FixedProxyException},isIndirect:function(){return false},isWellKnown:function(){return false},streamWrite:function(e){throw new Ice.FixedProxyException},toString:function(){throw new Ice.FixedProxyException},toProperty:function(e){throw new Ice.FixedProxyException},clone:function(){var e=new w(this.getInstance(),this.getCommunicator(),this.getIdentity(),this.getFacet(),this.getMode(),this.getSecure(),this.getEncoding(),this._fixedConnection);this.copyMembers(e);return e},getRequestHandler:function(e){switch(this.getMode()){case a.ModeTwoway:case a.ModeOneway:case a.ModeBatchOneway:{if(this._fixedConnection.endpoint().datagram()){throw new Ice.NoEndpointException("")}break}case a.ModeDatagram:case a.ModeBatchDatagram:{if(!this._fixedConnection.endpoint().datagram()){throw new Ice.NoEndpointException("")}break}}var t;var n=this.getInstance().defaultsAndOverrides();if(n.overrideSecure){t=n.overrideSecureValue}else{t=this.getSecure()}if(t&&!this._fixedConnection.endpoint().secure()){throw new Ice.NoEndpointException("")}this._fixedConnection.throwException();var i;if(n.overrideCompress){i=n.overrideCompressValue}else if(this._overrideCompress){i=this._compress}else{i=this._fixedConnection.endpoint().compress()}return e.__setRequestHandler(new I(this,this._fixedConnection,i))},getBatchRequestQueue:function(){return this._fixedConnection.getBatchRequestQueue()},equals:function(e){if(this===e){return true}if(!(e instanceof w)){return false}if(!y.prototype.equals.call(this,e)){return false}return this._fixedConnection.equals(e._fixedConnection)}});Ice.FixedReference=w;var E=g(y,{__init__:function(e,n,i,r,s,o,c,a,u,l,h,f,d,p,_,I,g){y.call(this,e,n,i,r,s,o,c,a,g);this._endpoints=u;this._adapterId=l;this._locatorInfo=h;this._routerInfo=f;this._cacheConnection=d;this._preferSecure=p;this._endpointSelection=_;this._locatorCacheTimeout=I;this._overrideTimeout=false;this._timeout=-1;if(this._endpoints===null){this._endpoints=y._emptyEndpoints}if(this._adapterId===null){this._adapterId=""}this._connectionId="";t.assert(this._adapterId.length===0||this._endpoints.length===0)},getEndpoints:function(){return this._endpoints},getAdapterId:function(){return this._adapterId},getRouterInfo:function(){return this._routerInfo},getLocatorInfo:function(){return this._locatorInfo},getCacheConnection:function(){return this._cacheConnection},getPreferSecure:function(){return this._preferSecure},getEndpointSelection:function(){return this._endpointSelection},getLocatorCacheTimeout:function(){return this._locatorCacheTimeout},getConnectionId:function(){return this._connectionId},changeEncoding:function(e){var t=y.prototype.changeEncoding.call(this,e);if(t!==this){var n=t._locatorInfo;if(n!==null&&!n.getLocator().ice_getEncodingVersion().equals(e)){t._locatorInfo=this.getInstance().locatorManager().find(n.getLocator().ice_encodingVersion(e))}}return t},changeCompress:function(e){var t=y.prototype.changeCompress.call(this,e);if(t!==this&&this._endpoints.length>0){var n=[];for(var i=0;i0){var n=[];for(var i=0;i0){var n=[];for(var i=0;i0){t.assert(this._adapterId.length===0);for(var n=0;n0){for(var t=0;t0){e.push(":");e.push(n)}}}else if(this._adapterId.length>0){e.push(" @ ");var i=u.escapeString(this._adapterId,null);if(i.search(/[ :@]/)!=-1){e.push('"');e.push(i);e.push('"')}else{e.push(i)}}return e.join("")},toProperty:function(e){var t=new i,n;t.set(e,this.toString());t.set(e+".CollocationOptimized","0");t.set(e+".ConnectionCached",this._cacheConnection?"1":"0");t.set(e+".PreferSecure",this._preferSecure?"1":"0");t.set(e+".EndpointSelection",this._endpointSelection===h.Random?"Random":"Ordered");t.set(e+".LocatorCacheTimeout",""+this._locatorCacheTimeout);t.set(e+".InvocationTimeout",""+this.getInvocationTimeout());if(this._routerInfo!==null){var r=this._routerInfo.getRouter();var s=r.__reference().toProperty(e+".Router");for(n=s.entries;n!==null;n=n.next){t.set(n.key,n.value)}}if(this._locatorInfo!==null){var o=this._locatorInfo.getLocator();var c=o.__reference().toProperty(e+".Locator");for(n=c.entries;n!==null;n=n.next){t.set(n.key,n.value)}}return t},hashCode:function(){if(!this._hashInitialized){y.prototype.hashCode.call(this);this._hashValue=r.addString(this._hashValue,this._adapterId)}return this._hashValue},equals:function(t){if(this===t){return true}if(!(t instanceof E)){return false}if(!y.prototype.equals.call(this,t)){return false}if(this._locatorInfo===null?t._locatorInfo!==null:!this._locatorInfo.equals(t._locatorInfo)){return false}if(this._routerInfo===null?t._routerInfo!==null:!this._routerInfo.equals(t._routerInfo)){return false}if(this._cacheConnection!==t._cacheConnection){return false}if(this._preferSecure!==t._preferSecure){return false}if(this._endpointSelection!==t._endpointSelection){return false}if(this._locatorCacheTimeout!==t._locatorCacheTimeout){return false}if(this._connectionId!==t._connectionId){return false}if(this._overrideTimeout!==t._overrideTimeout){return false}if(this._overrideTimeout&&this._timeout!==t._timeout){return false}if(!e.equals(this._endpoints,t._endpoints,function(e,t){return e.equals(t)})){return false}if(this._adapterId!==t._adapterId){return false}return true},getRequestHandler:function(e){return this._instance.requestHandlerFactory().getRequestHandler(this,e)},getBatchRequestQueue:function(){return new n(this._instance,this._mode===a.ModeBatchDatagram)},getConnection:function(){var e=new o;if(this._routerInfo!==null){var t=this;this._routerInfo.getClientEndpoints().then(function(n){if(n.length>0){t.applyOverrides(n);t.createConnection(n).then(function(t,n){e.succeed(t,n)},function(t){e.fail(t)})}else{t.getConnectionNoRouterInfo(e)}}).exception(function(t){e.fail(t)})}else{this.getConnectionNoRouterInfo(e)}return e},getConnectionNoRouterInfo:function(e){if(this._endpoints.length>0){this.createConnection(this._endpoints).then(function(t,n){e.succeed(t,n)}).exception(function(t){e.fail(t)});return}var n=this;if(this._locatorInfo!==null){this._locatorInfo.getEndpoints(this,null,this._locatorCacheTimeout).then(function(i,r){if(i.length===0){e.fail(new Ice.NoEndpointException(n.toString()));return}n.applyOverrides(i);n.createConnection(i).then(function(t,n){e.succeed(t,n)},function(i){if(i instanceof Ice.NoEndpointException){e.fail(i)}else{t.assert(n._locatorInfo!==null);n.getLocatorInfo().clearCache(n);if(r){var s=n.getInstance().traceLevels();if(s.retry>=2){var o="connection to cached endpoints failed\n"+"removing endpoints from cache and trying one more time\n"+i.toString();n.getInstance().initializationData().logger.trace(s.retryCat,o)}n.getConnectionNoRouterInfo(e);return}e.fail(i)}})}).exception(function(t){e.fail(t)})}else{e.fail(new Ice.NoEndpointException(this.toString()))}},clone:function(){var e=new E(this.getInstance(),this.getCommunicator(),this.getIdentity(),this.getFacet(),this.getMode(),this.getSecure(),this.getProtocol(),this.getEncoding(),this._endpoints,this._adapterId,this._locatorInfo,this._routerInfo,this._cacheConnection,this._preferSecure,this._endpointSelection,this._locatorCacheTimeout,this._invocationTimeout);this.copyMembers(e);return e},copyMembers:function(e){y.prototype.copyMembers.call(this,e);e._overrideTimeout=this._overrideTimeout;e._timeout=this._timeout;e._connectionId=this._connectionId},applyOverrides:function(e){for(var t=0;t0){throw new n("unrecognized argument `"+a[0]+"' in endpoint `"+e+"'")}return f}}if(u==="opaque"){var d=new i;d.initWithOptions(a);if(a.length>0){throw new n("unrecognized argument `"+a[0]+"' in endpoint `"+e+"'")}for(l=0,h=this._factories.length;l0){this._retryIntervals=[];for(var n=0;n0?r:0}}else{this._retryIntervals=[0]}},stringToProxy:function(e){var t=this._instance.referenceFactory().createFromString(e,null);return this.referenceToProxy(t)},proxyToString:function(e){if(e!==null){return e.__reference().toString()}else{return""}},propertyToProxy:function(e){var t=this._instance.initializationData().properties.getProperty(e);var n=this._instance.referenceFactory().createFromString(t,e);return this.referenceToProxy(n)},proxyToProperty:function(e,n){if(e!==null){return e.__reference().toProperty(n)}else{return new t}},streamToProxy:function(e,t){var n=new r;n.__read(e);var i=this._instance.referenceFactory().createFromStream(n,e);return this.referenceToProxy(i,t)},referenceToProxy:function(e,t){if(e!==null){var i=t?new t:new n;i.__setup(e);return i}else{return null}},proxyToStream:function(e,t){if(e!==null){var n=e.__reference();n.getIdentity().__write(t);n.streamWrite(t)}else{var i=new r("","");i.__write(t)}},checkRetryAfterException:function(t,n,i,r){var s=this._instance.traceLevels();var o=this._instance.initializationData().logger;if(n.getMode()===Ice.Reference.ModeBatchOneway||n.getMode()===Ice.Reference.ModeBatchDatagram){throw t}if(t instanceof Ice.ObjectNotExistException){var c=t;if(n.getRouterInfo()!==null&&c.operation==="ice_add_proxy"){n.getRouterInfo().clearCache(n);if(s.retry>=1){o.trace(s.retryCat,"retrying operation call to add proxy to router\n"+t.toString())}if(i!==null){i.value=0}return r}else if(n.isIndirect()){if(n.isWellKnown()){var a=n.getLocatorInfo();if(a!==null){a.clearCache(n)}}}else{throw t}}else if(t instanceof Ice.RequestFailedException){throw t}if(t instanceof Ice.MarshalException){throw t}if(t instanceof Ice.CommunicatorDestroyedException||t instanceof Ice.ObjectAdapterDeactivatedException){throw t}if(t instanceof Ice.InvocationTimeoutException||t instanceof Ice.InvocationCanceledException){throw t}++r;e.assert(r>0);var u;if(r===this._retryIntervals.length+1&&t instanceof Ice.CloseConnectionException){u=0}else if(r>this._retryIntervals.length){if(s.retry>=1){o.trace(s.retryCat,"cannot retry operation call because retry limit has been exceeded\n"+t.toString())}throw t}else{u=this._retryIntervals[r-1]}if(s.retry>=1){var l="retrying operation call";if(u>0){l+=" in "+u+"ms"}l+=" because of exception\n"+t.toString();o.trace(s.retryCat,l)}e.assert(i!==null);i.value=u;return r}});Ice.ProxyFactory=s})();(function(){var e=Ice.FormatType;var t=Ice.EndpointSelectionType;var n=Ice.Protocol;var i=function(i,r){this.defaultProtocol=i.getPropertyWithDefault("Ice.Default.Protocol",Ice.TcpEndpointFactory!==undefined?"tcp":"ws");var s=i.getProperty("Ice.Default.Host");this.defaultHost=s.length>0?s:null;s=i.getProperty("Ice.Default.SourceAddress");this.defaultSourceAddress=s.length>0?s:null;s=i.getProperty("Ice.Override.Timeout");if(s.length>0){this.overrideTimeout=true;this.overrideTimeoutValue=i.getPropertyAsInt("Ice.Override.Timeout");if(this.overrideTimeoutValue<1&&this.overrideTimeoutValue!==-1){this.overrideTimeoutValue=-1;r.warning("invalid value for Ice.Override.Timeout `"+i.getProperty("Ice.Override.Timeout")+"': defaulting to -1")}}else{this.overrideTimeout=false;this.overrideTimeoutValue=-1}s=i.getProperty("Ice.Override.ConnectTimeout");if(s.length>0){this.overrideConnectTimeout=true;this.overrideConnectTimeoutValue=i.getPropertyAsInt("Ice.Override.ConnectTimeout");if(this.overrideConnectTimeoutValue<1&&this.overrideConnectTimeoutValue!==-1){this.overrideConnectTimeoutValue=-1;r.warning("invalid value for Ice.Override.ConnectTimeout `"+i.getProperty("Ice.Override.ConnectTimeout")+"': defaulting to -1")}}else{this.overrideConnectTimeout=false;this.overrideConnectTimeoutValue=-1}s=i.getProperty("Ice.Override.CloseTimeout");if(s.length>0){this.overrideCloseTimeout=true;this.overrideCloseTimeoutValue=i.getPropertyAsInt("Ice.Override.CloseTimeout");if(this.overrideCloseTimeoutValue<1&&this.overrideCloseTimeoutValue!==-1){this.overrideCloseTimeoutValue=-1;r.warning("invalid value for Ice.Override.CloseTimeout `"+i.getProperty("Ice.Override.CloseTimeout")+"': defaulting to -1")}}else{this.overrideCloseTimeout=false;this.overrideCloseTimeoutValue=-1}this.overrideCompress=false;this.overrideSecure=false;s=i.getPropertyWithDefault("Ice.Default.EndpointSelection","Random");if(s==="Random"){this.defaultEndpointSelection=t.Random}else if(s==="Ordered"){this.defaultEndpointSelection=t.Ordered}else{var o=new Ice.EndpointSelectionTypeParseException;o.str="illegal value `"+s+"'; expected `Random' or `Ordered'";throw o}this.defaultTimeout=i.getPropertyAsIntWithDefault("Ice.Default.Timeout",6e4);if(this.defaultTimeout<1&&this.defaultTimeout!==-1){this.defaultTimeout=6e4;r.warning("invalid value for Ice.Default.Timeout `"+i.getProperty("Ice.Default.Timeout")+"': defaulting to 60000")}this.defaultLocatorCacheTimeout=i.getPropertyAsIntWithDefault("Ice.Default.LocatorCacheTimeout",-1);if(this.defaultLocatorCacheTimeout<-1){this.defaultLocatorCacheTimeout=-1;r.warning("invalid value for Ice.Default.LocatorCacheTimeout `"+i.getProperty("Ice.Default.LocatorCacheTimeout")+"': defaulting to -1")}this.defaultInvocationTimeout=i.getPropertyAsIntWithDefault("Ice.Default.InvocationTimeout",-1);if(this.defaultInvocationTimeout<1&&this.defaultInvocationTimeout!==-1){this.defaultInvocationTimeout=-1;r.warning("invalid value for Ice.Default.InvocationTimeout `"+i.getProperty("Ice.Default.InvocationTimeout")+"': defaulting to -1")}this.defaultPreferSecure=i.getPropertyAsIntWithDefault("Ice.Default.PreferSecure",0)>0;s=i.getPropertyWithDefault("Ice.Default.EncodingVersion",Ice.encodingVersionToString(n.currentEncoding));this.defaultEncoding=Ice.stringToEncodingVersion(s);n.checkSupportedEncoding(this.defaultEncoding);var c=i.getPropertyAsIntWithDefault("Ice.Default.SlicedFormat",0)>0;this.defaultFormat=c?e.SlicedFormat:e.CompactFormat};Ice.DefaultsAndOverrides=i})();(function(){var e=Ice.StringUtil;var t=Ice.Identity;var n=Ice.IdentityParseException;Ice.stringToIdentity=function(i){var r=new t;var s=-1;var o=0;while((o=i.indexOf("/",o))!==-1){var c=0;while(o-c>0&&i.charAt(o-c-1)=="\\"){c++}if(c%2===0){if(s==-1){s=o}else{var a=new n;a.str="unescaped backslash in identity `"+i+"'";throw a}}o++}if(s==-1){r.category="";try{r.name=e.unescapeString(i)}catch(u){var a=new n;a.str="invalid identity name `"+i+"': "+a.toString();throw a}}else{try{r.category=e.unescapeString(i,0,s)}catch(u){var a=new n;a.str="invalid category in identity `"+i+"': "+a.toString();throw a}if(s+10);var i=this.applyOverrides(e);try{var s={value:false};var c=this.findConnectionByEndpoint(i,s);if(c!==null){return(new o).succeed(c,s.value)}}catch(a){return(new o).fail(a)}var u=new f(this,i,t,n);return u.start()},setRouterInfo:function(e){var t=this;return Ice.Promise.try(function(){if(t._destroyed){throw new Ice.CommunicatorDestroyedException}return e.getClientEndpoints()}).then(function(n){var i=e.getAdapter();var r=t._instance.defaultsAndOverrides();for(var s=0;s0);for(var i=0;i=0);if(this._destroyed&&this._pendingConnectCount===0){this.checkFinished()}},getConnection:function(e,t,n){if(this._destroyed){throw new Ice.CommunicatorDestroyedException}var i=this._monitor.swapReapedConnections();if(i!==null){for(var r=0;r=2){var i=[];i.push("connection to endpoint failed");if(e instanceof Ice.CommunicatorDestroyedException){i.push("\n")}else{if(t){i.push(", trying next endpoint\n")}else{i.push(" and no more endpoints to try\n")}}i.push(e.toString());this._instance.initializationData().logger.trace(n.retryCat,i.join(""))}},handleException:function(e,t){var n=this._instance.traceLevels();if(n.retry>=2){var i=[];i.push("couldn't resolve endpoint host");if(e instanceof Ice.CommunicatorDestroyedException){i.push("\n")}else{if(t){i.push(", trying next endpoint\n")}else{i.push(" and no more endpoints to try\n")}}i.push(e.toString());this._instance.initializationData().logger.trace(n.retryCat,i.join(""))}},checkFinished:function(){if(!this._waitPromise||!this._destroyed||this._pending.size>0||this._pendingConnectCount>0){return}var e=this;o.all(e._connectionsByEndpoint.map(function(e){return e.waitUntilFinished().exception(function(e){r.assert(false)})})).then(function(){var t=e._monitor.swapReapedConnections();if(t!==null){var n=[];for(var i=e._connectionsByEndpoint.entries;i!==null;i=i.next){var s=i.value;for(var o=0;o=2){var t=[];t.push("trying to establish ");t.push(this._current.protocol());t.push(" connection to ");t.push(this._current.toConnectorString());this._factory._instance.initializationData().logger.trace(e.networkCat,t.join(""))}var n=this._factory.createConnection(this._current.connect(),this._current);var i=this;n.start().then(function(){i.connectionStartCompleted(n)},function(e){i.connectionStartFailed(n,e)})}catch(s){if(e.network>=2){var t=[];t.push("failed to establish ");t.push(this._current.protocol());t.push(" connection to ");t.push(this._current.toString());t.push("\n");t.push(s.toString());this._factory._instance.initializationData().logger.trace(e.networkCat,t.join(""))}if(this.connectionStartFailedImpl(s)){continue}}break}},connectionStartFailedImpl:function(e){if(e instanceof Ice.LocalException){this._factory.handleConnectionException(e,this._hasMore||this._index=1){this.getEndpointsTrace(t,c,true)}o.succeed(c,true);return o},clearCache:function(t){e.assert(t.isIndirect());if(!t.isWellKnown()){var n=this._table.removeAdapterEndpoints(t.getAdapterId());if(n!==null&&t.getInstance().traceLevels().location>=2){this.trace("removed endpoints from locator table\n",t,n)}}else{var i=this._table.removeObjectReference(t.getIdentity());if(i!==null){if(!i.isIndirect()){if(t.getInstance().traceLevels().location>=2){this.trace("removed endpoints from locator table",t,i.getEndpoints())}}else if(!i.isWellKnown()){this.clearCache(i)}}}},trace:function(t,n,i){e.assert(n.isIndirect());var r=[];r.push(t);r.push("\n");if(!n.isWellKnown()){r.push("adapter = ");r.push(n.getAdapterId());r.push("\n")}else{r.push("object = ");r.push(n.getInstance().identityToString(n.getIdentity()));r.push("\n")}r.push("endpoints = ");for(var s=0;s=1){r=[];r.push("adapter not found\n");r.push("adapter = ");r.push(t.getAdapterId());i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}s=new Ice.NotRegisteredException;s.kindOfObject="object adapter";s.id=t.getAdapterId();throw s}else if(o instanceof Ice.ObjectNotFoundException){if(i.traceLevels().location>=1){r=[];r.push("object not found\n");r.push("object = ");r.push(i.identityToString(t.getIdentity()));i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}s=new Ice.NotRegisteredException;s.kindOfObject="object";s.id=i.identityToString(t.getIdentity());throw s}else if(o instanceof Ice.NotRegisteredException){throw o}else if(o instanceof Ice.LocalException){if(i.traceLevels().location>=1){r=[];r.push("couldn't contact the locator to retrieve adapter endpoints\n");if(t.getAdapterId().length>0){r.push("adapter = ");r.push(t.getAdapterId());r.push("\n")}else{r.push("object = ");r.push(i.identityToString(t.getIdentity()));r.push("\n")}r.push("reason = "+o.toString());i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}throw o}else{e.assert(false)}}},getEndpointsTrace:function(e,t,n){if(t!==null&&t.length>0){if(n){this.trace("found endpoints in locator table",e,t)}else{this.trace("retrieved endpoints from locator, adding to locator table",e,t)}}else{var i=e.getInstance();var r=[];r.push("no endpoints configured for ");if(e.getAdapterId().length>0){r.push("adapter\n");r.push("adapter = ");r.push(e.getAdapterId());r.push("\n")}else{r.push("object\n");r.push("object = ");r.push(i.identityToString(e.getIdentity()));r.push("\n")}i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}},getAdapterRequest:function(e){if(e.getInstance().traceLevels().location>=1){var t=e.getInstance();var n=[];n.push("searching for adapter by id\n");n.push("adapter = ");n.push(e.getAdapterId());t.initializationData().logger.trace(t.traceLevels().locationCat,n.join(""))}var i=this._adapterRequests.get(e.getAdapterId());if(i!==undefined){return i}i=new l(this,e);this._adapterRequests.set(e.getAdapterId(),i);return i},getObjectRequest:function(e){if(e.getInstance().traceLevels().location>=1){var t=e.getInstance();var n=[];n.push("searching for object by id\n");n.push("object = ");n.push(t.identityToString(e.getIdentity()));t.initializationData().logger.trace(t.traceLevels().locationCat,n.join(""))}var i=this._objectRequests.get(e.getIdentity());if(i!==undefined){return i}i=new u(this,e);this._objectRequests.set(e.getIdentity(),i);return i},finishRequest:function(t,n,i,r){if(i===null||i.__reference().isIndirect()){for(var s=0;s=1){e.getEndpointsTrace(this._ref,n,false)}if(this._promise!==null){this._promise.succeed(n===null?[]:n,false)}},exception:function(e,t){try{e.getEndpointsException(this._ref,t)}catch(n){if(this._promise!==null){this._promise.fail(n)}}}});var a=s({__init__:function(e,t){this._locatorInfo=e;this._ref=t;this._callbacks=[];this._wellKnownRefs=[];this._sent=false;this._response=false;this._proxy=null;this._exception=null},addCallback:function(e,t,n,i){var r=new c(e,n,i);if(this._response){r.response(this._locatorInfo,this._proxy)}else if(this._exception!==null){r.exception(this._locatorInfo,this._exception)}else{this._callbacks.push(r);if(t!==null){this._wellKnownRefs.push(t)}if(!this._sent){this._sent=true;this.send()}}},response:function(e){this._locatorInfo.finishRequest(this._ref,this._wellKnownRefs,e,false);this._response=true;this._proxy=e;for(var t=0;t0){var d=["found unknown properties for object adapter `"+r+"':"];for(var p=0;p2147483647/1024){this._messageSizeMax=2147483647}else{this._messageSizeMax=m*1024}}try{if(o===null){o=Ice.RouterPrx.uncheckedCast(this._instance.proxyFactory().propertyToProxy(this._name+".Router"))}if(o!==null){this._routerInfo=this._instance.routerManager().find(o);t.assert(this._routerInfo!==null);if(this._routerInfo.getAdapter()!==null){throw new Ice.AlreadyRegisteredException("object adapter with router",this._instance.identityToString(o.ice_getIdentity()))}var y=this;this._routerInfo.getServerEndpoints().then(function(e){var t;for(t=0;t0){throw new Ice.FeatureNotSupportedException("object adapter endpoints not supported")}u.succeed(this,u)}}catch(_){this.destroy();throw _}},getName:function(){return this._noConfig?"":this._name},getCommunicator:function(){return this._communicator;
+},activate:function(){},hold:function(){this.checkForDeactivation()},waitForHold:function(){var t=new e(this._communicator,"waitForHold",null,null,this);if(this.checkForDeactivation(t)){return t}return t.succeed(t)},deactivate:function(){var t=new e(this._communicator,"deactivate",null,null,this);if(this._state=u},destroy:function(){var t=new e(this._communicator,"destroy",null,null,this);var n=this;var i=function(){if(n._state=u){var t=new Ice.ObjectAdapterDeactivatedException;t.name=this.getName();if(e!==undefined){e.fail(t,e);return true}else{throw t}}return false},checkIdentity:function(e){if(e.name===undefined||e.name===null||e.name.length===0){throw new Ice.IllegalIdentityException(e)}if(e.category===undefined||e.category===null){e.category=""}},checkServant:function(e){if(e===undefined||e===null){throw new Ice.IllegalServantException("cannot add null servant to Object Adapter")}},filterProperties:function(e){var t=true,n;var i=this._name+".";for(n=0;n0;this._table=new e(e.compareEquals);this._locatorTables=new e(e.compareEquals)},destroy:function(){for(var e=this._table.entries;e!==null;e=e.next){e.value.destroy()}this._table.clear();this._locatorTables.clear()},find:function(e){if(e===null){return null}var r=i.uncheckedCast(e.ice_locator(null));var s=this._table.get(r);if(s===undefined){var o=this._locatorTables.get(r.ice_getIdentity());if(o===undefined){o=new n;this._locatorTables.set(r.ice_getIdentity(),o)}s=new t(r,o,this._background);this._table.set(r,s)}return s}});Ice.LocatorManager=r})();(function(){var e=Ice.AsyncResultBase;var t=Ice.ObjectAdapterI;var n=Ice.Promise;var i=Ice.Class({__init__:function(e,t){this._instance=e;this._communicator=t;this._adapters=[];this._adapterNamesInUse=[];this._shutdownPromise=new n},shutdown:function(){if(this._instance===null){return this._shutdownPromise}this._instance=null;this._communicator=null;this._shutdownPromise=n.all(this._adapters.map(function(e){return e.deactivate()}));return this._shutdownPromise},waitForShutdown:function(){var e=this;return this._shutdownPromise.then(function(){return n.all(e._adapters.map(function(e){return e.waitForDeactivate()}))})},isShutdown:function(){return this._instance===null},destroy:function(){var e=this;return this.waitForShutdown().then(function(){return n.all(e._adapters.map(function(e){return e.destroy()}))})},createObjectAdapter:function(e,n,i){if(this._instance===null){throw new Ice.ObjectAdapterDeactivatedException}var r=null;try{if(e.length===0){var s=Ice.generateUUID();r=new t(this._instance,this._communicator,this,s,null,true,i)}else{if(this._adapterNamesInUse.indexOf(e)!==-1){throw new Ice.AlreadyRegisteredException("object adapter",e)}r=new t(this._instance,this._communicator,this,e,n,false,i);this._adapterNamesInUse.push(e)}this._adapters.push(r)}catch(o){i.fail(o,i)}},removeObjectAdapter:function(e){if(this._instance===null){return}var t=this._adapters.indexOf(e);if(t!==-1){this._adapters.splice(t,1)}t=this._adapterNamesInUse.indexOf(e.getName());if(t!==-1){this._adapterNamesInUse.splice(t,1)}}});Ice.ObjectAdapterFactory=i})();(function(){t.defineDictionary(IceMX,"StringIntDict","StringIntDictHelper","Ice.StringHelper","Ice.IntHelper",false,undefined,undefined);IceMX.Metrics=t.defineObject(function(e,t,n,i,r){Ice.Object.call(this);this.id=e!==undefined?e:"";this.total=t!==undefined?t:new Ice.Long(0,0);this.current=n!==undefined?n:0;this.totalLifetime=i!==undefined?i:new Ice.Long(0,0);this.failures=r!==undefined?r:0},Ice.Object,undefined,1,["::Ice::Object","::IceMX::Metrics"],-1,function(e){e.writeString(this.id);e.writeLong(this.total);e.writeInt(this.current);e.writeLong(this.totalLifetime);e.writeInt(this.failures)},function(e){this.id=e.readString();this.total=e.readLong();this.current=e.readInt();this.totalLifetime=e.readLong();this.failures=e.readInt()},false);IceMX.MetricsPrx=t.defineProxy(Ice.ObjectPrx,IceMX.Metrics.ice_staticId,undefined);t.defineOperations(IceMX.Metrics,IceMX.MetricsPrx);IceMX.MetricsFailures=t.defineStruct(function(e,t){this.id=e!==undefined?e:"";this.failures=t!==undefined?t:null},false,function(e){e.writeString(this.id);IceMX.StringIntDictHelper.write(e,this.failures)},function(e){this.id=e.readString();this.failures=IceMX.StringIntDictHelper.read(e)},2,false);t.defineSequence(IceMX,"MetricsFailuresSeqHelper","IceMX.MetricsFailures",false);t.defineSequence(IceMX,"MetricsMapHelper","Ice.ObjectHelper",false,"IceMX.Metrics");t.defineDictionary(IceMX,"MetricsView","MetricsViewHelper","Ice.StringHelper","IceMX.MetricsMapHelper",false,undefined,undefined,Ice.ArrayUtil.equals);IceMX.UnknownMetricsView=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"IceMX::UnknownMetricsView",undefined,undefined,false,false);IceMX.MetricsAdmin=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::IceMX::MetricsAdmin"],-1,undefined,undefined,false);IceMX.MetricsAdminPrx=t.defineProxy(Ice.ObjectPrx,IceMX.MetricsAdmin.ice_staticId,undefined);t.defineOperations(IceMX.MetricsAdmin,IceMX.MetricsAdminPrx,{getMetricsViewNames:[,,,,2,["Ice.StringSeqHelper"],,[["Ice.StringSeqHelper"]],,,],enableMetricsView:[,,,,2,,[[7]],,[IceMX.UnknownMetricsView],,],disableMetricsView:[,,,,2,,[[7]],,[IceMX.UnknownMetricsView],,],getMetricsView:[,,,,2,["IceMX.MetricsViewHelper"],[[7]],[[4]],[IceMX.UnknownMetricsView],,true],getMapMetricsFailures:[,,,,2,["IceMX.MetricsFailuresSeqHelper"],[[7],[7]],,[IceMX.UnknownMetricsView],,],getMetricsFailures:[,,,,2,[IceMX.MetricsFailures],[[7],[7],[7]],,[IceMX.UnknownMetricsView],,]});IceMX.ThreadMetrics=t.defineObject(function(e,t,n,i,r,s,o,c){IceMX.Metrics.call(this,e,t,n,i,r);this.inUseForIO=s!==undefined?s:0;this.inUseForUser=o!==undefined?o:0;this.inUseForOther=c!==undefined?c:0},IceMX.Metrics,undefined,2,["::Ice::Object","::IceMX::Metrics","::IceMX::ThreadMetrics"],-1,function(e){e.writeInt(this.inUseForIO);e.writeInt(this.inUseForUser);e.writeInt(this.inUseForOther)},function(e){this.inUseForIO=e.readInt();this.inUseForUser=e.readInt();this.inUseForOther=e.readInt()},false);IceMX.ThreadMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.ThreadMetrics.ice_staticId,undefined);t.defineOperations(IceMX.ThreadMetrics,IceMX.ThreadMetricsPrx);IceMX.DispatchMetrics=t.defineObject(function(e,t,n,i,r,s,o,c){IceMX.Metrics.call(this,e,t,n,i,r);this.userException=s!==undefined?s:0;this.size=o!==undefined?o:new Ice.Long(0,0);this.replySize=c!==undefined?c:new Ice.Long(0,0)},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::DispatchMetrics","::IceMX::Metrics"],-1,function(e){e.writeInt(this.userException);e.writeLong(this.size);e.writeLong(this.replySize)},function(e){this.userException=e.readInt();this.size=e.readLong();this.replySize=e.readLong()},false);IceMX.DispatchMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.DispatchMetrics.ice_staticId,undefined);t.defineOperations(IceMX.DispatchMetrics,IceMX.DispatchMetricsPrx);IceMX.ChildInvocationMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.Metrics.call(this,e,t,n,i,r);this.size=s!==undefined?s:new Ice.Long(0,0);this.replySize=o!==undefined?o:new Ice.Long(0,0)},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::ChildInvocationMetrics","::IceMX::Metrics"],-1,function(e){e.writeLong(this.size);e.writeLong(this.replySize)},function(e){this.size=e.readLong();this.replySize=e.readLong()},false);IceMX.ChildInvocationMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.ChildInvocationMetrics.ice_staticId,undefined);t.defineOperations(IceMX.ChildInvocationMetrics,IceMX.ChildInvocationMetricsPrx);IceMX.CollocatedMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.ChildInvocationMetrics.call(this,e,t,n,i,r,s,o)},IceMX.ChildInvocationMetrics,undefined,2,["::Ice::Object","::IceMX::ChildInvocationMetrics","::IceMX::CollocatedMetrics","::IceMX::Metrics"],-1,undefined,undefined,false);IceMX.CollocatedMetricsPrx=t.defineProxy(IceMX.ChildInvocationMetricsPrx,IceMX.CollocatedMetrics.ice_staticId,undefined);t.defineOperations(IceMX.CollocatedMetrics,IceMX.CollocatedMetricsPrx);IceMX.RemoteMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.ChildInvocationMetrics.call(this,e,t,n,i,r,s,o)},IceMX.ChildInvocationMetrics,undefined,3,["::Ice::Object","::IceMX::ChildInvocationMetrics","::IceMX::Metrics","::IceMX::RemoteMetrics"],-1,undefined,undefined,false);IceMX.RemoteMetricsPrx=t.defineProxy(IceMX.ChildInvocationMetricsPrx,IceMX.RemoteMetrics.ice_staticId,undefined);t.defineOperations(IceMX.RemoteMetrics,IceMX.RemoteMetricsPrx);IceMX.InvocationMetrics=t.defineObject(function(e,t,n,i,r,s,o,c,a){IceMX.Metrics.call(this,e,t,n,i,r);this.retry=s!==undefined?s:0;this.userException=o!==undefined?o:0;this.remotes=c!==undefined?c:null;this.collocated=a!==undefined?a:null},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::InvocationMetrics","::IceMX::Metrics"],-1,function(e){e.writeInt(this.retry);e.writeInt(this.userException);IceMX.MetricsMapHelper.write(e,this.remotes);IceMX.MetricsMapHelper.write(e,this.collocated)},function(e){this.retry=e.readInt();this.userException=e.readInt();this.remotes=IceMX.MetricsMapHelper.read(e);this.collocated=IceMX.MetricsMapHelper.read(e)},false);IceMX.InvocationMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.InvocationMetrics.ice_staticId,undefined);t.defineOperations(IceMX.InvocationMetrics,IceMX.InvocationMetricsPrx);IceMX.ConnectionMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.Metrics.call(this,e,t,n,i,r);this.receivedBytes=s!==undefined?s:new Ice.Long(0,0);this.sentBytes=o!==undefined?o:new Ice.Long(0,0)},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::ConnectionMetrics","::IceMX::Metrics"],-1,function(e){e.writeLong(this.receivedBytes);e.writeLong(this.sentBytes)},function(e){this.receivedBytes=e.readLong();this.sentBytes=e.readLong()},false);IceMX.ConnectionMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.ConnectionMetrics.ice_staticId,undefined);t.defineOperations(IceMX.ConnectionMetrics,IceMX.ConnectionMetricsPrx)})();(function(){var e=Ice.Debug;var t=Ice.HashMap;var n=Ice.ConnectRequestHandler;var i=Ice.Class({__init__:function(e){this._instance=e;this._handlers=new t(t.compareEquals)},getRequestHandler:function(e,t){var i=false;var r;if(e.getCacheConnection()){r=this._handlers.get(e);if(!r){r=new n(e,t);this._handlers.set(e,r);i=true}}else{i=true;r=new n(e,t)}if(i){e.getConnection().then(function(e,t){r.setConnection(e,t)},function(e){r.setException(e)})}return t.__setRequestHandler(r.connect(t))},removeRequestHandler:function(e,t){if(e.getCacheConnection()){if(this._handlers.get(e)===t){this._handlers.delete(e)}}}});Ice.RequestHandlerFactory=i})();(function(){Ice.Process=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::Process"],-1,undefined,undefined,false);Ice.ProcessPrx=t.defineProxy(Ice.ObjectPrx,Ice.Process.ice_staticId,undefined);t.defineOperations(Ice.Process,Ice.ProcessPrx,{shutdown:[,,,,,,,,,,],writeMessage:[,,,,,,[[7],[3]],,,,]})})();(function(){var e=Ice.TcpEndpointI;var t=Ice.Class({__init__:function(e){this._instance=e},type:function(){return this._instance.type()},protocol:function(){return this._instance.protocol()},create:function(t,n){var i=new e(this._instance);i.initWithOptions(t,n);return i},read:function(t){var n=new e(this._instance);n.initWithStream(t);return n},destroy:function(){this._instance=null},clone:function(e){return new t(e)}});Ice.TcpEndpointFactory=t})();(function(){t.defineDictionary(Ice,"PropertyDict","PropertyDictHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined);Ice.PropertiesAdmin=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::PropertiesAdmin"],-1,undefined,undefined,false);Ice.PropertiesAdminPrx=t.defineProxy(Ice.ObjectPrx,Ice.PropertiesAdmin.ice_staticId,undefined);t.defineOperations(Ice.PropertiesAdmin,Ice.PropertiesAdminPrx,{getProperty:[,,,,,[7],[[7]],,,,],getPropertiesForPrefix:[,,,,,["Ice.PropertyDictHelper"],[[7]],,,,],setProperties:[,,,1,,,[["Ice.PropertyDictHelper"]],,,,]})})();(function(){Ice.LogMessageType=t.defineEnum([["PrintMessage",0],["TraceMessage",1],["WarningMessage",2],["ErrorMessage",3]]);t.defineSequence(Ice,"LogMessageTypeSeqHelper","Ice.LogMessageType.__helper",false);Ice.LogMessage=t.defineStruct(function(e,t,n,i){this.type=e!==undefined?e:Ice.LogMessageType.PrintMessage;this.timestamp=t!==undefined?t:new Ice.Long(0,0);this.traceCategory=n!==undefined?n:"";this.message=i!==undefined?i:""},true,function(e){Ice.LogMessageType.__write(e,this.type);e.writeLong(this.timestamp);e.writeString(this.traceCategory);e.writeString(this.message)},function(e){this.type=Ice.LogMessageType.__read(e);this.timestamp=e.readLong();this.traceCategory=e.readString();this.message=e.readString()},11,false);t.defineSequence(Ice,"LogMessageSeqHelper","Ice.LogMessage",false);Ice.RemoteLogger=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::RemoteLogger"],-1,undefined,undefined,false);Ice.RemoteLoggerPrx=t.defineProxy(Ice.ObjectPrx,Ice.RemoteLogger.ice_staticId,undefined);t.defineOperations(Ice.RemoteLogger,Ice.RemoteLoggerPrx,{init:[,,,,,,[[7],["Ice.LogMessageSeqHelper"]],,,,],log:[,,,,,,[[Ice.LogMessage]],,,,]});Ice.RemoteLoggerAlreadyAttachedException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::RemoteLoggerAlreadyAttachedException",undefined,undefined,false,false);Ice.LoggerAdmin=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::LoggerAdmin","::Ice::Object"],-1,undefined,undefined,false);Ice.LoggerAdminPrx=t.defineProxy(Ice.ObjectPrx,Ice.LoggerAdmin.ice_staticId,undefined);t.defineOperations(Ice.LoggerAdmin,Ice.LoggerAdminPrx,{attachRemoteLogger:[,,,,,,[["Ice.RemoteLoggerPrx"],["Ice.LogMessageTypeSeqHelper"],["Ice.StringSeqHelper"],[3]],,[Ice.RemoteLoggerAlreadyAttachedException],,],detachRemoteLogger:[,,,,,[1],[["Ice.RemoteLoggerPrx"]],,,,],getLog:[,,,,,["Ice.LogMessageSeqHelper"],[["Ice.LogMessageTypeSeqHelper"],["Ice.StringSeqHelper"],[3]],[[7]],,,]})})();(function(){var e=Ice.WSEndpoint;var t=Ice.Class({__init__:function(e,t){this._instance=e;this._delegate=t},type:function(){return this._instance.type()},protocol:function(){return this._instance.protocol()},create:function(t,n){var i=new e(this._instance,this._delegate.create(t,n));i.initWithOptions(t);return i},read:function(t){var n=new e(this._instance,this._delegate.read(t));n.initWithStream(t);return n},destroy:function(){this._delegate.destroy();this._instance=null}});Ice.WSEndpointFactory=t})();(function(){t.defineDictionary(Ice,"SliceChecksumDict","SliceChecksumDictHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined)})();(function(){var e=Ice.AsyncResultBase;var t=Ice.Debug;var n=Ice.DefaultsAndOverrides;var i=Ice.EndpointFactoryManager;var r=Ice.HashMap;var s=Ice.ImplicitContextI;var o=Ice.LocatorManager;var c=Ice.Logger;var a=Ice.ObjectAdapterFactory;var u=Ice.ObjectFactoryManager;var l=Ice.OutgoingConnectionFactory;var h=Ice.Promise;var f=Ice.Properties;var d=Ice.ProxyFactory;var p=Ice.RetryQueue;var _=Ice.RouterManager;var I=Ice.Timer;var g=Ice.TraceLevels;var v=Ice.ReferenceFactory;var m=Ice.RequestHandlerFactory;var y=Ice.ACMConfig;var w=0;var E=1;var x=2;var S=Ice.Class({__init__:function(e){this._state=w;this._initData=e;this._traceLevels=null;this._defaultsAndOverrides=null;this._messageSizeMax=0;this._batchAutoFlushSize=0;this._clientACM=null;this._implicitContext=null;this._routerManager=null;this._locatorManager=null;this._referenceFactory=null;this._requestHandlerFactory=null;this._proxyFactory=null;this._outgoingConnectionFactory=null;this._servantFactoryManager=null;this._objectAdapterFactory=null;this._retryQueue=null;this._endpointHostResolver=null;this._endpointFactoryManager=null},initializationData:function(){return this._initData},traceLevels:function(){t.assert(this._traceLevels!==null);return this._traceLevels},defaultsAndOverrides:function(){t.assert(this._defaultsAndOverrides!==null);return this._defaultsAndOverrides},routerManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._routerManager!==null);return this._routerManager},locatorManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._locatorManager!==null);return this._locatorManager},referenceFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._referenceFactory!==null);return this._referenceFactory},requestHandlerFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._requestHandlerFactory!==null);return this._requestHandlerFactory},proxyFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._proxyFactory!==null);return this._proxyFactory},outgoingConnectionFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._outgoingConnectionFactory!==null);return this._outgoingConnectionFactory},servantFactoryManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._servantFactoryManager!==null);return this._servantFactoryManager},objectAdapterFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._objectAdapterFactory!==null);return this._objectAdapterFactory},retryQueue:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._retryQueue!==null);return this._retryQueue},timer:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._timer!==null);return this._timer},endpointFactoryManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._endpointFactoryManager!==null);return this._endpointFactoryManager},messageSizeMax:function(){return this._messageSizeMax},batchAutoFlushSize:function(){return this._batchAutoFlushSize},clientACM:function(){return this._clientACM},getImplicitContext:function(){return this._implicitContext},stringToIdentity:function(e){return Ice.stringToIdentity(e)},identityToString:function(e){return Ice.identityToString(e)},setDefaultLocator:function(e){if(this._state==x){throw new Ice.CommunicatorDestroyedException}this._referenceFactory=this._referenceFactory.setDefaultLocator(e)},setDefaultRouter:function(e){if(this._state==x){throw new Ice.CommunicatorDestroyedException}this._referenceFactory=this._referenceFactory.setDefaultRouter(e)},setLogger:function(e){this._initData.logger=e},finishSetup:function(e,t){try{if(this._initData.properties===null){this._initData.properties=f.createProperties()}if(Ice.__oneOfDone===undefined){Ice.__printStackTraces=this._initData.properties.getPropertyAsIntWithDefault("Ice.PrintStackTraces",0)>0;Ice.__oneOfDone=true}if(this._initData.logger===null){this._initData.logger=Ice.getProcessLogger()}this._traceLevels=new g(this._initData.properties);this._defaultsAndOverrides=new n(this._initData.properties,this._initData.logger);var r=1024;var c=this._initData.properties.getPropertyAsIntWithDefault("Ice.MessageSizeMax",r);if(c<1||c>2147483647/1024){this._messageSizeMax=2147483647}else{this._messageSizeMax=c*1024}if(this._initData.properties.getProperty("Ice.BatchAutoFlushSize").length===0&&this._initData.properties.getProperty("Ice.BatchAutoFlush").length>0){if(this._initData.properties.getPropertyAsInt("Ice.BatchAutoFlush")>0){this._batchAutoFlushSize=this._messageSizeMax}}else{c=this._initData.properties.getPropertyAsIntWithDefault("Ice.BatchAutoFlushSize",1024);if(c<1){this._batchAutoFlushSize=c}else if(c>2147483647/1024){this._batchAutoFlushSize=2147483647}else{this._batchAutoFlushSize=c*1024}}this._clientACM=new y(this._initData.properties,this._initData.logger,"Ice.ACM.Client",new y(this._initData.properties,this._initData.logger,"Ice.ACM",new y));this._implicitContext=s.create(this._initData.properties.getProperty("Ice.ImplicitContext"));this._routerManager=new _;this._locatorManager=new o(this._initData.properties);this._referenceFactory=new v(this,e);this._requestHandlerFactory=new m(this,e);this._proxyFactory=new d(this);this._endpointFactoryManager=new i(this);var h=new Ice.ProtocolInstance(this,Ice.TCPEndpointType,"tcp",false);var w=new Ice.TcpEndpointFactory(h);this._endpointFactoryManager.add(w);var E=new Ice.ProtocolInstance(this,Ice.WSEndpointType,"ws",false);var x=new Ice.WSEndpointFactory(E,w.clone(E));this._endpointFactoryManager.add(x);var S=new Ice.ProtocolInstance(this,IceSSL.EndpointType,"ssl",true);var b=new Ice.TcpEndpointFactory(S);this._endpointFactoryManager.add(b);var C=new Ice.ProtocolInstance(this,Ice.WSSEndpointType,"wss",true);var P=new Ice.WSEndpointFactory(C,b.clone(C));this._endpointFactoryManager.add(P);this._outgoingConnectionFactory=new l(e,this);this._servantFactoryManager=new u;this._objectAdapterFactory=new a(this,e);this._retryQueue=new p(this);this._timer=new I(this._initData.logger);var M=Ice.RouterPrx.uncheckedCast(this._proxyFactory.propertyToProxy("Ice.Default.Router"));if(M!==null){this._referenceFactory=this._referenceFactory.setDefaultRouter(M)}var O=Ice.LocatorPrx.uncheckedCast(this._proxyFactory.propertyToProxy("Ice.Default.Locator"));if(O!==null){this._referenceFactory=this._referenceFactory.setDefaultLocator(O)}if(t!==null){t.succeed(e)}}catch(k){if(t!==null){if(k instanceof Ice.LocalException){this.destroy().finally(function(){t.fail(k)})}else{t.fail(k)}}else{if(k instanceof Ice.LocalException){this.destroy()}throw k}}},destroy:function(){var t=new e(null,"destroy",null,this,null);if(this._state==E){if(!this._destroyPromises){this._destroyPromises=[]}this._destroyPromises.push(t);return t}this._state=E;var n=this;Ice.Promise.try(function(){if(n._objectAdapterFactory){return n._objectAdapterFactory.shutdown()}}).then(function(){if(n._outgoingConnectionFactory!==null){n._outgoingConnectionFactory.destroy()}if(n._objectAdapterFactory!==null){return n._objectAdapterFactory.destroy()}}).then(function(){if(n._outgoingConnectionFactory!==null){return n._outgoingConnectionFactory.waitUntilFinished()}}).then(function(){if(n._retryQueue){n._retryQueue.destroy()}if(n._timer){n._timer.destroy()}if(n._servantFactoryManager){n._servantFactoryManager.destroy()}if(n._routerManager){n._routerManager.destroy()}if(n._locatorManager){n._locatorManager.destroy()}if(n._endpointFactoryManager){n._endpointFactoryManager.destroy()}var e;if(n._initData.properties.getPropertyAsInt("Ice.Warn.UnusedProperties")>0){var i=n._initData.properties.getUnusedProperties();if(i.length>0){var r=[];r.push("The following properties were set but never read:");for(e=0;e
+//
+// Generated from file `Printer.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ const Ice = require("ice").Ice;
+ const _ModuleRegistry = Ice._ModuleRegistry;
+ const Slice = Ice.Slice;
+
+ let Demo = _ModuleRegistry.module("Demo");
+
+ const iceC_Demo_Printer_ids = [
+ "::Demo::Printer",
+ "::Ice::Object"
+ ];
+
+ Demo.Printer = class extends Ice.Object
+ {
+ };
+
+ Demo.PrinterPrx = class extends Ice.ObjectPrx
+ {
+ };
+
+ Slice.defineOperations(Demo.Printer, Demo.PrinterPrx, iceC_Demo_Printer_ids, 0,
+ {
+ "printString": [, , , , , [[7]], , , , ],
+ "getPoint": [, , , , , [[3]], , , , ],
+ "setPoint": [, , , , [3], [[3]], , , , ]
+ });
+ exports.Demo = Demo;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice._require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/ardroneextra.js b/src/tools/3DViewer-web/public/js/jderobot/ardroneextra.js
new file mode 100644
index 000000000..e197df096
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/ardroneextra.js
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `ardroneextra.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.ArDroneExtra = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::ArDroneExtra"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.ArDroneExtraPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.ArDroneExtra.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.ArDroneExtra, jderobot.ArDroneExtraPrx,
+ {
+ "toggleCam": [, , , , , , , , , , ],
+ "land": [, , , , , , , , , , ],
+ "takeoff": [, , , , , , , , , , ],
+ "reset": [, , , , , , , , , , ],
+ "recordOnUsb": [, , , , , , [[1]], , , , ],
+ "ledAnimation": [, , , , , , [[3], [5], [5]], , , , ],
+ "flightAnimation": [, , , , , , [[3], [5]], , , , ],
+ "flatTrim": [, , , , , , , , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/bumper.js b/src/tools/3DViewer-web/public/js/jderobot/bumper.js
new file mode 100644
index 000000000..9330ddadd
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/bumper.js
@@ -0,0 +1,82 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `bumper.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.BumperData = Slice.defineObject(
+ function(bumper, state, timeStamp)
+ {
+ Ice.Object.call(this);
+ this.bumper = bumper !== undefined ? bumper : 0;
+ this.state = state !== undefined ? state : 0;
+ this.timeStamp = timeStamp !== undefined ? timeStamp : new jderobot.Time();
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::BumperData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeInt(this.bumper);
+ __os.writeInt(this.state);
+ jderobot.Time.write(__os, this.timeStamp);
+ },
+ function(__is)
+ {
+ this.bumper = __is.readInt();
+ this.state = __is.readInt();
+ this.timeStamp = jderobot.Time.read(__is, this.timeStamp);
+ },
+ false);
+
+ jderobot.BumperDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.BumperData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.BumperData, jderobot.BumperDataPrx);
+
+ /**
+ * Interface to the Gazebo bumper sensor.
+ **/
+ jderobot.Bumper = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Bumper"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.BumperPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Bumper.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Bumper, jderobot.BumperPrx,
+ {
+ "getBumperData": [, 2, 2, , , ["jderobot.BumperData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/camera.js b/src/tools/3DViewer-web/public/js/jderobot/camera.js
new file mode 100644
index 000000000..debec1839
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/camera.js
@@ -0,0 +1,130 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `camera.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("image").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * Static description of a camera
+ **/
+ jderobot.CameraDescription = Slice.defineObject(
+ function(name, shortDescription, streamingUri, fdistx, fdisty, u0, v0, skew, posx, posy, posz, foax, foay, foaz, roll)
+ {
+ Ice.Object.call(this);
+ this.name = name !== undefined ? name : "";
+ this.shortDescription = shortDescription !== undefined ? shortDescription : "";
+ this.streamingUri = streamingUri !== undefined ? streamingUri : "";
+ this.fdistx = fdistx !== undefined ? fdistx : 0.0;
+ this.fdisty = fdisty !== undefined ? fdisty : 0.0;
+ this.u0 = u0 !== undefined ? u0 : 0.0;
+ this.v0 = v0 !== undefined ? v0 : 0.0;
+ this.skew = skew !== undefined ? skew : 0.0;
+ this.posx = posx !== undefined ? posx : 0.0;
+ this.posy = posy !== undefined ? posy : 0.0;
+ this.posz = posz !== undefined ? posz : 0.0;
+ this.foax = foax !== undefined ? foax : 0.0;
+ this.foay = foay !== undefined ? foay : 0.0;
+ this.foaz = foaz !== undefined ? foaz : 0.0;
+ this.roll = roll !== undefined ? roll : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::CameraDescription"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeString(this.shortDescription);
+ __os.writeString(this.streamingUri);
+ __os.writeFloat(this.fdistx);
+ __os.writeFloat(this.fdisty);
+ __os.writeFloat(this.u0);
+ __os.writeFloat(this.v0);
+ __os.writeFloat(this.skew);
+ __os.writeFloat(this.posx);
+ __os.writeFloat(this.posy);
+ __os.writeFloat(this.posz);
+ __os.writeFloat(this.foax);
+ __os.writeFloat(this.foay);
+ __os.writeFloat(this.foaz);
+ __os.writeFloat(this.roll);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.shortDescription = __is.readString();
+ this.streamingUri = __is.readString();
+ this.fdistx = __is.readFloat();
+ this.fdisty = __is.readFloat();
+ this.u0 = __is.readFloat();
+ this.v0 = __is.readFloat();
+ this.skew = __is.readFloat();
+ this.posx = __is.readFloat();
+ this.posy = __is.readFloat();
+ this.posz = __is.readFloat();
+ this.foax = __is.readFloat();
+ this.foay = __is.readFloat();
+ this.foaz = __is.readFloat();
+ this.roll = __is.readFloat();
+ },
+ false);
+
+ jderobot.CameraDescriptionPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.CameraDescription.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.CameraDescription, jderobot.CameraDescriptionPrx);
+
+ /**
+ * Camera interface
+ **/
+ jderobot.Camera = Slice.defineObject(
+ undefined,
+ Ice.Object,
+ [
+ jderobot.ImageProvider
+ ], 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Camera",
+ "::jderobot::ImageProvider"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.CameraPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Camera.ice_staticId, [
+ jderobot.ImageProviderPrx]);
+
+ Slice.defineOperations(jderobot.Camera, jderobot.CameraPrx,
+ {
+ "getCameraDescription": [, 2, 2, , , ["jderobot.CameraDescription", true], , , , , true],
+ "setCameraDescription": [, , , , , [3], [["jderobot.CameraDescription", true]], , , true, ],
+ "startCameraStreaming": [, , , , , [7], , , , , ],
+ "stopCameraStreaming": [, , , , , , , , , , ],
+ "reset": [, , , , , , , , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/cmdvel.js b/src/tools/3DViewer-web/public/js/jderobot/cmdvel.js
new file mode 100644
index 000000000..474e973ef
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/cmdvel.js
@@ -0,0 +1,89 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `cmdvel.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.CMDVelData = Slice.defineObject(
+ function(linearX, linearY, linearZ, angularX, angularY, angularZ)
+ {
+ Ice.Object.call(this);
+ this.linearX = linearX !== undefined ? linearX : 0.0;
+ this.linearY = linearY !== undefined ? linearY : 0.0;
+ this.linearZ = linearZ !== undefined ? linearZ : 0.0;
+ this.angularX = angularX !== undefined ? angularX : 0.0;
+ this.angularY = angularY !== undefined ? angularY : 0.0;
+ this.angularZ = angularZ !== undefined ? angularZ : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::CMDVelData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.linearX);
+ __os.writeFloat(this.linearY);
+ __os.writeFloat(this.linearZ);
+ __os.writeFloat(this.angularX);
+ __os.writeFloat(this.angularY);
+ __os.writeFloat(this.angularZ);
+ },
+ function(__is)
+ {
+ this.linearX = __is.readFloat();
+ this.linearY = __is.readFloat();
+ this.linearZ = __is.readFloat();
+ this.angularX = __is.readFloat();
+ this.angularY = __is.readFloat();
+ this.angularZ = __is.readFloat();
+ },
+ false);
+
+ jderobot.CMDVelDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.CMDVelData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.CMDVelData, jderobot.CMDVelDataPrx);
+
+ jderobot.CMDVel = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::CMDVel"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.CMDVelPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.CMDVel.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.CMDVel, jderobot.CMDVelPrx,
+ {
+ "setCMDVelData": [, , , , , [3], [["jderobot.CMDVelData", true]], , , true, ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/common.ice b/src/tools/3DViewer-web/public/js/jderobot/common.ice
new file mode 100644
index 000000000..61405b7ac
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/common.ice
@@ -0,0 +1,11 @@
+#ifndef COMMON_ICE
+#define COMMON_ICE
+
+#include
+#include
+#include
+
+module jderobot{
+}; /*module*/
+
+#endif /*COMMON_ICE*/
diff --git a/src/tools/3DViewer-web/public/js/jderobot/common.js b/src/tools/3DViewer-web/public/js/jderobot/common.js
new file mode 100644
index 000000000..de8e0cb35
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/common.js
@@ -0,0 +1,37 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `common.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = __M.require(module,
+ [
+ "datetime",
+ "exceptions",
+ "containers"
+ ]).jderobot;
+
+ var Slice = Ice.Slice;
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/containers.ice b/src/tools/3DViewer-web/public/js/jderobot/containers.ice
new file mode 100644
index 000000000..9a4d30a3a
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/containers.ice
@@ -0,0 +1,17 @@
+
+#ifndef CONTAINERS_ICE
+#define CONTAINERS_ICE
+
+module jderobot{
+
+ //! A sequence of bytes.
+ sequence ByteSeq;
+
+ //! A sequence of ints.
+ sequence IntSeq;
+
+ //! A sequence of floats
+ sequence seqFloat;
+}; /*module*/
+
+#endif /*CONTAINERS_ICE*/
diff --git a/src/tools/3DViewer-web/public/js/jderobot/containers.js b/src/tools/3DViewer-web/public/js/jderobot/containers.js
new file mode 100644
index 000000000..13e01e3cc
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/containers.js
@@ -0,0 +1,35 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `containers.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+ Slice.defineSequence(jderobot, "ByteSeqHelper", "Ice.ByteHelper", true);
+ Slice.defineSequence(jderobot, "IntSeqHelper", "Ice.IntHelper", true);
+ Slice.defineSequence(jderobot, "seqFloatHelper", "Ice.FloatHelper", true);
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/datetime.ice b/src/tools/3DViewer-web/public/js/jderobot/datetime.ice
new file mode 100644
index 000000000..830b5a8dc
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/datetime.ice
@@ -0,0 +1,15 @@
+#ifndef DATETIME_ICE
+#define DATETIME_ICE
+
+module jderobot{
+
+ struct Time
+ {
+ //! Number of seconds
+ long seconds;
+ //! Number of microseconds
+ long useconds;
+ };
+}; /*module*/
+
+#endif /*DATETIME_ICE*/
diff --git a/src/tools/3DViewer-web/public/js/jderobot/datetime.js b/src/tools/3DViewer-web/public/js/jderobot/datetime.js
new file mode 100644
index 000000000..b45108a44
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/datetime.js
@@ -0,0 +1,52 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `datetime.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.Time = Slice.defineStruct(
+ function(seconds, useconds)
+ {
+ this.seconds = seconds !== undefined ? seconds : new Ice.Long(0, 0);
+ this.useconds = useconds !== undefined ? useconds : new Ice.Long(0, 0);
+ },
+ true,
+ function(__os)
+ {
+ __os.writeLong(this.seconds);
+ __os.writeLong(this.useconds);
+ },
+ function(__is)
+ {
+ this.seconds = __is.readLong();
+ this.useconds = __is.readLong();
+ },
+ 16,
+ true);
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/emSensor.js b/src/tools/3DViewer-web/public/js/jderobot/emSensor.js
new file mode 100644
index 000000000..5664b269b
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/emSensor.js
@@ -0,0 +1,83 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `emSensor.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.State = Slice.defineEnum([
+ ['Error', 0], ['OutRange', 1], ['FarRange', 2], ['NearRange', 3], ['Close', 4]]);
+
+ jderobot.EMSensorData = Slice.defineObject(
+ function(status, d, tm)
+ {
+ Ice.Object.call(this);
+ this.status = status !== undefined ? status : jderobot.State.Error;
+ this.d = d !== undefined ? d : 0.0;
+ this.tm = tm !== undefined ? tm : new Ice.Long(0, 0);
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::EMSensorData"
+ ],
+ -1,
+ function(__os)
+ {
+ jderobot.State.__write(__os, this.status);
+ __os.writeFloat(this.d);
+ __os.writeLong(this.tm);
+ },
+ function(__is)
+ {
+ this.status = jderobot.State.__read(__is);
+ this.d = __is.readFloat();
+ this.tm = __is.readLong();
+ },
+ false);
+
+ jderobot.EMSensorDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.EMSensorData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.EMSensorData, jderobot.EMSensorDataPrx);
+
+ jderobot.EMSensor = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::EMSensor"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.EMSensorPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.EMSensor.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.EMSensor, jderobot.EMSensorPrx,
+ {
+ "getEMSensorData": [, 2, 2, , , ["jderobot.EMSensorData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/encoders.js b/src/tools/3DViewer-web/public/js/jderobot/encoders.js
new file mode 100644
index 000000000..af7f98522
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/encoders.js
@@ -0,0 +1,88 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `encoders.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.EncodersData = Slice.defineObject(
+ function(robotx, roboty, robottheta, robotcos, robotsin)
+ {
+ Ice.Object.call(this);
+ this.robotx = robotx !== undefined ? robotx : 0.0;
+ this.roboty = roboty !== undefined ? roboty : 0.0;
+ this.robottheta = robottheta !== undefined ? robottheta : 0.0;
+ this.robotcos = robotcos !== undefined ? robotcos : 0.0;
+ this.robotsin = robotsin !== undefined ? robotsin : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::EncodersData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.robotx);
+ __os.writeFloat(this.roboty);
+ __os.writeFloat(this.robottheta);
+ __os.writeFloat(this.robotcos);
+ __os.writeFloat(this.robotsin);
+ },
+ function(__is)
+ {
+ this.robotx = __is.readFloat();
+ this.roboty = __is.readFloat();
+ this.robottheta = __is.readFloat();
+ this.robotcos = __is.readFloat();
+ this.robotsin = __is.readFloat();
+ },
+ false);
+
+ jderobot.EncodersDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.EncodersData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.EncodersData, jderobot.EncodersDataPrx);
+
+ /**
+ * Interface to the Gazebo encoders sensor.
+ **/
+ jderobot.Encoders = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Encoders"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.EncodersPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Encoders.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Encoders, jderobot.EncodersPrx,
+ {
+ "getEncodersData": [, 2, 2, , , ["jderobot.EncodersData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/exceptions.ice b/src/tools/3DViewer-web/public/js/jderobot/exceptions.ice
new file mode 100644
index 000000000..3ed988a1b
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/exceptions.ice
@@ -0,0 +1,36 @@
+#ifndef EXCEPTIONS_ICE
+#define EXCEPTIONS_ICE
+
+module jderobot{
+
+ exception JderobotException
+ {
+ //! Error description.
+ string what;
+ };
+
+ //! Server failed to configure itself as requrested by client.
+ exception ConfigurationNotExistException extends JderobotException {};
+
+ /*!
+ Raised when the server does not have the requested data.
+
+ Typically, this is because the server has not fully initialized yet.
+ */
+ exception DataNotExistException extends JderobotException {};
+
+ //! Indicates a problem with robot hardware, e.g. sensors and actuators.
+ exception HardwareFailedException extends JderobotException {};
+
+ //! Raised when the server is unable to return a topic for subscription.
+ exception NoTopicException extends JderobotException {};
+
+ //! Raised when the server fails to subscribe client for periodic updates.
+ exception SubscriptionFailedException extends JderobotException {};
+
+ //! Raised when the server fails to push initial data to a new subscriber.
+ exception SubscriptionPushFailedException extends JderobotException {};
+
+}; /*module*/
+
+#endif /*EXCEPTIONS_ICE*/
diff --git a/src/tools/3DViewer-web/public/js/jderobot/exceptions.js b/src/tools/3DViewer-web/public/js/jderobot/exceptions.js
new file mode 100644
index 000000000..eeb4b2c4c
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/exceptions.js
@@ -0,0 +1,117 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `exceptions.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.JderobotException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ Ice.UserException.call(this, _cause);
+ this.what = what !== undefined ? what : "";
+ },
+ Ice.UserException,
+ "jderobot::JderobotException",
+ function(__os)
+ {
+ __os.writeString(this.what);
+ },
+ function(__is)
+ {
+ this.what = __is.readString();
+ },
+ false,
+ false);
+
+ jderobot.ConfigurationNotExistException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::ConfigurationNotExistException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.DataNotExistException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::DataNotExistException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.HardwareFailedException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::HardwareFailedException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.NoTopicException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::NoTopicException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.SubscriptionFailedException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::SubscriptionFailedException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.SubscriptionPushFailedException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::SubscriptionPushFailedException",
+ undefined, undefined,
+ false,
+ false);
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/genericData.js b/src/tools/3DViewer-web/public/js/jderobot/genericData.js
new file mode 100644
index 000000000..9833548e6
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/genericData.js
@@ -0,0 +1,82 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `genericData.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * Static description of the image source.
+ **/
+ jderobot.GenericData = Slice.defineObject(
+ function(name, format, data)
+ {
+ Ice.Object.call(this);
+ this.name = name !== undefined ? name : "";
+ this.format = format !== undefined ? format : "";
+ this.data = data !== undefined ? data : null;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::GenericData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeString(this.format);
+ jderobot.ByteSeqHelper.write(__os, this.data);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.format = __is.readString();
+ this.data = jderobot.ByteSeqHelper.read(__is);
+ },
+ false);
+
+ jderobot.GenericDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.GenericData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.GenericData, jderobot.GenericDataPrx);
+
+ jderobot.genericDataProvider = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::genericDataProvider"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.genericDataProviderPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.genericDataProvider.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.genericDataProvider, jderobot.genericDataProviderPrx,
+ {
+ "getGenericData": [, 2, 2, , , ["jderobot.GenericData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/image.js b/src/tools/3DViewer-web/public/js/jderobot/image.js
new file mode 100644
index 000000000..65c47d805
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/image.js
@@ -0,0 +1,150 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `image.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * Static description of the image source.
+ **/
+ jderobot.ImageDescription = Slice.defineObject(
+ function(width, height, size, format, md5sum)
+ {
+ Ice.Object.call(this);
+ this.width = width !== undefined ? width : 0;
+ this.height = height !== undefined ? height : 0;
+ this.size = size !== undefined ? size : 0;
+ this.format = format !== undefined ? format : "";
+ this.md5sum = md5sum !== undefined ? md5sum : "";
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::ImageDescription"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeInt(this.width);
+ __os.writeInt(this.height);
+ __os.writeInt(this.size);
+ __os.writeString(this.format);
+ __os.writeString(this.md5sum);
+ },
+ function(__is)
+ {
+ this.width = __is.readInt();
+ this.height = __is.readInt();
+ this.size = __is.readInt();
+ this.format = __is.readString();
+ this.md5sum = __is.readString();
+ },
+ false);
+
+ jderobot.ImageDescriptionPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.ImageDescription.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.ImageDescription, jderobot.ImageDescriptionPrx);
+
+ /**
+ * A single image served as a sequence of bytes
+ **/
+ jderobot.ImageData = Slice.defineObject(
+ function(timeStamp, description, pixelData)
+ {
+ Ice.Object.call(this);
+ this.timeStamp = timeStamp !== undefined ? timeStamp : new jderobot.Time();
+ this.description = description !== undefined ? description : null;
+ this.pixelData = pixelData !== undefined ? pixelData : null;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::ImageData"
+ ],
+ -1,
+ function(__os)
+ {
+ jderobot.Time.write(__os, this.timeStamp);
+ __os.writeObject(this.description);
+ jderobot.ByteSeqHelper.write(__os, this.pixelData);
+ },
+ function(__is)
+ {
+ var self = this;
+ this.timeStamp = jderobot.Time.read(__is, this.timeStamp);
+ __is.readObject(function(__o){ self.description = __o; }, jderobot.ImageDescription);
+ this.pixelData = jderobot.ByteSeqHelper.read(__is);
+ },
+ false);
+
+ jderobot.ImageDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.ImageData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.ImageData, jderobot.ImageDataPrx);
+
+ jderobot.ImageConsumer = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::ImageConsumer"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.ImageConsumerPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.ImageConsumer.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.ImageConsumer, jderobot.ImageConsumerPrx,
+ {
+ "report": [, , , , , , [["jderobot.ImageData", true]], , , true, ]
+ });
+ Slice.defineSequence(jderobot, "ImageFormatHelper", "Ice.StringHelper", false);
+
+ /**
+ * Interface to the image provider.
+ **/
+ jderobot.ImageProvider = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::ImageProvider"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.ImageProviderPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.ImageProvider.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.ImageProvider, jderobot.ImageProviderPrx,
+ {
+ "getImageDescription": [, 2, 2, , , ["jderobot.ImageDescription", true], , , , , true],
+ "getImageFormat": [, 2, 2, , , ["jderobot.ImageFormatHelper"], , , , , ],
+ "getImageData": [, 2, 2, 1, , ["jderobot.ImageData", true], [[7]], ,
+ [
+ jderobot.DataNotExistException,
+ jderobot.HardwareFailedException
+ ], , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/jcm.js b/src/tools/3DViewer-web/public/js/jderobot/jcm.js
new file mode 100644
index 000000000..55bd1eefc
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/jcm.js
@@ -0,0 +1,186 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `jcm.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.FQExecutableName = Slice.defineStruct(
+ function(executable, host)
+ {
+ this.executable = executable !== undefined ? executable : "";
+ this.host = host !== undefined ? host : "";
+ },
+ true,
+ function(__os)
+ {
+ __os.writeString(this.executable);
+ __os.writeString(this.host);
+ },
+ function(__is)
+ {
+ this.executable = __is.readString();
+ this.host = __is.readString();
+ },
+ 2,
+ false);
+
+ jderobot.FQComponentName = Slice.defineStruct(
+ function(platform, component)
+ {
+ this.platform = platform !== undefined ? platform : "";
+ this.component = component !== undefined ? component : "";
+ },
+ true,
+ function(__os)
+ {
+ __os.writeString(this.platform);
+ __os.writeString(this.component);
+ },
+ function(__is)
+ {
+ this.platform = __is.readString();
+ this.component = __is.readString();
+ },
+ 2,
+ false);
+
+ jderobot.FQInterfaceName = Slice.defineStruct(
+ function(platform, component, iface)
+ {
+ this.platform = platform !== undefined ? platform : "";
+ this.component = component !== undefined ? component : "";
+ this.iface = iface !== undefined ? iface : "";
+ },
+ true,
+ function(__os)
+ {
+ __os.writeString(this.platform);
+ __os.writeString(this.component);
+ __os.writeString(this.iface);
+ },
+ function(__is)
+ {
+ this.platform = __is.readString();
+ this.component = __is.readString();
+ this.iface = __is.readString();
+ },
+ 3,
+ false);
+
+ jderobot.FQTopicName = Slice.defineStruct(
+ function(platform, component, iface, topic)
+ {
+ this.platform = platform !== undefined ? platform : "";
+ this.component = component !== undefined ? component : "";
+ this.iface = iface !== undefined ? iface : "";
+ this.topic = topic !== undefined ? topic : "";
+ },
+ true,
+ function(__os)
+ {
+ __os.writeString(this.platform);
+ __os.writeString(this.component);
+ __os.writeString(this.iface);
+ __os.writeString(this.topic);
+ },
+ function(__is)
+ {
+ this.platform = __is.readString();
+ this.component = __is.readString();
+ this.iface = __is.readString();
+ this.topic = __is.readString();
+ },
+ 4,
+ false);
+
+ jderobot.ProvidedInterface = Slice.defineStruct(
+ function(name, id)
+ {
+ this.name = name !== undefined ? name : "";
+ this.id = id !== undefined ? id : "";
+ },
+ true,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeString(this.id);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.id = __is.readString();
+ },
+ 2,
+ false);
+
+ jderobot.RequiredInterface = Slice.defineStruct(
+ function(name, id)
+ {
+ this.name = name !== undefined ? name : new jderobot.FQInterfaceName();
+ this.id = id !== undefined ? id : "";
+ },
+ true,
+ function(__os)
+ {
+ jderobot.FQInterfaceName.write(__os, this.name);
+ __os.writeString(this.id);
+ },
+ function(__is)
+ {
+ this.name = jderobot.FQInterfaceName.read(__is, this.name);
+ this.id = __is.readString();
+ },
+ 4,
+ false);
+ Slice.defineSequence(jderobot, "ProvidesInterfacesHelper", "jderobot.ProvidedInterface", false);
+ Slice.defineSequence(jderobot, "RequiresInterfacesHelper", "jderobot.RequiredInterface", false);
+
+ jderobot.ComponentData = Slice.defineStruct(
+ function(name, provides, requires)
+ {
+ this.name = name !== undefined ? name : new jderobot.FQComponentName();
+ this.provides = provides !== undefined ? provides : null;
+ this.requires = requires !== undefined ? requires : null;
+ },
+ true,
+ function(__os)
+ {
+ jderobot.FQComponentName.write(__os, this.name);
+ jderobot.ProvidesInterfacesHelper.write(__os, this.provides);
+ jderobot.RequiresInterfacesHelper.write(__os, this.requires);
+ },
+ function(__is)
+ {
+ this.name = jderobot.FQComponentName.read(__is, this.name);
+ this.provides = jderobot.ProvidesInterfacesHelper.read(__is);
+ this.requires = jderobot.RequiresInterfacesHelper.read(__is);
+ },
+ 4,
+ false);
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/jointmotor.js b/src/tools/3DViewer-web/public/js/jderobot/jointmotor.js
new file mode 100644
index 000000000..178365107
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/jointmotor.js
@@ -0,0 +1,286 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `jointmotor.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var RoboCompJointMotor = __M.module("RoboCompJointMotor");
+
+ RoboCompJointMotor.HardwareFailedException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ Ice.UserException.call(this, _cause);
+ this.what = what !== undefined ? what : "";
+ },
+ Ice.UserException,
+ "RoboCompJointMotor::HardwareFailedException",
+ function(__os)
+ {
+ __os.writeString(this.what);
+ },
+ function(__is)
+ {
+ this.what = __is.readString();
+ },
+ false,
+ false);
+
+ RoboCompJointMotor.OutOfRangeException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ Ice.UserException.call(this, _cause);
+ this.what = what !== undefined ? what : "";
+ },
+ Ice.UserException,
+ "RoboCompJointMotor::OutOfRangeException",
+ function(__os)
+ {
+ __os.writeString(this.what);
+ },
+ function(__is)
+ {
+ this.what = __is.readString();
+ },
+ false,
+ false);
+
+ RoboCompJointMotor.UnknownMotorException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ Ice.UserException.call(this, _cause);
+ this.what = what !== undefined ? what : "";
+ },
+ Ice.UserException,
+ "RoboCompJointMotor::UnknownMotorException",
+ function(__os)
+ {
+ __os.writeString(this.what);
+ },
+ function(__is)
+ {
+ this.what = __is.readString();
+ },
+ false,
+ false);
+
+ RoboCompJointMotor.MotorState = Slice.defineStruct(
+ function(pos, vel, power, timeStamp, p, v, isMoving)
+ {
+ this.pos = pos !== undefined ? pos : 0.0;
+ this.vel = vel !== undefined ? vel : 0.0;
+ this.power = power !== undefined ? power : 0.0;
+ this.timeStamp = timeStamp !== undefined ? timeStamp : "";
+ this.p = p !== undefined ? p : 0;
+ this.v = v !== undefined ? v : 0;
+ this.isMoving = isMoving !== undefined ? isMoving : false;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeFloat(this.pos);
+ __os.writeFloat(this.vel);
+ __os.writeFloat(this.power);
+ __os.writeString(this.timeStamp);
+ __os.writeInt(this.p);
+ __os.writeInt(this.v);
+ __os.writeBool(this.isMoving);
+ },
+ function(__is)
+ {
+ this.pos = __is.readFloat();
+ this.vel = __is.readFloat();
+ this.power = __is.readFloat();
+ this.timeStamp = __is.readString();
+ this.p = __is.readInt();
+ this.v = __is.readInt();
+ this.isMoving = __is.readBool();
+ },
+ 22,
+ false);
+ Slice.defineDictionary(RoboCompJointMotor, "MotorStateMap", "MotorStateMapHelper", "Ice.StringHelper", "RoboCompJointMotor.MotorState", false, undefined, undefined, Ice.HashMap.compareEquals);
+
+ RoboCompJointMotor.MotorParams = Slice.defineStruct(
+ function(name, busId, minPos, maxPos, maxVelocity, zeroPos, invertedSign)
+ {
+ this.name = name !== undefined ? name : "";
+ this.busId = busId !== undefined ? busId : 0;
+ this.minPos = minPos !== undefined ? minPos : 0.0;
+ this.maxPos = maxPos !== undefined ? maxPos : 0.0;
+ this.maxVelocity = maxVelocity !== undefined ? maxVelocity : 0.0;
+ this.zeroPos = zeroPos !== undefined ? zeroPos : 0.0;
+ this.invertedSign = invertedSign !== undefined ? invertedSign : false;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeByte(this.busId);
+ __os.writeFloat(this.minPos);
+ __os.writeFloat(this.maxPos);
+ __os.writeFloat(this.maxVelocity);
+ __os.writeFloat(this.zeroPos);
+ __os.writeBool(this.invertedSign);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.busId = __is.readByte();
+ this.minPos = __is.readFloat();
+ this.maxPos = __is.readFloat();
+ this.maxVelocity = __is.readFloat();
+ this.zeroPos = __is.readFloat();
+ this.invertedSign = __is.readBool();
+ },
+ 19,
+ false);
+ Slice.defineSequence(RoboCompJointMotor, "MotorParamsListHelper", "RoboCompJointMotor.MotorParams", false);
+
+ RoboCompJointMotor.BusParams = Slice.defineStruct(
+ function(handler, device, numMotors, baudRate, basicPeriod)
+ {
+ this.handler = handler !== undefined ? handler : "";
+ this.device = device !== undefined ? device : "";
+ this.numMotors = numMotors !== undefined ? numMotors : 0;
+ this.baudRate = baudRate !== undefined ? baudRate : 0;
+ this.basicPeriod = basicPeriod !== undefined ? basicPeriod : 0;
+ },
+ true,
+ function(__os)
+ {
+ __os.writeString(this.handler);
+ __os.writeString(this.device);
+ __os.writeInt(this.numMotors);
+ __os.writeInt(this.baudRate);
+ __os.writeInt(this.basicPeriod);
+ },
+ function(__is)
+ {
+ this.handler = __is.readString();
+ this.device = __is.readString();
+ this.numMotors = __is.readInt();
+ this.baudRate = __is.readInt();
+ this.basicPeriod = __is.readInt();
+ },
+ 14,
+ false);
+
+ RoboCompJointMotor.MotorGoalPosition = Slice.defineStruct(
+ function(name, position, maxSpeed)
+ {
+ this.name = name !== undefined ? name : "";
+ this.position = position !== undefined ? position : 0.0;
+ this.maxSpeed = maxSpeed !== undefined ? maxSpeed : 0.0;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeFloat(this.position);
+ __os.writeFloat(this.maxSpeed);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.position = __is.readFloat();
+ this.maxSpeed = __is.readFloat();
+ },
+ 9,
+ false);
+ Slice.defineSequence(RoboCompJointMotor, "MotorGoalPositionListHelper", "RoboCompJointMotor.MotorGoalPosition", false);
+
+ RoboCompJointMotor.MotorGoalVelocity = Slice.defineStruct(
+ function(name, velocity, maxAcc)
+ {
+ this.name = name !== undefined ? name : "";
+ this.velocity = velocity !== undefined ? velocity : 0.0;
+ this.maxAcc = maxAcc !== undefined ? maxAcc : 0.0;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeFloat(this.velocity);
+ __os.writeFloat(this.maxAcc);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.velocity = __is.readFloat();
+ this.maxAcc = __is.readFloat();
+ },
+ 9,
+ false);
+ Slice.defineSequence(RoboCompJointMotor, "MotorListHelper", "Ice.StringHelper", false);
+
+ RoboCompJointMotor.JointMotor = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::RoboCompJointMotor::JointMotor"
+ ],
+ -1, undefined, undefined, false);
+
+ RoboCompJointMotor.JointMotorPrx = Slice.defineProxy(Ice.ObjectPrx, RoboCompJointMotor.JointMotor.ice_staticId, undefined);
+
+ Slice.defineOperations(RoboCompJointMotor.JointMotor, RoboCompJointMotor.JointMotorPrx,
+ {
+ "setPosition": [, , , , , , [[RoboCompJointMotor.MotorGoalPosition]], ,
+ [
+ RoboCompJointMotor.HardwareFailedException,
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "setVelocity": [, , , , , , [[RoboCompJointMotor.MotorGoalVelocity]], ,
+ [
+ RoboCompJointMotor.HardwareFailedException,
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "setSyncPosition": [, , , , , , [["RoboCompJointMotor.MotorGoalPositionListHelper"]], ,
+ [
+ RoboCompJointMotor.HardwareFailedException,
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "getMotorParams": [, , , , , [RoboCompJointMotor.MotorParams], [[7]], ,
+ [
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "getMotorState": [, , , , , [RoboCompJointMotor.MotorState], [[7]], ,
+ [
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "getMotorStateMap": [, , , , , ["RoboCompJointMotor.MotorStateMapHelper"], [["RoboCompJointMotor.MotorListHelper"]], ,
+ [
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "getAllMotorState": [, , , , , , , [["RoboCompJointMotor.MotorStateMapHelper"]],
+ [
+ RoboCompJointMotor.UnknownMotorException
+ ], , ],
+ "getAllMotorParams": [, , , , , ["RoboCompJointMotor.MotorParamsListHelper"], , , , , ],
+ "getBusParams": [, , , , , [RoboCompJointMotor.BusParams], , , , , ]
+ });
+ exports.RoboCompJointMotor = RoboCompJointMotor;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/kinectleds.js b/src/tools/3DViewer-web/public/js/jderobot/kinectleds.js
new file mode 100644
index 000000000..9824b6997
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/kinectleds.js
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `kinectleds.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.KinectLedsAvailable = Slice.defineEnum([
+ ['OFF', 0], ['GREEN', 1], ['RED', 2], ['YELLOW', 3], ['BLINKGREEN', 4],
+ ['BLINKYELLOW', 5], ['BLINKRED', 6]]);
+
+ /**
+ * Interface to the Kinect LEDS.
+ **/
+ jderobot.KinectLeds = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::KinectLeds"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.KinectLedsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.KinectLeds.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.KinectLeds, jderobot.KinectLedsPrx,
+ {
+ "setLedActive": [, , , , , , [[jderobot.KinectLedsAvailable.__helper]], , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/laser.js b/src/tools/3DViewer-web/public/js/jderobot/laser.js
new file mode 100644
index 000000000..debe02b8d
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/laser.js
@@ -0,0 +1,94 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `laser.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.LaserData = Slice.defineObject(
+ function(distanceData, numLaser, minAngle, maxAngle, minRange, maxRange, timeStamp)
+ {
+ Ice.Object.call(this);
+ this.distanceData = distanceData !== undefined ? distanceData : null;
+ this.numLaser = numLaser !== undefined ? numLaser : 0;
+ this.minAngle = minAngle !== undefined ? minAngle : 0.0;
+ this.maxAngle = maxAngle !== undefined ? maxAngle : 0.0;
+ this.minRange = minRange !== undefined ? minRange : 0.0;
+ this.maxRange = maxRange !== undefined ? maxRange : 0.0;
+ this.timeStamp = timeStamp !== undefined ? timeStamp : new jderobot.Time();
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::LaserData"
+ ],
+ -1,
+ function(__os)
+ {
+ jderobot.IntSeqHelper.write(__os, this.distanceData);
+ __os.writeInt(this.numLaser);
+ __os.writeFloat(this.minAngle);
+ __os.writeFloat(this.maxAngle);
+ __os.writeFloat(this.minRange);
+ __os.writeFloat(this.maxRange);
+ jderobot.Time.write(__os, this.timeStamp);
+ },
+ function(__is)
+ {
+ this.distanceData = jderobot.IntSeqHelper.read(__is);
+ this.numLaser = __is.readInt();
+ this.minAngle = __is.readFloat();
+ this.maxAngle = __is.readFloat();
+ this.minRange = __is.readFloat();
+ this.maxRange = __is.readFloat();
+ this.timeStamp = jderobot.Time.read(__is, this.timeStamp);
+ },
+ false);
+
+ jderobot.LaserDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.LaserData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.LaserData, jderobot.LaserDataPrx);
+
+ /**
+ * Interface to the Gazebo laser sensor.
+ **/
+ jderobot.Laser = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Laser"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.LaserPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Laser.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Laser, jderobot.LaserPrx,
+ {
+ "getLaserData": [, 2, 2, , , ["jderobot.LaserData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/motors.js b/src/tools/3DViewer-web/public/js/jderobot/motors.js
new file mode 100644
index 000000000..4717f16ec
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/motors.js
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `motors.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * Interface to the Gazebo Motors Actuators interaction.
+ **/
+ jderobot.Motors = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Motors"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.MotorsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Motors.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Motors, jderobot.MotorsPrx,
+ {
+ "getV": [, , , , , [5], , , , , ],
+ "setV": [, , , , , [3], [[5]], , , , ],
+ "getW": [, , , , , [5], , , , , ],
+ "setW": [, , , , , [3], [[5]], , , , ],
+ "getL": [, , , , , [5], , , , , ],
+ "setL": [, , , , , [3], [[5]], , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/namingService.js b/src/tools/3DViewer-web/public/js/jderobot/namingService.js
new file mode 100644
index 000000000..d766ee72f
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/namingService.js
@@ -0,0 +1,161 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `namingService.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.NameAlreadyExistException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::NameAlreadyExistException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.NameNotExistException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::NameNotExistException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.InterfaceNotExistException = Slice.defineUserException(
+ function(what, _cause)
+ {
+ jderobot.JderobotException.call(this, what, _cause);
+ },
+ jderobot.JderobotException,
+ "jderobot::InterfaceNotExistException",
+ undefined, undefined,
+ false,
+ false);
+
+ jderobot.NamingNode = Slice.defineObject(
+ function(name, interfaceName, protocol, ip, port)
+ {
+ Ice.Object.call(this);
+ this.name = name !== undefined ? name : "";
+ this.interfaceName = interfaceName !== undefined ? interfaceName : "";
+ this.protocol = protocol !== undefined ? protocol : "";
+ this.ip = ip !== undefined ? ip : "";
+ this.port = port !== undefined ? port : 0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::NamingNode"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeString(this.name);
+ __os.writeString(this.interfaceName);
+ __os.writeString(this.protocol);
+ __os.writeString(this.ip);
+ __os.writeInt(this.port);
+ },
+ function(__is)
+ {
+ this.name = __is.readString();
+ this.interfaceName = __is.readString();
+ this.protocol = __is.readString();
+ this.ip = __is.readString();
+ this.port = __is.readInt();
+ },
+ false);
+
+ jderobot.NamingNodePrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.NamingNode.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.NamingNode, jderobot.NamingNodePrx);
+ Slice.defineSequence(jderobot, "nodeListHelper", "Ice.ObjectHelper", false, "jderobot.NamingNode");
+
+ jderobot.NodeContainer = Slice.defineObject(
+ function(nodes)
+ {
+ Ice.Object.call(this);
+ this.nodes = nodes !== undefined ? nodes : null;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::NodeContainer"
+ ],
+ -1,
+ function(__os)
+ {
+ jderobot.nodeListHelper.write(__os, this.nodes);
+ },
+ function(__is)
+ {
+ this.nodes = jderobot.nodeListHelper.read(__is);
+ },
+ false);
+
+ jderobot.NodeContainerPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.NodeContainer.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.NodeContainer, jderobot.NodeContainerPrx);
+
+ jderobot.NamingService = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::NamingService"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.NamingServicePrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.NamingService.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.NamingService, jderobot.NamingServicePrx,
+ {
+ "bind": [, , , , , , [["jderobot.NamingNode", true]], ,
+ [
+ jderobot.NameAlreadyExistException
+ ], true, ],
+ "unbind": [, , , , , , [["jderobot.NamingNode", true]], ,
+ [
+ jderobot.NameAlreadyExistException,
+ jderobot.NameNotExistException
+ ], true, ],
+ "resolveByName": [, 2, 2, , , ["jderobot.NodeContainer", true], [[7]], ,
+ [
+ jderobot.NameNotExistException
+ ], , true],
+ "resolveByInterface": [, 2, 2, , , ["jderobot.NodeContainer", true], [[7]], ,
+ [
+ jderobot.InterfaceNotExistException
+ ], , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/navdata.js b/src/tools/3DViewer-web/public/js/jderobot/navdata.js
new file mode 100644
index 000000000..e058d6c77
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/navdata.js
@@ -0,0 +1,163 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `navdata.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+ Slice.defineSequence(jderobot, "arrayIntHelper", "Ice.IntHelper", true);
+ Slice.defineSequence(jderobot, "arrayFloatHelper", "Ice.FloatHelper", true);
+
+ jderobot.NavdataData = Slice.defineObject(
+ function(vehicle, state, batteryPercent, magX, magY, magZ, pressure, temp, windSpeed, windAngle, windCompAngle, rotX, rotY, rotZ, altd, vx, vy, vz, ax, ay, az, tagsCount, tagsType, tagsXc, tagsYc, tagsWidth, tagsHeight, tagsOrientation, tagsDistance, tm)
+ {
+ Ice.Object.call(this);
+ this.vehicle = vehicle !== undefined ? vehicle : 0;
+ this.state = state !== undefined ? state : 0;
+ this.batteryPercent = batteryPercent !== undefined ? batteryPercent : 0.0;
+ this.magX = magX !== undefined ? magX : 0;
+ this.magY = magY !== undefined ? magY : 0;
+ this.magZ = magZ !== undefined ? magZ : 0;
+ this.pressure = pressure !== undefined ? pressure : 0;
+ this.temp = temp !== undefined ? temp : 0;
+ this.windSpeed = windSpeed !== undefined ? windSpeed : 0.0;
+ this.windAngle = windAngle !== undefined ? windAngle : 0.0;
+ this.windCompAngle = windCompAngle !== undefined ? windCompAngle : 0.0;
+ this.rotX = rotX !== undefined ? rotX : 0.0;
+ this.rotY = rotY !== undefined ? rotY : 0.0;
+ this.rotZ = rotZ !== undefined ? rotZ : 0.0;
+ this.altd = altd !== undefined ? altd : 0;
+ this.vx = vx !== undefined ? vx : 0.0;
+ this.vy = vy !== undefined ? vy : 0.0;
+ this.vz = vz !== undefined ? vz : 0.0;
+ this.ax = ax !== undefined ? ax : 0.0;
+ this.ay = ay !== undefined ? ay : 0.0;
+ this.az = az !== undefined ? az : 0.0;
+ this.tagsCount = tagsCount !== undefined ? tagsCount : 0;
+ this.tagsType = tagsType !== undefined ? tagsType : null;
+ this.tagsXc = tagsXc !== undefined ? tagsXc : null;
+ this.tagsYc = tagsYc !== undefined ? tagsYc : null;
+ this.tagsWidth = tagsWidth !== undefined ? tagsWidth : null;
+ this.tagsHeight = tagsHeight !== undefined ? tagsHeight : null;
+ this.tagsOrientation = tagsOrientation !== undefined ? tagsOrientation : null;
+ this.tagsDistance = tagsDistance !== undefined ? tagsDistance : null;
+ this.tm = tm !== undefined ? tm : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::NavdataData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeInt(this.vehicle);
+ __os.writeInt(this.state);
+ __os.writeFloat(this.batteryPercent);
+ __os.writeInt(this.magX);
+ __os.writeInt(this.magY);
+ __os.writeInt(this.magZ);
+ __os.writeInt(this.pressure);
+ __os.writeInt(this.temp);
+ __os.writeFloat(this.windSpeed);
+ __os.writeFloat(this.windAngle);
+ __os.writeFloat(this.windCompAngle);
+ __os.writeFloat(this.rotX);
+ __os.writeFloat(this.rotY);
+ __os.writeFloat(this.rotZ);
+ __os.writeInt(this.altd);
+ __os.writeFloat(this.vx);
+ __os.writeFloat(this.vy);
+ __os.writeFloat(this.vz);
+ __os.writeFloat(this.ax);
+ __os.writeFloat(this.ay);
+ __os.writeFloat(this.az);
+ __os.writeInt(this.tagsCount);
+ jderobot.arrayIntHelper.write(__os, this.tagsType);
+ jderobot.arrayIntHelper.write(__os, this.tagsXc);
+ jderobot.arrayIntHelper.write(__os, this.tagsYc);
+ jderobot.arrayIntHelper.write(__os, this.tagsWidth);
+ jderobot.arrayIntHelper.write(__os, this.tagsHeight);
+ jderobot.arrayFloatHelper.write(__os, this.tagsOrientation);
+ jderobot.arrayFloatHelper.write(__os, this.tagsDistance);
+ __os.writeFloat(this.tm);
+ },
+ function(__is)
+ {
+ this.vehicle = __is.readInt();
+ this.state = __is.readInt();
+ this.batteryPercent = __is.readFloat();
+ this.magX = __is.readInt();
+ this.magY = __is.readInt();
+ this.magZ = __is.readInt();
+ this.pressure = __is.readInt();
+ this.temp = __is.readInt();
+ this.windSpeed = __is.readFloat();
+ this.windAngle = __is.readFloat();
+ this.windCompAngle = __is.readFloat();
+ this.rotX = __is.readFloat();
+ this.rotY = __is.readFloat();
+ this.rotZ = __is.readFloat();
+ this.altd = __is.readInt();
+ this.vx = __is.readFloat();
+ this.vy = __is.readFloat();
+ this.vz = __is.readFloat();
+ this.ax = __is.readFloat();
+ this.ay = __is.readFloat();
+ this.az = __is.readFloat();
+ this.tagsCount = __is.readInt();
+ this.tagsType = jderobot.arrayIntHelper.read(__is);
+ this.tagsXc = jderobot.arrayIntHelper.read(__is);
+ this.tagsYc = jderobot.arrayIntHelper.read(__is);
+ this.tagsWidth = jderobot.arrayIntHelper.read(__is);
+ this.tagsHeight = jderobot.arrayIntHelper.read(__is);
+ this.tagsOrientation = jderobot.arrayFloatHelper.read(__is);
+ this.tagsDistance = jderobot.arrayFloatHelper.read(__is);
+ this.tm = __is.readFloat();
+ },
+ false);
+
+ jderobot.NavdataDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.NavdataData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.NavdataData, jderobot.NavdataDataPrx);
+
+ jderobot.Navdata = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Navdata"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.NavdataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Navdata.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Navdata, jderobot.NavdataPrx,
+ {
+ "getNavdata": [, 2, 2, , , ["jderobot.NavdataData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/pointcloud.js b/src/tools/3DViewer-web/public/js/jderobot/pointcloud.js
new file mode 100644
index 000000000..a5d4d86d2
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/pointcloud.js
@@ -0,0 +1,74 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `pointcloud.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("primitives").jderobot;
+ var Slice = Ice.Slice;
+ Slice.defineSequence(jderobot, "RGBPointsPCLHelper", "jderobot.RGBPoint", true);
+
+ jderobot.pointCloudData = Slice.defineObject(
+ function(p)
+ {
+ Ice.Object.call(this);
+ this.p = p !== undefined ? p : null;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::pointCloudData"
+ ],
+ -1,
+ function(__os)
+ {
+ jderobot.RGBPointsPCLHelper.write(__os, this.p);
+ },
+ function(__is)
+ {
+ this.p = jderobot.RGBPointsPCLHelper.read(__is);
+ },
+ false);
+
+ jderobot.pointCloudDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.pointCloudData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.pointCloudData, jderobot.pointCloudDataPrx);
+
+ jderobot.pointCloud = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::pointCloud"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.pointCloudPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.pointCloud.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.pointCloud, jderobot.pointCloudPrx,
+ {
+ "getCloudData": [, 2, 2, , , ["jderobot.pointCloudData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/pose3d.js b/src/tools/3DViewer-web/public/js/jderobot/pose3d.js
new file mode 100644
index 000000000..b381d52f5
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/pose3d.js
@@ -0,0 +1,101 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `pose3d.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * Pose3D data information
+ **/
+ jderobot.Pose3DData = Slice.defineObject(
+ function(x, y, z, h, q0, q1, q2, q3)
+ {
+ Ice.Object.call(this);
+ this.x = x !== undefined ? x : 0.0;
+ this.y = y !== undefined ? y : 0.0;
+ this.z = z !== undefined ? z : 0.0;
+ this.h = h !== undefined ? h : 0.0;
+ this.q0 = q0 !== undefined ? q0 : 0.0;
+ this.q1 = q1 !== undefined ? q1 : 0.0;
+ this.q2 = q2 !== undefined ? q2 : 0.0;
+ this.q3 = q3 !== undefined ? q3 : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3DData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.x);
+ __os.writeFloat(this.y);
+ __os.writeFloat(this.z);
+ __os.writeFloat(this.h);
+ __os.writeFloat(this.q0);
+ __os.writeFloat(this.q1);
+ __os.writeFloat(this.q2);
+ __os.writeFloat(this.q3);
+ },
+ function(__is)
+ {
+ this.x = __is.readFloat();
+ this.y = __is.readFloat();
+ this.z = __is.readFloat();
+ this.h = __is.readFloat();
+ this.q0 = __is.readFloat();
+ this.q1 = __is.readFloat();
+ this.q2 = __is.readFloat();
+ this.q3 = __is.readFloat();
+ },
+ false);
+
+ jderobot.Pose3DDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3DData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3DData, jderobot.Pose3DDataPrx);
+
+ /**
+ * Interface to the Pose3D.
+ **/
+ jderobot.Pose3D = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3D"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.Pose3DPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3D.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3D, jderobot.Pose3DPrx,
+ {
+ "getPose3DData": [, 2, 2, , , ["jderobot.Pose3DData", true], , , , , true],
+ "setPose3DData": [, , , , , [3], [["jderobot.Pose3DData", true]], , , true, ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/pose3dencoders.js b/src/tools/3DViewer-web/public/js/jderobot/pose3dencoders.js
new file mode 100644
index 000000000..4a10066f9
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/pose3dencoders.js
@@ -0,0 +1,109 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `pose3dencoders.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * ptencoders dat information
+ **/
+ jderobot.Pose3DEncodersData = Slice.defineObject(
+ function(x, y, z, pan, tilt, roll, clock, maxPan, maxTilt, minPan, minTilt)
+ {
+ Ice.Object.call(this);
+ this.x = x !== undefined ? x : 0.0;
+ this.y = y !== undefined ? y : 0.0;
+ this.z = z !== undefined ? z : 0.0;
+ this.pan = pan !== undefined ? pan : 0.0;
+ this.tilt = tilt !== undefined ? tilt : 0.0;
+ this.roll = roll !== undefined ? roll : 0.0;
+ this.clock = clock !== undefined ? clock : 0;
+ this.maxPan = maxPan !== undefined ? maxPan : 0.0;
+ this.maxTilt = maxTilt !== undefined ? maxTilt : 0.0;
+ this.minPan = minPan !== undefined ? minPan : 0.0;
+ this.minTilt = minTilt !== undefined ? minTilt : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3DEncodersData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.x);
+ __os.writeFloat(this.y);
+ __os.writeFloat(this.z);
+ __os.writeFloat(this.pan);
+ __os.writeFloat(this.tilt);
+ __os.writeFloat(this.roll);
+ __os.writeInt(this.clock);
+ __os.writeFloat(this.maxPan);
+ __os.writeFloat(this.maxTilt);
+ __os.writeFloat(this.minPan);
+ __os.writeFloat(this.minTilt);
+ },
+ function(__is)
+ {
+ this.x = __is.readFloat();
+ this.y = __is.readFloat();
+ this.z = __is.readFloat();
+ this.pan = __is.readFloat();
+ this.tilt = __is.readFloat();
+ this.roll = __is.readFloat();
+ this.clock = __is.readInt();
+ this.maxPan = __is.readFloat();
+ this.maxTilt = __is.readFloat();
+ this.minPan = __is.readFloat();
+ this.minTilt = __is.readFloat();
+ },
+ false);
+
+ jderobot.Pose3DEncodersDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3DEncodersData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3DEncodersData, jderobot.Pose3DEncodersDataPrx);
+
+ /**
+ * Interface to the ptencoders sensor.
+ **/
+ jderobot.Pose3DEncoders = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3DEncoders"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.Pose3DEncodersPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3DEncoders.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3DEncoders, jderobot.Pose3DEncodersPrx,
+ {
+ "getPose3DEncodersData": [, 2, 2, , , ["jderobot.Pose3DEncodersData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/pose3dmotors.js b/src/tools/3DViewer-web/public/js/jderobot/pose3dmotors.js
new file mode 100644
index 000000000..3e7efc289
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/pose3dmotors.js
@@ -0,0 +1,146 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `pose3dmotors.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * Pose3DMotorsData a class that contains the pantilt data
+ **/
+ jderobot.Pose3DMotorsData = Slice.defineObject(
+ function(x, y, z, pan, tilt, roll, panSpeed, tiltSpeed)
+ {
+ Ice.Object.call(this);
+ this.x = x !== undefined ? x : 0.0;
+ this.y = y !== undefined ? y : 0.0;
+ this.z = z !== undefined ? z : 0.0;
+ this.pan = pan !== undefined ? pan : 0.0;
+ this.tilt = tilt !== undefined ? tilt : 0.0;
+ this.roll = roll !== undefined ? roll : 0.0;
+ this.panSpeed = panSpeed !== undefined ? panSpeed : 0.0;
+ this.tiltSpeed = tiltSpeed !== undefined ? tiltSpeed : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3DMotorsData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.x);
+ __os.writeFloat(this.y);
+ __os.writeFloat(this.z);
+ __os.writeFloat(this.pan);
+ __os.writeFloat(this.tilt);
+ __os.writeFloat(this.roll);
+ __os.writeFloat(this.panSpeed);
+ __os.writeFloat(this.tiltSpeed);
+ },
+ function(__is)
+ {
+ this.x = __is.readFloat();
+ this.y = __is.readFloat();
+ this.z = __is.readFloat();
+ this.pan = __is.readFloat();
+ this.tilt = __is.readFloat();
+ this.roll = __is.readFloat();
+ this.panSpeed = __is.readFloat();
+ this.tiltSpeed = __is.readFloat();
+ },
+ false);
+
+ jderobot.Pose3DMotorsDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3DMotorsData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3DMotorsData, jderobot.Pose3DMotorsDataPrx);
+
+ /**
+ * Pose3DMotorsParams a class that contains the motors parametres.
+ **/
+ jderobot.Pose3DMotorsParams = Slice.defineObject(
+ function(maxPan, minPan, maxTilt, minTilt, maxPanSpeed, maxTiltSpeed)
+ {
+ Ice.Object.call(this);
+ this.maxPan = maxPan !== undefined ? maxPan : 0.0;
+ this.minPan = minPan !== undefined ? minPan : 0.0;
+ this.maxTilt = maxTilt !== undefined ? maxTilt : 0.0;
+ this.minTilt = minTilt !== undefined ? minTilt : 0.0;
+ this.maxPanSpeed = maxPanSpeed !== undefined ? maxPanSpeed : 0.0;
+ this.maxTiltSpeed = maxTiltSpeed !== undefined ? maxTiltSpeed : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3DMotorsParams"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.maxPan);
+ __os.writeFloat(this.minPan);
+ __os.writeFloat(this.maxTilt);
+ __os.writeFloat(this.minTilt);
+ __os.writeFloat(this.maxPanSpeed);
+ __os.writeFloat(this.maxTiltSpeed);
+ },
+ function(__is)
+ {
+ this.maxPan = __is.readFloat();
+ this.minPan = __is.readFloat();
+ this.maxTilt = __is.readFloat();
+ this.minTilt = __is.readFloat();
+ this.maxPanSpeed = __is.readFloat();
+ this.maxTiltSpeed = __is.readFloat();
+ },
+ false);
+
+ jderobot.Pose3DMotorsParamsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3DMotorsParams.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3DMotorsParams, jderobot.Pose3DMotorsParamsPrx);
+
+ /**
+ * Interface to the Pose3DMotors Actuators interaction.
+ **/
+ jderobot.Pose3DMotors = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Pose3DMotors"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.Pose3DMotorsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Pose3DMotors.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Pose3DMotors, jderobot.Pose3DMotorsPrx,
+ {
+ "setPose3DMotorsData": [, , , , , [3], [["jderobot.Pose3DMotorsData", true]], , , true, ],
+ "getPose3DMotorsData": [, 2, 2, , , ["jderobot.Pose3DMotorsData", true], , , , , true],
+ "getPose3DMotorsParams": [, 2, 2, , , ["jderobot.Pose3DMotorsParams", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/primitives.ice b/src/tools/3DViewer-web/public/js/jderobot/primitives.ice
new file mode 100644
index 000000000..313220c9e
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/primitives.ice
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 1997-2010 JDE Developers Team
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ *
+ * Authors : Jose MarÃa Cañas
+ * Francisco Miguel Rivas Montero
+ */
+
+#ifndef BODY_ICE
+#define BODY_ICE
+
+#include
+
+module jderobot{
+
+ /**
+ * PCL
+ */
+ struct RGBPoint{
+ float x;
+ float y;
+ float z;
+ float r;
+ float g;
+ float b;
+ int id;
+ };
+
+ struct Point{
+ float x;
+ float y;
+ float z;
+ };
+
+ struct Segment{
+ Point fromPoint;
+ Point toPoint;
+ };
+
+};
+#endif
diff --git a/src/tools/3DViewer-web/public/js/jderobot/primitives.js b/src/tools/3DViewer-web/public/js/jderobot/primitives.js
new file mode 100644
index 000000000..26a783ff1
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/primitives.js
@@ -0,0 +1,112 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `primitives.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * PCL
+ **/
+ jderobot.RGBPoint = Slice.defineStruct(
+ function(x, y, z, r, g, b, id)
+ {
+ this.x = x !== undefined ? x : 0.0;
+ this.y = y !== undefined ? y : 0.0;
+ this.z = z !== undefined ? z : 0.0;
+ this.r = r !== undefined ? r : 0.0;
+ this.g = g !== undefined ? g : 0.0;
+ this.b = b !== undefined ? b : 0.0;
+ this.id = id !== undefined ? id : 0;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeFloat(this.x);
+ __os.writeFloat(this.y);
+ __os.writeFloat(this.z);
+ __os.writeFloat(this.r);
+ __os.writeFloat(this.g);
+ __os.writeFloat(this.b);
+ __os.writeInt(this.id);
+ },
+ function(__is)
+ {
+ this.x = __is.readFloat();
+ this.y = __is.readFloat();
+ this.z = __is.readFloat();
+ this.r = __is.readFloat();
+ this.g = __is.readFloat();
+ this.b = __is.readFloat();
+ this.id = __is.readInt();
+ },
+ 28,
+ true);
+
+ jderobot.Point = Slice.defineStruct(
+ function(x, y, z)
+ {
+ this.x = x !== undefined ? x : 0.0;
+ this.y = y !== undefined ? y : 0.0;
+ this.z = z !== undefined ? z : 0.0;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeFloat(this.x);
+ __os.writeFloat(this.y);
+ __os.writeFloat(this.z);
+ },
+ function(__is)
+ {
+ this.x = __is.readFloat();
+ this.y = __is.readFloat();
+ this.z = __is.readFloat();
+ },
+ 12,
+ true);
+
+ jderobot.Segment = Slice.defineStruct(
+ function(fromPoint, toPoint)
+ {
+ this.fromPoint = fromPoint !== undefined ? fromPoint : new jderobot.Point();
+ this.toPoint = toPoint !== undefined ? toPoint : new jderobot.Point();
+ },
+ false,
+ function(__os)
+ {
+ jderobot.Point.write(__os, this.fromPoint);
+ jderobot.Point.write(__os, this.toPoint);
+ },
+ function(__is)
+ {
+ this.fromPoint = jderobot.Point.read(__is, this.fromPoint);
+ this.toPoint = jderobot.Point.read(__is, this.toPoint);
+ },
+ 24,
+ true);
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/ptencoders.js b/src/tools/3DViewer-web/public/js/jderobot/ptencoders.js
new file mode 100644
index 000000000..c5a84d4d2
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/ptencoders.js
@@ -0,0 +1,85 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `ptencoders.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * ptencoders dat information
+ **/
+ jderobot.PTEncodersData = Slice.defineObject(
+ function(panAngle, tiltAngle, clock)
+ {
+ Ice.Object.call(this);
+ this.panAngle = panAngle !== undefined ? panAngle : 0.0;
+ this.tiltAngle = tiltAngle !== undefined ? tiltAngle : 0.0;
+ this.clock = clock !== undefined ? clock : 0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::PTEncodersData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.panAngle);
+ __os.writeFloat(this.tiltAngle);
+ __os.writeInt(this.clock);
+ },
+ function(__is)
+ {
+ this.panAngle = __is.readFloat();
+ this.tiltAngle = __is.readFloat();
+ this.clock = __is.readInt();
+ },
+ false);
+
+ jderobot.PTEncodersDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.PTEncodersData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.PTEncodersData, jderobot.PTEncodersDataPrx);
+
+ /**
+ * Interface to the ptencoders sensor.
+ **/
+ jderobot.PTEncoders = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::PTEncoders"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.PTEncodersPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.PTEncoders.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.PTEncoders, jderobot.PTEncodersPrx,
+ {
+ "getPTEncodersData": [, 2, 2, , , ["jderobot.PTEncodersData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/ptmotors.js b/src/tools/3DViewer-web/public/js/jderobot/ptmotors.js
new file mode 100644
index 000000000..7adcdac8b
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/ptmotors.js
@@ -0,0 +1,133 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `ptmotors.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ /**
+ * PTMotorsData a class that contains the pantilt data
+ **/
+ jderobot.PTMotorsData = Slice.defineObject(
+ function(pan, panSpeed, tilt, tiltSpeed)
+ {
+ Ice.Object.call(this);
+ this.pan = pan !== undefined ? pan : 0.0;
+ this.panSpeed = panSpeed !== undefined ? panSpeed : 0.0;
+ this.tilt = tilt !== undefined ? tilt : 0.0;
+ this.tiltSpeed = tiltSpeed !== undefined ? tiltSpeed : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::PTMotorsData"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.pan);
+ __os.writeFloat(this.panSpeed);
+ __os.writeFloat(this.tilt);
+ __os.writeFloat(this.tiltSpeed);
+ },
+ function(__is)
+ {
+ this.pan = __is.readFloat();
+ this.panSpeed = __is.readFloat();
+ this.tilt = __is.readFloat();
+ this.tiltSpeed = __is.readFloat();
+ },
+ false);
+
+ jderobot.PTMotorsDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.PTMotorsData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.PTMotorsData, jderobot.PTMotorsDataPrx);
+
+ /**
+ * PTMotorsParams a class that contains the motors parametres.
+ **/
+ jderobot.PTMotorsParams = Slice.defineObject(
+ function(maxPan, minPan, maxTilt, minTilt, maxPanSpeed, maxTiltSpeed)
+ {
+ Ice.Object.call(this);
+ this.maxPan = maxPan !== undefined ? maxPan : 0.0;
+ this.minPan = minPan !== undefined ? minPan : 0.0;
+ this.maxTilt = maxTilt !== undefined ? maxTilt : 0.0;
+ this.minTilt = minTilt !== undefined ? minTilt : 0.0;
+ this.maxPanSpeed = maxPanSpeed !== undefined ? maxPanSpeed : 0.0;
+ this.maxTiltSpeed = maxTiltSpeed !== undefined ? maxTiltSpeed : 0.0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::PTMotorsParams"
+ ],
+ -1,
+ function(__os)
+ {
+ __os.writeFloat(this.maxPan);
+ __os.writeFloat(this.minPan);
+ __os.writeFloat(this.maxTilt);
+ __os.writeFloat(this.minTilt);
+ __os.writeFloat(this.maxPanSpeed);
+ __os.writeFloat(this.maxTiltSpeed);
+ },
+ function(__is)
+ {
+ this.maxPan = __is.readFloat();
+ this.minPan = __is.readFloat();
+ this.maxTilt = __is.readFloat();
+ this.minTilt = __is.readFloat();
+ this.maxPanSpeed = __is.readFloat();
+ this.maxTiltSpeed = __is.readFloat();
+ },
+ false);
+
+ jderobot.PTMotorsParamsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.PTMotorsParams.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.PTMotorsParams, jderobot.PTMotorsParamsPrx);
+
+ /**
+ * Interface to the PTMotors Actuators interaction.
+ **/
+ jderobot.PTMotors = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::PTMotors"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.PTMotorsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.PTMotors.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.PTMotors, jderobot.PTMotorsPrx,
+ {
+ "setPTMotorsData": [, , , , , [3], [["jderobot.PTMotorsData", true]], , , true, ],
+ "getPTMotorsParams": [, 2, 2, , , ["jderobot.PTMotorsParams", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/recorder.js b/src/tools/3DViewer-web/public/js/jderobot/recorder.js
new file mode 100644
index 000000000..b71fd4b0e
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/recorder.js
@@ -0,0 +1,49 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `recorder.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.recorder = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::recorder"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.recorderPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.recorder.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.recorder, jderobot.recorderPrx,
+ {
+ "saveLog": [, , , , , [1], [[7], [3]], , , , ],
+ "saveVideo": [, , , , , [1], [[7], [7], [3]], , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/remoteCloud.js b/src/tools/3DViewer-web/public/js/jderobot/remoteCloud.js
new file mode 100644
index 000000000..1518bab8d
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/remoteCloud.js
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `remoteCloud.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("pointcloud").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.remoteCloud = Slice.defineObject(
+ undefined,
+ Ice.Object,
+ [
+ jderobot.pointCloud
+ ], 2,
+ [
+ "::Ice::Object",
+ "::jderobot::pointCloud",
+ "::jderobot::remoteCloud"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.remoteCloudPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.remoteCloud.ice_staticId, [
+ jderobot.pointCloudPrx]);
+
+ Slice.defineOperations(jderobot.remoteCloud, jderobot.remoteCloudPrx,
+ {
+ "initConfiguration": [, , , , , [3], , , , , ],
+ "read": [, , , , , [7], [[3]], , , , ],
+ "write": [, , , , , [3], [[7], [3]], , , , ],
+ "setConfiguration": [, , , , , [3], [[3]], , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/remoteConfig.js b/src/tools/3DViewer-web/public/js/jderobot/remoteConfig.js
new file mode 100644
index 000000000..9afb35eec
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/remoteConfig.js
@@ -0,0 +1,51 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `remoteConfig.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.remoteConfig = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::remoteConfig"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.remoteConfigPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.remoteConfig.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.remoteConfig, jderobot.remoteConfigPrx,
+ {
+ "initConfiguration": [, , , , , [3], , , , , ],
+ "read": [, , , , , [7], [[3]], , , , ],
+ "write": [, , , , , [3], [[7], [3]], , , , ],
+ "setConfiguration": [, , , , , [3], [[3]], , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/replayControl.js b/src/tools/3DViewer-web/public/js/jderobot/replayControl.js
new file mode 100644
index 000000000..e1645aba6
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/replayControl.js
@@ -0,0 +1,57 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `replayControl.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var Slice = Ice.Slice;
+
+ var jderobot = __M.module("jderobot");
+
+ jderobot.ReplayerStatus = Slice.defineEnum([
+ ['WAITING', 0], ['PLAYING', 1], ['PAUSED', 2], ['FINISHED', 3]]);
+
+ jderobot.replayControl = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::replayControl"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.replayControlPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.replayControl.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.replayControl, jderobot.replayControlPrx,
+ {
+ "pause": [, , , , , [1], , , , , ],
+ "resume": [, , , , , [1], , , , , ],
+ "setReplay": [, , , , , , [[1]], , , , ],
+ "setStep": [, , , , , [1], [[3]], , , , ],
+ "getTime": [, , , , , [4], , , , , ],
+ "goTo": [, , , , , [1], [[4]], , , , ],
+ "getStatus": [, , , , , [jderobot.ReplayerStatus.__helper], , , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/rgbd.js b/src/tools/3DViewer-web/public/js/jderobot/rgbd.js
new file mode 100644
index 000000000..6782e15fb
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/rgbd.js
@@ -0,0 +1,68 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `rgbd.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("image").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.rgbData = Slice.defineStruct(
+ function(color, depth)
+ {
+ this.color = color !== undefined ? color : null;
+ this.depth = depth !== undefined ? depth : null;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeObject(this.color);
+ __os.writeObject(this.depth);
+ },
+ function(__is)
+ {
+ var self = this;
+ __is.readObject(function(__o){ self.color = __o; }, jderobot.ImageData);
+ __is.readObject(function(__o){ self.depth = __o; }, jderobot.ImageData);
+ },
+ 2,
+ false);
+
+ jderobot.rgbd = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::rgbd"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.rgbdPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.rgbd.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.rgbd, jderobot.rgbdPrx,
+ {
+ "getData": [, 2, 2, , , [jderobot.rgbData], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/sonars.js b/src/tools/3DViewer-web/public/js/jderobot/sonars.js
new file mode 100644
index 000000000..0f5fe017c
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/sonars.js
@@ -0,0 +1,79 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `sonars.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = require("common").jderobot;
+ var Slice = Ice.Slice;
+
+ jderobot.SonarsData = Slice.defineObject(
+ function(us, numSonars)
+ {
+ Ice.Object.call(this);
+ this.us = us !== undefined ? us : null;
+ this.numSonars = numSonars !== undefined ? numSonars : 0;
+ },
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::SonarsData"
+ ],
+ -1,
+ function(__os)
+ {
+ jderobot.IntSeqHelper.write(__os, this.us);
+ __os.writeInt(this.numSonars);
+ },
+ function(__is)
+ {
+ this.us = jderobot.IntSeqHelper.read(__is);
+ this.numSonars = __is.readInt();
+ },
+ false);
+
+ jderobot.SonarsDataPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.SonarsData.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.SonarsData, jderobot.SonarsDataPrx);
+
+ /**
+ * Interface to the Gazebo sonars sensor.
+ **/
+ jderobot.Sonars = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Sonars"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.SonarsPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Sonars.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Sonars, jderobot.SonarsPrx,
+ {
+ "getSonarsData": [, 2, 2, , , ["jderobot.SonarsData", true], , , , , true]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/jderobot/visualization.ice b/src/tools/3DViewer-web/public/js/jderobot/visualization.ice
new file mode 100644
index 000000000..3aec5faa8
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/visualization.ice
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 1997-2016 JDE Developers Team
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ *
+ * Authors : Francisco Miguel Rivas Montero
+ */
+
+#ifndef VISUALIZATION_ICE
+#define VISUALIZATION_ICE
+
+#include
+#include
+
+
+module jderobot{
+
+ struct Color{
+ float r;
+ float g;
+ float b;
+ };
+
+ sequence bufferPoint;
+ sequence bufferSegment;
+ /**
+ * Interface to the Visualization interaction.
+ */
+ interface Visualization
+ {
+ void drawSegment(Segment seg, Color c);
+ void getSegment (out bufferSegment bseg, out Color c);
+ void drawPoint(Point p, Color c);
+ bufferPoint getPoints();
+ void clearAll();
+ };
+
+
+
+
+};
+#endif
diff --git a/src/tools/3DViewer-web/public/js/jderobot/visualization.js b/src/tools/3DViewer-web/public/js/jderobot/visualization.js
new file mode 100644
index 000000000..f1fb7ac2d
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/jderobot/visualization.js
@@ -0,0 +1,106 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+//
+// Ice version 3.6.4
+//
+//
+//
+// Generated from file `visualization.ice'
+//
+// Warning: do not edit this file.
+//
+//
+//
+
+(function(module, require, exports)
+{
+ var Ice = require("ice").Ice;
+ var __M = Ice.__M;
+ var jderobot = __M.require(module,
+ [
+ "common",
+ "primitives"
+ ]).jderobot;
+
+ var Slice = Ice.Slice;
+
+ jderobot.Color = Slice.defineStruct(
+ function(r, g, b)
+ {
+ this.r = r !== undefined ? r : 0.0;
+ this.g = g !== undefined ? g : 0.0;
+ this.b = b !== undefined ? b : 0.0;
+ },
+ false,
+ function(__os)
+ {
+ __os.writeFloat(this.r);
+ __os.writeFloat(this.g);
+ __os.writeFloat(this.b);
+ },
+ function(__is)
+ {
+ this.r = __is.readFloat();
+ this.g = __is.readFloat();
+ this.b = __is.readFloat();
+ },
+ 12,
+ true);
+
+ jderobot.RGBSegment = Slice.defineStruct(
+ function(seg, c)
+ {
+ this.seg = seg !== undefined ? seg : new jderobot.Segment();
+ this.c = c !== undefined ? c : new jderobot.Color();
+ },
+ false,
+ function(__os)
+ {
+ jderobot.Segment.write(__os, this.seg);
+ jderobot.Color.write(__os, this.c);
+ },
+ function(__is)
+ {
+ this.seg = jderobot.Segment.read(__is, this.seg);
+ this.c = jderobot.Color.read(__is, this.c);
+ },
+ 36,
+ true);
+
+ Slice.defineSequence(jderobot, "bufferPointHelper", "jderobot.RGBPoint", true);
+ Slice.defineSequence(jderobot, "bufferSegmentHelper", "jderobot.RGBSegment", true);
+
+
+ /**
+ * Interface to the Visualization interaction.
+ **/
+ jderobot.Visualization = Slice.defineObject(
+ undefined,
+ Ice.Object, undefined, 1,
+ [
+ "::Ice::Object",
+ "::jderobot::Visualization"
+ ],
+ -1, undefined, undefined, false);
+
+ jderobot.VisualizationPrx = Slice.defineProxy(Ice.ObjectPrx, jderobot.Visualization.ice_staticId, undefined);
+
+ Slice.defineOperations(jderobot.Visualization, jderobot.VisualizationPrx,
+ {
+ "drawSegment": [, , , , , , [[jderobot.Segment], [jderobot.Color]], , , , ],
+ "getSegment": [, , , , , ["jderobot.bufferSegmentHelper"], , , , , ],
+ "drawPoint": [, , , , , , [[jderobot.Point], [jderobot.Color]], , , , ],
+ "getPoints": [, , , , , ["jderobot.bufferPointHelper"], , , , , ],
+ "clearAll": [, , , , , , , , , , ]
+ });
+ exports.jderobot = jderobot;
+}
+(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? require : this.Ice.__require,
+ typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? exports : this));
diff --git a/src/tools/3DViewer-web/public/js/three.js b/src/tools/3DViewer-web/public/js/three.js
new file mode 100644
index 000000000..a88f66998
--- /dev/null
+++ b/src/tools/3DViewer-web/public/js/three.js
@@ -0,0 +1,45063 @@
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (factory((global.THREE = global.THREE || {})));
+}(this, (function (exports) { 'use strict';
+
+ // Polyfills
+
+ if ( Number.EPSILON === undefined ) {
+
+ Number.EPSILON = Math.pow( 2, - 52 );
+
+ }
+
+ if ( Number.isInteger === undefined ) {
+
+ // Missing in IE
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger
+
+ Number.isInteger = function ( value ) {
+
+ return typeof value === 'number' && isFinite( value ) && Math.floor( value ) === value;
+
+ };
+
+ }
+
+ //
+
+ if ( Math.sign === undefined ) {
+
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
+
+ Math.sign = function ( x ) {
+
+ return ( x < 0 ) ? - 1 : ( x > 0 ) ? 1 : + x;
+
+ };
+
+ }
+
+ if ( 'name' in Function.prototype === false ) {
+
+ // Missing in IE
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
+
+ Object.defineProperty( Function.prototype, 'name', {
+
+ get: function () {
+
+ return this.toString().match( /^\s*function\s*([^\(\s]*)/ )[ 1 ];
+
+ }
+
+ } );
+
+ }
+
+ if ( Object.assign === undefined ) {
+
+ // Missing in IE
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
+
+ ( function () {
+
+ Object.assign = function ( target ) {
+
+ 'use strict';
+
+ if ( target === undefined || target === null ) {
+
+ throw new TypeError( 'Cannot convert undefined or null to object' );
+
+ }
+
+ var output = Object( target );
+
+ for ( var index = 1; index < arguments.length; index ++ ) {
+
+ var source = arguments[ index ];
+
+ if ( source !== undefined && source !== null ) {
+
+ for ( var nextKey in source ) {
+
+ if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) {
+
+ output[ nextKey ] = source[ nextKey ];
+
+ }
+
+ }
+
+ }
+
+ }
+
+ return output;
+
+ };
+
+ } )();
+
+ }
+
+ /**
+ * https://github.com/mrdoob/eventdispatcher.js/
+ */
+
+ function EventDispatcher() {}
+
+ Object.assign( EventDispatcher.prototype, {
+
+ addEventListener: function ( type, listener ) {
+
+ if ( this._listeners === undefined ) this._listeners = {};
+
+ var listeners = this._listeners;
+
+ if ( listeners[ type ] === undefined ) {
+
+ listeners[ type ] = [];
+
+ }
+
+ if ( listeners[ type ].indexOf( listener ) === - 1 ) {
+
+ listeners[ type ].push( listener );
+
+ }
+
+ },
+
+ hasEventListener: function ( type, listener ) {
+
+ if ( this._listeners === undefined ) return false;
+
+ var listeners = this._listeners;
+
+ return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1;
+
+ },
+
+ removeEventListener: function ( type, listener ) {
+
+ if ( this._listeners === undefined ) return;
+
+ var listeners = this._listeners;
+ var listenerArray = listeners[ type ];
+
+ if ( listenerArray !== undefined ) {
+
+ var index = listenerArray.indexOf( listener );
+
+ if ( index !== - 1 ) {
+
+ listenerArray.splice( index, 1 );
+
+ }
+
+ }
+
+ },
+
+ dispatchEvent: function ( event ) {
+
+ if ( this._listeners === undefined ) return;
+
+ var listeners = this._listeners;
+ var listenerArray = listeners[ event.type ];
+
+ if ( listenerArray !== undefined ) {
+
+ event.target = this;
+
+ var array = listenerArray.slice( 0 );
+
+ for ( var i = 0, l = array.length; i < l; i ++ ) {
+
+ array[ i ].call( this, event );
+
+ }
+
+ }
+
+ }
+
+ } );
+
+ var REVISION = '88';
+ var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
+ var CullFaceNone = 0;
+ var CullFaceBack = 1;
+ var CullFaceFront = 2;
+ var CullFaceFrontBack = 3;
+ var FrontFaceDirectionCW = 0;
+ var FrontFaceDirectionCCW = 1;
+ var BasicShadowMap = 0;
+ var PCFShadowMap = 1;
+ var PCFSoftShadowMap = 2;
+ var FrontSide = 0;
+ var BackSide = 1;
+ var DoubleSide = 2;
+ var FlatShading = 1;
+ var SmoothShading = 2;
+ var NoColors = 0;
+ var FaceColors = 1;
+ var VertexColors = 2;
+ var NoBlending = 0;
+ var NormalBlending = 1;
+ var AdditiveBlending = 2;
+ var SubtractiveBlending = 3;
+ var MultiplyBlending = 4;
+ var CustomBlending = 5;
+ var AddEquation = 100;
+ var SubtractEquation = 101;
+ var ReverseSubtractEquation = 102;
+ var MinEquation = 103;
+ var MaxEquation = 104;
+ var ZeroFactor = 200;
+ var OneFactor = 201;
+ var SrcColorFactor = 202;
+ var OneMinusSrcColorFactor = 203;
+ var SrcAlphaFactor = 204;
+ var OneMinusSrcAlphaFactor = 205;
+ var DstAlphaFactor = 206;
+ var OneMinusDstAlphaFactor = 207;
+ var DstColorFactor = 208;
+ var OneMinusDstColorFactor = 209;
+ var SrcAlphaSaturateFactor = 210;
+ var NeverDepth = 0;
+ var AlwaysDepth = 1;
+ var LessDepth = 2;
+ var LessEqualDepth = 3;
+ var EqualDepth = 4;
+ var GreaterEqualDepth = 5;
+ var GreaterDepth = 6;
+ var NotEqualDepth = 7;
+ var MultiplyOperation = 0;
+ var MixOperation = 1;
+ var AddOperation = 2;
+ var NoToneMapping = 0;
+ var LinearToneMapping = 1;
+ var ReinhardToneMapping = 2;
+ var Uncharted2ToneMapping = 3;
+ var CineonToneMapping = 4;
+ var UVMapping = 300;
+ var CubeReflectionMapping = 301;
+ var CubeRefractionMapping = 302;
+ var EquirectangularReflectionMapping = 303;
+ var EquirectangularRefractionMapping = 304;
+ var SphericalReflectionMapping = 305;
+ var CubeUVReflectionMapping = 306;
+ var CubeUVRefractionMapping = 307;
+ var RepeatWrapping = 1000;
+ var ClampToEdgeWrapping = 1001;
+ var MirroredRepeatWrapping = 1002;
+ var NearestFilter = 1003;
+ var NearestMipMapNearestFilter = 1004;
+ var NearestMipMapLinearFilter = 1005;
+ var LinearFilter = 1006;
+ var LinearMipMapNearestFilter = 1007;
+ var LinearMipMapLinearFilter = 1008;
+ var UnsignedByteType = 1009;
+ var ByteType = 1010;
+ var ShortType = 1011;
+ var UnsignedShortType = 1012;
+ var IntType = 1013;
+ var UnsignedIntType = 1014;
+ var FloatType = 1015;
+ var HalfFloatType = 1016;
+ var UnsignedShort4444Type = 1017;
+ var UnsignedShort5551Type = 1018;
+ var UnsignedShort565Type = 1019;
+ var UnsignedInt248Type = 1020;
+ var AlphaFormat = 1021;
+ var RGBFormat = 1022;
+ var RGBAFormat = 1023;
+ var LuminanceFormat = 1024;
+ var LuminanceAlphaFormat = 1025;
+ var RGBEFormat = RGBAFormat;
+ var DepthFormat = 1026;
+ var DepthStencilFormat = 1027;
+ var RGB_S3TC_DXT1_Format = 2001;
+ var RGBA_S3TC_DXT1_Format = 2002;
+ var RGBA_S3TC_DXT3_Format = 2003;
+ var RGBA_S3TC_DXT5_Format = 2004;
+ var RGB_PVRTC_4BPPV1_Format = 2100;
+ var RGB_PVRTC_2BPPV1_Format = 2101;
+ var RGBA_PVRTC_4BPPV1_Format = 2102;
+ var RGBA_PVRTC_2BPPV1_Format = 2103;
+ var RGB_ETC1_Format = 2151;
+ var LoopOnce = 2200;
+ var LoopRepeat = 2201;
+ var LoopPingPong = 2202;
+ var InterpolateDiscrete = 2300;
+ var InterpolateLinear = 2301;
+ var InterpolateSmooth = 2302;
+ var ZeroCurvatureEnding = 2400;
+ var ZeroSlopeEnding = 2401;
+ var WrapAroundEnding = 2402;
+ var TrianglesDrawMode = 0;
+ var TriangleStripDrawMode = 1;
+ var TriangleFanDrawMode = 2;
+ var LinearEncoding = 3000;
+ var sRGBEncoding = 3001;
+ var GammaEncoding = 3007;
+ var RGBEEncoding = 3002;
+ var LogLuvEncoding = 3003;
+ var RGBM7Encoding = 3004;
+ var RGBM16Encoding = 3005;
+ var RGBDEncoding = 3006;
+ var BasicDepthPacking = 3200;
+ var RGBADepthPacking = 3201;
+
+ /**
+ * @author alteredq / http://alteredqualia.com/
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+ var _Math = {
+
+ DEG2RAD: Math.PI / 180,
+ RAD2DEG: 180 / Math.PI,
+
+ generateUUID: function () {
+
+ // http://www.broofa.com/Tools/Math.uuid.htm
+ // Replaced .join with string concatenation (@takahirox)
+
+ var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split( '' );
+ var rnd = 0, r;
+
+ return function generateUUID() {
+
+ var uuid = '';
+
+ for ( var i = 0; i < 36; i ++ ) {
+
+ if ( i === 8 || i === 13 || i === 18 || i === 23 ) {
+
+ uuid += '-';
+
+ } else if ( i === 14 ) {
+
+ uuid += '4';
+
+ } else {
+
+ if ( rnd <= 0x02 ) rnd = 0x2000000 + ( Math.random() * 0x1000000 ) | 0;
+ r = rnd & 0xf;
+ rnd = rnd >> 4;
+ uuid += chars[ ( i === 19 ) ? ( r & 0x3 ) | 0x8 : r ];
+
+ }
+
+ }
+
+ return uuid;
+
+ };
+
+ }(),
+
+ clamp: function ( value, min, max ) {
+
+ return Math.max( min, Math.min( max, value ) );
+
+ },
+
+ // compute euclidian modulo of m % n
+ // https://en.wikipedia.org/wiki/Modulo_operation
+
+ euclideanModulo: function ( n, m ) {
+
+ return ( ( n % m ) + m ) % m;
+
+ },
+
+ // Linear mapping from range to range
+
+ mapLinear: function ( x, a1, a2, b1, b2 ) {
+
+ return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 );
+
+ },
+
+ // https://en.wikipedia.org/wiki/Linear_interpolation
+
+ lerp: function ( x, y, t ) {
+
+ return ( 1 - t ) * x + t * y;
+
+ },
+
+ // http://en.wikipedia.org/wiki/Smoothstep
+
+ smoothstep: function ( x, min, max ) {
+
+ if ( x <= min ) return 0;
+ if ( x >= max ) return 1;
+
+ x = ( x - min ) / ( max - min );
+
+ return x * x * ( 3 - 2 * x );
+
+ },
+
+ smootherstep: function ( x, min, max ) {
+
+ if ( x <= min ) return 0;
+ if ( x >= max ) return 1;
+
+ x = ( x - min ) / ( max - min );
+
+ return x * x * x * ( x * ( x * 6 - 15 ) + 10 );
+
+ },
+
+ // Random integer from interval
+
+ randInt: function ( low, high ) {
+
+ return low + Math.floor( Math.random() * ( high - low + 1 ) );
+
+ },
+
+ // Random float from interval
+
+ randFloat: function ( low, high ) {
+
+ return low + Math.random() * ( high - low );
+
+ },
+
+ // Random float from <-range/2, range/2> interval
+
+ randFloatSpread: function ( range ) {
+
+ return range * ( 0.5 - Math.random() );
+
+ },
+
+ degToRad: function ( degrees ) {
+
+ return degrees * _Math.DEG2RAD;
+
+ },
+
+ radToDeg: function ( radians ) {
+
+ return radians * _Math.RAD2DEG;
+
+ },
+
+ isPowerOfTwo: function ( value ) {
+
+ return ( value & ( value - 1 ) ) === 0 && value !== 0;
+
+ },
+
+ ceilPowerOfTwo: function ( value ) {
+
+ return Math.pow( 2, Math.ceil( Math.log( value ) / Math.LN2 ) );
+
+ },
+
+ floorPowerOfTwo: function ( value ) {
+
+ return Math.pow( 2, Math.floor( Math.log( value ) / Math.LN2 ) );
+
+ }
+
+ };
+
+ /**
+ * @author mrdoob / http://mrdoob.com/
+ * @author philogb / http://blog.thejit.org/
+ * @author egraether / http://egraether.com/
+ * @author zz85 / http://www.lab4games.net/zz85/blog
+ */
+
+ function Vector2( x, y ) {
+
+ this.x = x || 0;
+ this.y = y || 0;
+
+ }
+
+ Object.defineProperties( Vector2.prototype, {
+
+ "width": {
+
+ get: function () {
+
+ return this.x;
+
+ },
+
+ set: function ( value ) {
+
+ this.x = value;
+
+ }
+
+ },
+
+ "height": {
+
+ get: function () {
+
+ return this.y;
+
+ },
+
+ set: function ( value ) {
+
+ this.y = value;
+
+ }
+
+ }
+
+ } );
+
+ Object.assign( Vector2.prototype, {
+
+ isVector2: true,
+
+ set: function ( x, y ) {
+
+ this.x = x;
+ this.y = y;
+
+ return this;
+
+ },
+
+ setScalar: function ( scalar ) {
+
+ this.x = scalar;
+ this.y = scalar;
+
+ return this;
+
+ },
+
+ setX: function ( x ) {
+
+ this.x = x;
+
+ return this;
+
+ },
+
+ setY: function ( y ) {
+
+ this.y = y;
+
+ return this;
+
+ },
+
+ setComponent: function ( index, value ) {
+
+ switch ( index ) {
+
+ case 0: this.x = value; break;
+ case 1: this.y = value; break;
+ default: throw new Error( 'index is out of range: ' + index );
+
+ }
+
+ return this;
+
+ },
+
+ getComponent: function ( index ) {
+
+ switch ( index ) {
+
+ case 0: return this.x;
+ case 1: return this.y;
+ default: throw new Error( 'index is out of range: ' + index );
+
+ }
+
+ },
+
+ clone: function () {
+
+ return new this.constructor( this.x, this.y );
+
+ },
+
+ copy: function ( v ) {
+
+ this.x = v.x;
+ this.y = v.y;
+
+ return this;
+
+ },
+
+ add: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
+ return this.addVectors( v, w );
+
+ }
+
+ this.x += v.x;
+ this.y += v.y;
+
+ return this;
+
+ },
+
+ addScalar: function ( s ) {
+
+ this.x += s;
+ this.y += s;
+
+ return this;
+
+ },
+
+ addVectors: function ( a, b ) {
+
+ this.x = a.x + b.x;
+ this.y = a.y + b.y;
+
+ return this;
+
+ },
+
+ addScaledVector: function ( v, s ) {
+
+ this.x += v.x * s;
+ this.y += v.y * s;
+
+ return this;
+
+ },
+
+ sub: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
+ return this.subVectors( v, w );
+
+ }
+
+ this.x -= v.x;
+ this.y -= v.y;
+
+ return this;
+
+ },
+
+ subScalar: function ( s ) {
+
+ this.x -= s;
+ this.y -= s;
+
+ return this;
+
+ },
+
+ subVectors: function ( a, b ) {
+
+ this.x = a.x - b.x;
+ this.y = a.y - b.y;
+
+ return this;
+
+ },
+
+ multiply: function ( v ) {
+
+ this.x *= v.x;
+ this.y *= v.y;
+
+ return this;
+
+ },
+
+ multiplyScalar: function ( scalar ) {
+
+ this.x *= scalar;
+ this.y *= scalar;
+
+ return this;
+
+ },
+
+ divide: function ( v ) {
+
+ this.x /= v.x;
+ this.y /= v.y;
+
+ return this;
+
+ },
+
+ divideScalar: function ( scalar ) {
+
+ return this.multiplyScalar( 1 / scalar );
+
+ },
+
+ applyMatrix3: function ( m ) {
+
+ var x = this.x, y = this.y;
+ var e = m.elements;
+
+ this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ];
+ this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ];
+
+ return this;
+
+ },
+
+ min: function ( v ) {
+
+ this.x = Math.min( this.x, v.x );
+ this.y = Math.min( this.y, v.y );
+
+ return this;
+
+ },
+
+ max: function ( v ) {
+
+ this.x = Math.max( this.x, v.x );
+ this.y = Math.max( this.y, v.y );
+
+ return this;
+
+ },
+
+ clamp: function ( min, max ) {
+
+ // assumes min < max, componentwise
+
+ this.x = Math.max( min.x, Math.min( max.x, this.x ) );
+ this.y = Math.max( min.y, Math.min( max.y, this.y ) );
+
+ return this;
+
+ },
+
+ clampScalar: function () {
+
+ var min = new Vector2();
+ var max = new Vector2();
+
+ return function clampScalar( minVal, maxVal ) {
+
+ min.set( minVal, minVal );
+ max.set( maxVal, maxVal );
+
+ return this.clamp( min, max );
+
+ };
+
+ }(),
+
+ clampLength: function ( min, max ) {
+
+ var length = this.length();
+
+ return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );
+
+ },
+
+ floor: function () {
+
+ this.x = Math.floor( this.x );
+ this.y = Math.floor( this.y );
+
+ return this;
+
+ },
+
+ ceil: function () {
+
+ this.x = Math.ceil( this.x );
+ this.y = Math.ceil( this.y );
+
+ return this;
+
+ },
+
+ round: function () {
+
+ this.x = Math.round( this.x );
+ this.y = Math.round( this.y );
+
+ return this;
+
+ },
+
+ roundToZero: function () {
+
+ this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );
+ this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );
+
+ return this;
+
+ },
+
+ negate: function () {
+
+ this.x = - this.x;
+ this.y = - this.y;
+
+ return this;
+
+ },
+
+ dot: function ( v ) {
+
+ return this.x * v.x + this.y * v.y;
+
+ },
+
+ lengthSq: function () {
+
+ return this.x * this.x + this.y * this.y;
+
+ },
+
+ length: function () {
+
+ return Math.sqrt( this.x * this.x + this.y * this.y );
+
+ },
+
+ manhattanLength: function () {
+
+ return Math.abs( this.x ) + Math.abs( this.y );
+
+ },
+
+ normalize: function () {
+
+ return this.divideScalar( this.length() || 1 );
+
+ },
+
+ angle: function () {
+
+ // computes the angle in radians with respect to the positive x-axis
+
+ var angle = Math.atan2( this.y, this.x );
+
+ if ( angle < 0 ) angle += 2 * Math.PI;
+
+ return angle;
+
+ },
+
+ distanceTo: function ( v ) {
+
+ return Math.sqrt( this.distanceToSquared( v ) );
+
+ },
+
+ distanceToSquared: function ( v ) {
+
+ var dx = this.x - v.x, dy = this.y - v.y;
+ return dx * dx + dy * dy;
+
+ },
+
+ manhattanDistanceTo: function ( v ) {
+
+ return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );
+
+ },
+
+ setLength: function ( length ) {
+
+ return this.normalize().multiplyScalar( length );
+
+ },
+
+ lerp: function ( v, alpha ) {
+
+ this.x += ( v.x - this.x ) * alpha;
+ this.y += ( v.y - this.y ) * alpha;
+
+ return this;
+
+ },
+
+ lerpVectors: function ( v1, v2, alpha ) {
+
+ return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );
+
+ },
+
+ equals: function ( v ) {
+
+ return ( ( v.x === this.x ) && ( v.y === this.y ) );
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ this.x = array[ offset ];
+ this.y = array[ offset + 1 ];
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ array[ offset ] = this.x;
+ array[ offset + 1 ] = this.y;
+
+ return array;
+
+ },
+
+ fromBufferAttribute: function ( attribute, index, offset ) {
+
+ if ( offset !== undefined ) {
+
+ console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' );
+
+ }
+
+ this.x = attribute.getX( index );
+ this.y = attribute.getY( index );
+
+ return this;
+
+ },
+
+ rotateAround: function ( center, angle ) {
+
+ var c = Math.cos( angle ), s = Math.sin( angle );
+
+ var x = this.x - center.x;
+ var y = this.y - center.y;
+
+ this.x = x * c - y * s + center.x;
+ this.y = x * s + y * c + center.y;
+
+ return this;
+
+ }
+
+ } );
+
+ /**
+ * @author mrdoob / http://mrdoob.com/
+ * @author supereggbert / http://www.paulbrunt.co.uk/
+ * @author philogb / http://blog.thejit.org/
+ * @author jordi_ros / http://plattsoft.com
+ * @author D1plo1d / http://github.com/D1plo1d
+ * @author alteredq / http://alteredqualia.com/
+ * @author mikael emtinger / http://gomo.se/
+ * @author timknip / http://www.floorplanner.com/
+ * @author bhouston / http://clara.io
+ * @author WestLangley / http://github.com/WestLangley
+ */
+
+ function Matrix4() {
+
+ this.elements = [
+
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1
+
+ ];
+
+ if ( arguments.length > 0 ) {
+
+ console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );
+
+ }
+
+ }
+
+ Object.assign( Matrix4.prototype, {
+
+ isMatrix4: true,
+
+ set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
+
+ var te = this.elements;
+
+ te[ 0 ] = n11; te[ 4 ] = n12; te[ 8 ] = n13; te[ 12 ] = n14;
+ te[ 1 ] = n21; te[ 5 ] = n22; te[ 9 ] = n23; te[ 13 ] = n24;
+ te[ 2 ] = n31; te[ 6 ] = n32; te[ 10 ] = n33; te[ 14 ] = n34;
+ te[ 3 ] = n41; te[ 7 ] = n42; te[ 11 ] = n43; te[ 15 ] = n44;
+
+ return this;
+
+ },
+
+ identity: function () {
+
+ this.set(
+
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ clone: function () {
+
+ return new Matrix4().fromArray( this.elements );
+
+ },
+
+ copy: function ( m ) {
+
+ var te = this.elements;
+ var me = m.elements;
+
+ te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ]; te[ 3 ] = me[ 3 ];
+ te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ]; te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ];
+ te[ 8 ] = me[ 8 ]; te[ 9 ] = me[ 9 ]; te[ 10 ] = me[ 10 ]; te[ 11 ] = me[ 11 ];
+ te[ 12 ] = me[ 12 ]; te[ 13 ] = me[ 13 ]; te[ 14 ] = me[ 14 ]; te[ 15 ] = me[ 15 ];
+
+ return this;
+
+ },
+
+ copyPosition: function ( m ) {
+
+ var te = this.elements, me = m.elements;
+
+ te[ 12 ] = me[ 12 ];
+ te[ 13 ] = me[ 13 ];
+ te[ 14 ] = me[ 14 ];
+
+ return this;
+
+ },
+
+ extractBasis: function ( xAxis, yAxis, zAxis ) {
+
+ xAxis.setFromMatrixColumn( this, 0 );
+ yAxis.setFromMatrixColumn( this, 1 );
+ zAxis.setFromMatrixColumn( this, 2 );
+
+ return this;
+
+ },
+
+ makeBasis: function ( xAxis, yAxis, zAxis ) {
+
+ this.set(
+ xAxis.x, yAxis.x, zAxis.x, 0,
+ xAxis.y, yAxis.y, zAxis.y, 0,
+ xAxis.z, yAxis.z, zAxis.z, 0,
+ 0, 0, 0, 1
+ );
+
+ return this;
+
+ },
+
+ extractRotation: function () {
+
+ var v1 = new Vector3();
+
+ return function extractRotation( m ) {
+
+ var te = this.elements;
+ var me = m.elements;
+
+ var scaleX = 1 / v1.setFromMatrixColumn( m, 0 ).length();
+ var scaleY = 1 / v1.setFromMatrixColumn( m, 1 ).length();
+ var scaleZ = 1 / v1.setFromMatrixColumn( m, 2 ).length();
+
+ te[ 0 ] = me[ 0 ] * scaleX;
+ te[ 1 ] = me[ 1 ] * scaleX;
+ te[ 2 ] = me[ 2 ] * scaleX;
+
+ te[ 4 ] = me[ 4 ] * scaleY;
+ te[ 5 ] = me[ 5 ] * scaleY;
+ te[ 6 ] = me[ 6 ] * scaleY;
+
+ te[ 8 ] = me[ 8 ] * scaleZ;
+ te[ 9 ] = me[ 9 ] * scaleZ;
+ te[ 10 ] = me[ 10 ] * scaleZ;
+
+ return this;
+
+ };
+
+ }(),
+
+ makeRotationFromEuler: function ( euler ) {
+
+ if ( ! ( euler && euler.isEuler ) ) {
+
+ console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );
+
+ }
+
+ var te = this.elements;
+
+ var x = euler.x, y = euler.y, z = euler.z;
+ var a = Math.cos( x ), b = Math.sin( x );
+ var c = Math.cos( y ), d = Math.sin( y );
+ var e = Math.cos( z ), f = Math.sin( z );
+
+ if ( euler.order === 'XYZ' ) {
+
+ var ae = a * e, af = a * f, be = b * e, bf = b * f;
+
+ te[ 0 ] = c * e;
+ te[ 4 ] = - c * f;
+ te[ 8 ] = d;
+
+ te[ 1 ] = af + be * d;
+ te[ 5 ] = ae - bf * d;
+ te[ 9 ] = - b * c;
+
+ te[ 2 ] = bf - ae * d;
+ te[ 6 ] = be + af * d;
+ te[ 10 ] = a * c;
+
+ } else if ( euler.order === 'YXZ' ) {
+
+ var ce = c * e, cf = c * f, de = d * e, df = d * f;
+
+ te[ 0 ] = ce + df * b;
+ te[ 4 ] = de * b - cf;
+ te[ 8 ] = a * d;
+
+ te[ 1 ] = a * f;
+ te[ 5 ] = a * e;
+ te[ 9 ] = - b;
+
+ te[ 2 ] = cf * b - de;
+ te[ 6 ] = df + ce * b;
+ te[ 10 ] = a * c;
+
+ } else if ( euler.order === 'ZXY' ) {
+
+ var ce = c * e, cf = c * f, de = d * e, df = d * f;
+
+ te[ 0 ] = ce - df * b;
+ te[ 4 ] = - a * f;
+ te[ 8 ] = de + cf * b;
+
+ te[ 1 ] = cf + de * b;
+ te[ 5 ] = a * e;
+ te[ 9 ] = df - ce * b;
+
+ te[ 2 ] = - a * d;
+ te[ 6 ] = b;
+ te[ 10 ] = a * c;
+
+ } else if ( euler.order === 'ZYX' ) {
+
+ var ae = a * e, af = a * f, be = b * e, bf = b * f;
+
+ te[ 0 ] = c * e;
+ te[ 4 ] = be * d - af;
+ te[ 8 ] = ae * d + bf;
+
+ te[ 1 ] = c * f;
+ te[ 5 ] = bf * d + ae;
+ te[ 9 ] = af * d - be;
+
+ te[ 2 ] = - d;
+ te[ 6 ] = b * c;
+ te[ 10 ] = a * c;
+
+ } else if ( euler.order === 'YZX' ) {
+
+ var ac = a * c, ad = a * d, bc = b * c, bd = b * d;
+
+ te[ 0 ] = c * e;
+ te[ 4 ] = bd - ac * f;
+ te[ 8 ] = bc * f + ad;
+
+ te[ 1 ] = f;
+ te[ 5 ] = a * e;
+ te[ 9 ] = - b * e;
+
+ te[ 2 ] = - d * e;
+ te[ 6 ] = ad * f + bc;
+ te[ 10 ] = ac - bd * f;
+
+ } else if ( euler.order === 'XZY' ) {
+
+ var ac = a * c, ad = a * d, bc = b * c, bd = b * d;
+
+ te[ 0 ] = c * e;
+ te[ 4 ] = - f;
+ te[ 8 ] = d * e;
+
+ te[ 1 ] = ac * f + bd;
+ te[ 5 ] = a * e;
+ te[ 9 ] = ad * f - bc;
+
+ te[ 2 ] = bc * f - ad;
+ te[ 6 ] = b * e;
+ te[ 10 ] = bd * f + ac;
+
+ }
+
+ // last column
+ te[ 3 ] = 0;
+ te[ 7 ] = 0;
+ te[ 11 ] = 0;
+
+ // bottom row
+ te[ 12 ] = 0;
+ te[ 13 ] = 0;
+ te[ 14 ] = 0;
+ te[ 15 ] = 1;
+
+ return this;
+
+ },
+
+ makeRotationFromQuaternion: function ( q ) {
+
+ var te = this.elements;
+
+ var x = q._x, y = q._y, z = q._z, w = q._w;
+ var x2 = x + x, y2 = y + y, z2 = z + z;
+ var xx = x * x2, xy = x * y2, xz = x * z2;
+ var yy = y * y2, yz = y * z2, zz = z * z2;
+ var wx = w * x2, wy = w * y2, wz = w * z2;
+
+ te[ 0 ] = 1 - ( yy + zz );
+ te[ 4 ] = xy - wz;
+ te[ 8 ] = xz + wy;
+
+ te[ 1 ] = xy + wz;
+ te[ 5 ] = 1 - ( xx + zz );
+ te[ 9 ] = yz - wx;
+
+ te[ 2 ] = xz - wy;
+ te[ 6 ] = yz + wx;
+ te[ 10 ] = 1 - ( xx + yy );
+
+ // last column
+ te[ 3 ] = 0;
+ te[ 7 ] = 0;
+ te[ 11 ] = 0;
+
+ // bottom row
+ te[ 12 ] = 0;
+ te[ 13 ] = 0;
+ te[ 14 ] = 0;
+ te[ 15 ] = 1;
+
+ return this;
+
+ },
+
+ lookAt: function () {
+
+ var x = new Vector3();
+ var y = new Vector3();
+ var z = new Vector3();
+
+ return function lookAt( eye, target, up ) {
+
+ var te = this.elements;
+
+ z.subVectors( eye, target );
+
+ if ( z.lengthSq() === 0 ) {
+
+ // eye and target are in the same position
+
+ z.z = 1;
+
+ }
+
+ z.normalize();
+ x.crossVectors( up, z );
+
+ if ( x.lengthSq() === 0 ) {
+
+ // up and z are parallel
+
+ if ( Math.abs( up.z ) === 1 ) {
+
+ z.x += 0.0001;
+
+ } else {
+
+ z.z += 0.0001;
+
+ }
+
+ z.normalize();
+ x.crossVectors( up, z );
+
+ }
+
+ x.normalize();
+ y.crossVectors( z, x );
+
+ te[ 0 ] = x.x; te[ 4 ] = y.x; te[ 8 ] = z.x;
+ te[ 1 ] = x.y; te[ 5 ] = y.y; te[ 9 ] = z.y;
+ te[ 2 ] = x.z; te[ 6 ] = y.z; te[ 10 ] = z.z;
+
+ return this;
+
+ };
+
+ }(),
+
+ multiply: function ( m, n ) {
+
+ if ( n !== undefined ) {
+
+ console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' );
+ return this.multiplyMatrices( m, n );
+
+ }
+
+ return this.multiplyMatrices( this, m );
+
+ },
+
+ premultiply: function ( m ) {
+
+ return this.multiplyMatrices( m, this );
+
+ },
+
+ multiplyMatrices: function ( a, b ) {
+
+ var ae = a.elements;
+ var be = b.elements;
+ var te = this.elements;
+
+ var a11 = ae[ 0 ], a12 = ae[ 4 ], a13 = ae[ 8 ], a14 = ae[ 12 ];
+ var a21 = ae[ 1 ], a22 = ae[ 5 ], a23 = ae[ 9 ], a24 = ae[ 13 ];
+ var a31 = ae[ 2 ], a32 = ae[ 6 ], a33 = ae[ 10 ], a34 = ae[ 14 ];
+ var a41 = ae[ 3 ], a42 = ae[ 7 ], a43 = ae[ 11 ], a44 = ae[ 15 ];
+
+ var b11 = be[ 0 ], b12 = be[ 4 ], b13 = be[ 8 ], b14 = be[ 12 ];
+ var b21 = be[ 1 ], b22 = be[ 5 ], b23 = be[ 9 ], b24 = be[ 13 ];
+ var b31 = be[ 2 ], b32 = be[ 6 ], b33 = be[ 10 ], b34 = be[ 14 ];
+ var b41 = be[ 3 ], b42 = be[ 7 ], b43 = be[ 11 ], b44 = be[ 15 ];
+
+ te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;
+ te[ 4 ] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;
+ te[ 8 ] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;
+ te[ 12 ] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;
+
+ te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;
+ te[ 5 ] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;
+ te[ 9 ] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;
+ te[ 13 ] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;
+
+ te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;
+ te[ 6 ] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;
+ te[ 10 ] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;
+ te[ 14 ] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;
+
+ te[ 3 ] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;
+ te[ 7 ] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;
+ te[ 11 ] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;
+ te[ 15 ] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;
+
+ return this;
+
+ },
+
+ multiplyScalar: function ( s ) {
+
+ var te = this.elements;
+
+ te[ 0 ] *= s; te[ 4 ] *= s; te[ 8 ] *= s; te[ 12 ] *= s;
+ te[ 1 ] *= s; te[ 5 ] *= s; te[ 9 ] *= s; te[ 13 ] *= s;
+ te[ 2 ] *= s; te[ 6 ] *= s; te[ 10 ] *= s; te[ 14 ] *= s;
+ te[ 3 ] *= s; te[ 7 ] *= s; te[ 11 ] *= s; te[ 15 ] *= s;
+
+ return this;
+
+ },
+
+ applyToBufferAttribute: function () {
+
+ var v1 = new Vector3();
+
+ return function applyToBufferAttribute( attribute ) {
+
+ for ( var i = 0, l = attribute.count; i < l; i ++ ) {
+
+ v1.x = attribute.getX( i );
+ v1.y = attribute.getY( i );
+ v1.z = attribute.getZ( i );
+
+ v1.applyMatrix4( this );
+
+ attribute.setXYZ( i, v1.x, v1.y, v1.z );
+
+ }
+
+ return attribute;
+
+ };
+
+ }(),
+
+ determinant: function () {
+
+ var te = this.elements;
+
+ var n11 = te[ 0 ], n12 = te[ 4 ], n13 = te[ 8 ], n14 = te[ 12 ];
+ var n21 = te[ 1 ], n22 = te[ 5 ], n23 = te[ 9 ], n24 = te[ 13 ];
+ var n31 = te[ 2 ], n32 = te[ 6 ], n33 = te[ 10 ], n34 = te[ 14 ];
+ var n41 = te[ 3 ], n42 = te[ 7 ], n43 = te[ 11 ], n44 = te[ 15 ];
+
+ //TODO: make this more efficient
+ //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )
+
+ return (
+ n41 * (
+ + n14 * n23 * n32
+ - n13 * n24 * n32
+ - n14 * n22 * n33
+ + n12 * n24 * n33
+ + n13 * n22 * n34
+ - n12 * n23 * n34
+ ) +
+ n42 * (
+ + n11 * n23 * n34
+ - n11 * n24 * n33
+ + n14 * n21 * n33
+ - n13 * n21 * n34
+ + n13 * n24 * n31
+ - n14 * n23 * n31
+ ) +
+ n43 * (
+ + n11 * n24 * n32
+ - n11 * n22 * n34
+ - n14 * n21 * n32
+ + n12 * n21 * n34
+ + n14 * n22 * n31
+ - n12 * n24 * n31
+ ) +
+ n44 * (
+ - n13 * n22 * n31
+ - n11 * n23 * n32
+ + n11 * n22 * n33
+ + n13 * n21 * n32
+ - n12 * n21 * n33
+ + n12 * n23 * n31
+ )
+
+ );
+
+ },
+
+ transpose: function () {
+
+ var te = this.elements;
+ var tmp;
+
+ tmp = te[ 1 ]; te[ 1 ] = te[ 4 ]; te[ 4 ] = tmp;
+ tmp = te[ 2 ]; te[ 2 ] = te[ 8 ]; te[ 8 ] = tmp;
+ tmp = te[ 6 ]; te[ 6 ] = te[ 9 ]; te[ 9 ] = tmp;
+
+ tmp = te[ 3 ]; te[ 3 ] = te[ 12 ]; te[ 12 ] = tmp;
+ tmp = te[ 7 ]; te[ 7 ] = te[ 13 ]; te[ 13 ] = tmp;
+ tmp = te[ 11 ]; te[ 11 ] = te[ 14 ]; te[ 14 ] = tmp;
+
+ return this;
+
+ },
+
+ setPosition: function ( v ) {
+
+ var te = this.elements;
+
+ te[ 12 ] = v.x;
+ te[ 13 ] = v.y;
+ te[ 14 ] = v.z;
+
+ return this;
+
+ },
+
+ getInverse: function ( m, throwOnDegenerate ) {
+
+ // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
+ var te = this.elements,
+ me = m.elements,
+
+ n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ],
+ n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ],
+ n13 = me[ 8 ], n23 = me[ 9 ], n33 = me[ 10 ], n43 = me[ 11 ],
+ n14 = me[ 12 ], n24 = me[ 13 ], n34 = me[ 14 ], n44 = me[ 15 ],
+
+ t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,
+ t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,
+ t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,
+ t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;
+
+ var det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;
+
+ if ( det === 0 ) {
+
+ var msg = "THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";
+
+ if ( throwOnDegenerate === true ) {
+
+ throw new Error( msg );
+
+ } else {
+
+ console.warn( msg );
+
+ }
+
+ return this.identity();
+
+ }
+
+ var detInv = 1 / det;
+
+ te[ 0 ] = t11 * detInv;
+ te[ 1 ] = ( n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44 ) * detInv;
+ te[ 2 ] = ( n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44 ) * detInv;
+ te[ 3 ] = ( n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43 ) * detInv;
+
+ te[ 4 ] = t12 * detInv;
+ te[ 5 ] = ( n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44 ) * detInv;
+ te[ 6 ] = ( n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44 ) * detInv;
+ te[ 7 ] = ( n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43 ) * detInv;
+
+ te[ 8 ] = t13 * detInv;
+ te[ 9 ] = ( n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44 ) * detInv;
+ te[ 10 ] = ( n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44 ) * detInv;
+ te[ 11 ] = ( n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43 ) * detInv;
+
+ te[ 12 ] = t14 * detInv;
+ te[ 13 ] = ( n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34 ) * detInv;
+ te[ 14 ] = ( n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34 ) * detInv;
+ te[ 15 ] = ( n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33 ) * detInv;
+
+ return this;
+
+ },
+
+ scale: function ( v ) {
+
+ var te = this.elements;
+ var x = v.x, y = v.y, z = v.z;
+
+ te[ 0 ] *= x; te[ 4 ] *= y; te[ 8 ] *= z;
+ te[ 1 ] *= x; te[ 5 ] *= y; te[ 9 ] *= z;
+ te[ 2 ] *= x; te[ 6 ] *= y; te[ 10 ] *= z;
+ te[ 3 ] *= x; te[ 7 ] *= y; te[ 11 ] *= z;
+
+ return this;
+
+ },
+
+ getMaxScaleOnAxis: function () {
+
+ var te = this.elements;
+
+ var scaleXSq = te[ 0 ] * te[ 0 ] + te[ 1 ] * te[ 1 ] + te[ 2 ] * te[ 2 ];
+ var scaleYSq = te[ 4 ] * te[ 4 ] + te[ 5 ] * te[ 5 ] + te[ 6 ] * te[ 6 ];
+ var scaleZSq = te[ 8 ] * te[ 8 ] + te[ 9 ] * te[ 9 ] + te[ 10 ] * te[ 10 ];
+
+ return Math.sqrt( Math.max( scaleXSq, scaleYSq, scaleZSq ) );
+
+ },
+
+ makeTranslation: function ( x, y, z ) {
+
+ this.set(
+
+ 1, 0, 0, x,
+ 0, 1, 0, y,
+ 0, 0, 1, z,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ makeRotationX: function ( theta ) {
+
+ var c = Math.cos( theta ), s = Math.sin( theta );
+
+ this.set(
+
+ 1, 0, 0, 0,
+ 0, c, - s, 0,
+ 0, s, c, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ makeRotationY: function ( theta ) {
+
+ var c = Math.cos( theta ), s = Math.sin( theta );
+
+ this.set(
+
+ c, 0, s, 0,
+ 0, 1, 0, 0,
+ - s, 0, c, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ makeRotationZ: function ( theta ) {
+
+ var c = Math.cos( theta ), s = Math.sin( theta );
+
+ this.set(
+
+ c, - s, 0, 0,
+ s, c, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ makeRotationAxis: function ( axis, angle ) {
+
+ // Based on http://www.gamedev.net/reference/articles/article1199.asp
+
+ var c = Math.cos( angle );
+ var s = Math.sin( angle );
+ var t = 1 - c;
+ var x = axis.x, y = axis.y, z = axis.z;
+ var tx = t * x, ty = t * y;
+
+ this.set(
+
+ tx * x + c, tx * y - s * z, tx * z + s * y, 0,
+ tx * y + s * z, ty * y + c, ty * z - s * x, 0,
+ tx * z - s * y, ty * z + s * x, t * z * z + c, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ makeScale: function ( x, y, z ) {
+
+ this.set(
+
+ x, 0, 0, 0,
+ 0, y, 0, 0,
+ 0, 0, z, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ makeShear: function ( x, y, z ) {
+
+ this.set(
+
+ 1, y, z, 0,
+ x, 1, z, 0,
+ x, y, 1, 0,
+ 0, 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ compose: function ( position, quaternion, scale ) {
+
+ this.makeRotationFromQuaternion( quaternion );
+ this.scale( scale );
+ this.setPosition( position );
+
+ return this;
+
+ },
+
+ decompose: function () {
+
+ var vector = new Vector3();
+ var matrix = new Matrix4();
+
+ return function decompose( position, quaternion, scale ) {
+
+ var te = this.elements;
+
+ var sx = vector.set( te[ 0 ], te[ 1 ], te[ 2 ] ).length();
+ var sy = vector.set( te[ 4 ], te[ 5 ], te[ 6 ] ).length();
+ var sz = vector.set( te[ 8 ], te[ 9 ], te[ 10 ] ).length();
+
+ // if determine is negative, we need to invert one scale
+ var det = this.determinant();
+ if ( det < 0 ) sx = - sx;
+
+ position.x = te[ 12 ];
+ position.y = te[ 13 ];
+ position.z = te[ 14 ];
+
+ // scale the rotation part
+ matrix.copy( this );
+
+ var invSX = 1 / sx;
+ var invSY = 1 / sy;
+ var invSZ = 1 / sz;
+
+ matrix.elements[ 0 ] *= invSX;
+ matrix.elements[ 1 ] *= invSX;
+ matrix.elements[ 2 ] *= invSX;
+
+ matrix.elements[ 4 ] *= invSY;
+ matrix.elements[ 5 ] *= invSY;
+ matrix.elements[ 6 ] *= invSY;
+
+ matrix.elements[ 8 ] *= invSZ;
+ matrix.elements[ 9 ] *= invSZ;
+ matrix.elements[ 10 ] *= invSZ;
+
+ quaternion.setFromRotationMatrix( matrix );
+
+ scale.x = sx;
+ scale.y = sy;
+ scale.z = sz;
+
+ return this;
+
+ };
+
+ }(),
+
+ makePerspective: function ( left, right, top, bottom, near, far ) {
+
+ if ( far === undefined ) {
+
+ console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );
+
+ }
+
+ var te = this.elements;
+ var x = 2 * near / ( right - left );
+ var y = 2 * near / ( top - bottom );
+
+ var a = ( right + left ) / ( right - left );
+ var b = ( top + bottom ) / ( top - bottom );
+ var c = - ( far + near ) / ( far - near );
+ var d = - 2 * far * near / ( far - near );
+
+ te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0;
+ te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0;
+ te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
+ te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0;
+
+ return this;
+
+ },
+
+ makeOrthographic: function ( left, right, top, bottom, near, far ) {
+
+ var te = this.elements;
+ var w = 1.0 / ( right - left );
+ var h = 1.0 / ( top - bottom );
+ var p = 1.0 / ( far - near );
+
+ var x = ( right + left ) * w;
+ var y = ( top + bottom ) * h;
+ var z = ( far + near ) * p;
+
+ te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
+ te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
+ te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z;
+ te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
+
+ return this;
+
+ },
+
+ equals: function ( matrix ) {
+
+ var te = this.elements;
+ var me = matrix.elements;
+
+ for ( var i = 0; i < 16; i ++ ) {
+
+ if ( te[ i ] !== me[ i ] ) return false;
+
+ }
+
+ return true;
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ for ( var i = 0; i < 16; i ++ ) {
+
+ this.elements[ i ] = array[ i + offset ];
+
+ }
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ var te = this.elements;
+
+ array[ offset ] = te[ 0 ];
+ array[ offset + 1 ] = te[ 1 ];
+ array[ offset + 2 ] = te[ 2 ];
+ array[ offset + 3 ] = te[ 3 ];
+
+ array[ offset + 4 ] = te[ 4 ];
+ array[ offset + 5 ] = te[ 5 ];
+ array[ offset + 6 ] = te[ 6 ];
+ array[ offset + 7 ] = te[ 7 ];
+
+ array[ offset + 8 ] = te[ 8 ];
+ array[ offset + 9 ] = te[ 9 ];
+ array[ offset + 10 ] = te[ 10 ];
+ array[ offset + 11 ] = te[ 11 ];
+
+ array[ offset + 12 ] = te[ 12 ];
+ array[ offset + 13 ] = te[ 13 ];
+ array[ offset + 14 ] = te[ 14 ];
+ array[ offset + 15 ] = te[ 15 ];
+
+ return array;
+
+ }
+
+ } );
+
+ /**
+ * @author mikael emtinger / http://gomo.se/
+ * @author alteredq / http://alteredqualia.com/
+ * @author WestLangley / http://github.com/WestLangley
+ * @author bhouston / http://clara.io
+ */
+
+ function Quaternion( x, y, z, w ) {
+
+ this._x = x || 0;
+ this._y = y || 0;
+ this._z = z || 0;
+ this._w = ( w !== undefined ) ? w : 1;
+
+ }
+
+ Object.assign( Quaternion, {
+
+ slerp: function ( qa, qb, qm, t ) {
+
+ return qm.copy( qa ).slerp( qb, t );
+
+ },
+
+ slerpFlat: function ( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {
+
+ // fuzz-free, array-based Quaternion SLERP operation
+
+ var x0 = src0[ srcOffset0 + 0 ],
+ y0 = src0[ srcOffset0 + 1 ],
+ z0 = src0[ srcOffset0 + 2 ],
+ w0 = src0[ srcOffset0 + 3 ],
+
+ x1 = src1[ srcOffset1 + 0 ],
+ y1 = src1[ srcOffset1 + 1 ],
+ z1 = src1[ srcOffset1 + 2 ],
+ w1 = src1[ srcOffset1 + 3 ];
+
+ if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {
+
+ var s = 1 - t,
+
+ cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,
+
+ dir = ( cos >= 0 ? 1 : - 1 ),
+ sqrSin = 1 - cos * cos;
+
+ // Skip the Slerp for tiny steps to avoid numeric problems:
+ if ( sqrSin > Number.EPSILON ) {
+
+ var sin = Math.sqrt( sqrSin ),
+ len = Math.atan2( sin, cos * dir );
+
+ s = Math.sin( s * len ) / sin;
+ t = Math.sin( t * len ) / sin;
+
+ }
+
+ var tDir = t * dir;
+
+ x0 = x0 * s + x1 * tDir;
+ y0 = y0 * s + y1 * tDir;
+ z0 = z0 * s + z1 * tDir;
+ w0 = w0 * s + w1 * tDir;
+
+ // Normalize in case we just did a lerp:
+ if ( s === 1 - t ) {
+
+ var f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );
+
+ x0 *= f;
+ y0 *= f;
+ z0 *= f;
+ w0 *= f;
+
+ }
+
+ }
+
+ dst[ dstOffset ] = x0;
+ dst[ dstOffset + 1 ] = y0;
+ dst[ dstOffset + 2 ] = z0;
+ dst[ dstOffset + 3 ] = w0;
+
+ }
+
+ } );
+
+ Object.defineProperties( Quaternion.prototype, {
+
+ x: {
+
+ get: function () {
+
+ return this._x;
+
+ },
+
+ set: function ( value ) {
+
+ this._x = value;
+ this.onChangeCallback();
+
+ }
+
+ },
+
+ y: {
+
+ get: function () {
+
+ return this._y;
+
+ },
+
+ set: function ( value ) {
+
+ this._y = value;
+ this.onChangeCallback();
+
+ }
+
+ },
+
+ z: {
+
+ get: function () {
+
+ return this._z;
+
+ },
+
+ set: function ( value ) {
+
+ this._z = value;
+ this.onChangeCallback();
+
+ }
+
+ },
+
+ w: {
+
+ get: function () {
+
+ return this._w;
+
+ },
+
+ set: function ( value ) {
+
+ this._w = value;
+ this.onChangeCallback();
+
+ }
+
+ }
+
+ } );
+
+ Object.assign( Quaternion.prototype, {
+
+ set: function ( x, y, z, w ) {
+
+ this._x = x;
+ this._y = y;
+ this._z = z;
+ this._w = w;
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ clone: function () {
+
+ return new this.constructor( this._x, this._y, this._z, this._w );
+
+ },
+
+ copy: function ( quaternion ) {
+
+ this._x = quaternion.x;
+ this._y = quaternion.y;
+ this._z = quaternion.z;
+ this._w = quaternion.w;
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ setFromEuler: function ( euler, update ) {
+
+ if ( ! ( euler && euler.isEuler ) ) {
+
+ throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );
+
+ }
+
+ var x = euler._x, y = euler._y, z = euler._z, order = euler.order;
+
+ // http://www.mathworks.com/matlabcentral/fileexchange/
+ // 20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/
+ // content/SpinCalc.m
+
+ var cos = Math.cos;
+ var sin = Math.sin;
+
+ var c1 = cos( x / 2 );
+ var c2 = cos( y / 2 );
+ var c3 = cos( z / 2 );
+
+ var s1 = sin( x / 2 );
+ var s2 = sin( y / 2 );
+ var s3 = sin( z / 2 );
+
+ if ( order === 'XYZ' ) {
+
+ this._x = s1 * c2 * c3 + c1 * s2 * s3;
+ this._y = c1 * s2 * c3 - s1 * c2 * s3;
+ this._z = c1 * c2 * s3 + s1 * s2 * c3;
+ this._w = c1 * c2 * c3 - s1 * s2 * s3;
+
+ } else if ( order === 'YXZ' ) {
+
+ this._x = s1 * c2 * c3 + c1 * s2 * s3;
+ this._y = c1 * s2 * c3 - s1 * c2 * s3;
+ this._z = c1 * c2 * s3 - s1 * s2 * c3;
+ this._w = c1 * c2 * c3 + s1 * s2 * s3;
+
+ } else if ( order === 'ZXY' ) {
+
+ this._x = s1 * c2 * c3 - c1 * s2 * s3;
+ this._y = c1 * s2 * c3 + s1 * c2 * s3;
+ this._z = c1 * c2 * s3 + s1 * s2 * c3;
+ this._w = c1 * c2 * c3 - s1 * s2 * s3;
+
+ } else if ( order === 'ZYX' ) {
+
+ this._x = s1 * c2 * c3 - c1 * s2 * s3;
+ this._y = c1 * s2 * c3 + s1 * c2 * s3;
+ this._z = c1 * c2 * s3 - s1 * s2 * c3;
+ this._w = c1 * c2 * c3 + s1 * s2 * s3;
+
+ } else if ( order === 'YZX' ) {
+
+ this._x = s1 * c2 * c3 + c1 * s2 * s3;
+ this._y = c1 * s2 * c3 + s1 * c2 * s3;
+ this._z = c1 * c2 * s3 - s1 * s2 * c3;
+ this._w = c1 * c2 * c3 - s1 * s2 * s3;
+
+ } else if ( order === 'XZY' ) {
+
+ this._x = s1 * c2 * c3 - c1 * s2 * s3;
+ this._y = c1 * s2 * c3 - s1 * c2 * s3;
+ this._z = c1 * c2 * s3 + s1 * s2 * c3;
+ this._w = c1 * c2 * c3 + s1 * s2 * s3;
+
+ }
+
+ if ( update !== false ) this.onChangeCallback();
+
+ return this;
+
+ },
+
+ setFromAxisAngle: function ( axis, angle ) {
+
+ // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm
+
+ // assumes axis is normalized
+
+ var halfAngle = angle / 2, s = Math.sin( halfAngle );
+
+ this._x = axis.x * s;
+ this._y = axis.y * s;
+ this._z = axis.z * s;
+ this._w = Math.cos( halfAngle );
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ setFromRotationMatrix: function ( m ) {
+
+ // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
+
+ // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
+
+ var te = m.elements,
+
+ m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],
+ m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],
+ m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ],
+
+ trace = m11 + m22 + m33,
+ s;
+
+ if ( trace > 0 ) {
+
+ s = 0.5 / Math.sqrt( trace + 1.0 );
+
+ this._w = 0.25 / s;
+ this._x = ( m32 - m23 ) * s;
+ this._y = ( m13 - m31 ) * s;
+ this._z = ( m21 - m12 ) * s;
+
+ } else if ( m11 > m22 && m11 > m33 ) {
+
+ s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );
+
+ this._w = ( m32 - m23 ) / s;
+ this._x = 0.25 * s;
+ this._y = ( m12 + m21 ) / s;
+ this._z = ( m13 + m31 ) / s;
+
+ } else if ( m22 > m33 ) {
+
+ s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );
+
+ this._w = ( m13 - m31 ) / s;
+ this._x = ( m12 + m21 ) / s;
+ this._y = 0.25 * s;
+ this._z = ( m23 + m32 ) / s;
+
+ } else {
+
+ s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );
+
+ this._w = ( m21 - m12 ) / s;
+ this._x = ( m13 + m31 ) / s;
+ this._y = ( m23 + m32 ) / s;
+ this._z = 0.25 * s;
+
+ }
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ setFromUnitVectors: function () {
+
+ // assumes direction vectors vFrom and vTo are normalized
+
+ var v1 = new Vector3();
+ var r;
+
+ var EPS = 0.000001;
+
+ return function setFromUnitVectors( vFrom, vTo ) {
+
+ if ( v1 === undefined ) v1 = new Vector3();
+
+ r = vFrom.dot( vTo ) + 1;
+
+ if ( r < EPS ) {
+
+ r = 0;
+
+ if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {
+
+ v1.set( - vFrom.y, vFrom.x, 0 );
+
+ } else {
+
+ v1.set( 0, - vFrom.z, vFrom.y );
+
+ }
+
+ } else {
+
+ v1.crossVectors( vFrom, vTo );
+
+ }
+
+ this._x = v1.x;
+ this._y = v1.y;
+ this._z = v1.z;
+ this._w = r;
+
+ return this.normalize();
+
+ };
+
+ }(),
+
+ inverse: function () {
+
+ return this.conjugate().normalize();
+
+ },
+
+ conjugate: function () {
+
+ this._x *= - 1;
+ this._y *= - 1;
+ this._z *= - 1;
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ dot: function ( v ) {
+
+ return this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;
+
+ },
+
+ lengthSq: function () {
+
+ return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
+
+ },
+
+ length: function () {
+
+ return Math.sqrt( this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w );
+
+ },
+
+ normalize: function () {
+
+ var l = this.length();
+
+ if ( l === 0 ) {
+
+ this._x = 0;
+ this._y = 0;
+ this._z = 0;
+ this._w = 1;
+
+ } else {
+
+ l = 1 / l;
+
+ this._x = this._x * l;
+ this._y = this._y * l;
+ this._z = this._z * l;
+ this._w = this._w * l;
+
+ }
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ multiply: function ( q, p ) {
+
+ if ( p !== undefined ) {
+
+ console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' );
+ return this.multiplyQuaternions( q, p );
+
+ }
+
+ return this.multiplyQuaternions( this, q );
+
+ },
+
+ premultiply: function ( q ) {
+
+ return this.multiplyQuaternions( q, this );
+
+ },
+
+ multiplyQuaternions: function ( a, b ) {
+
+ // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
+
+ var qax = a._x, qay = a._y, qaz = a._z, qaw = a._w;
+ var qbx = b._x, qby = b._y, qbz = b._z, qbw = b._w;
+
+ this._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;
+ this._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;
+ this._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;
+ this._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ slerp: function ( qb, t ) {
+
+ if ( t === 0 ) return this;
+ if ( t === 1 ) return this.copy( qb );
+
+ var x = this._x, y = this._y, z = this._z, w = this._w;
+
+ // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/
+
+ var cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;
+
+ if ( cosHalfTheta < 0 ) {
+
+ this._w = - qb._w;
+ this._x = - qb._x;
+ this._y = - qb._y;
+ this._z = - qb._z;
+
+ cosHalfTheta = - cosHalfTheta;
+
+ } else {
+
+ this.copy( qb );
+
+ }
+
+ if ( cosHalfTheta >= 1.0 ) {
+
+ this._w = w;
+ this._x = x;
+ this._y = y;
+ this._z = z;
+
+ return this;
+
+ }
+
+ var sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta );
+
+ if ( Math.abs( sinHalfTheta ) < 0.001 ) {
+
+ this._w = 0.5 * ( w + this._w );
+ this._x = 0.5 * ( x + this._x );
+ this._y = 0.5 * ( y + this._y );
+ this._z = 0.5 * ( z + this._z );
+
+ return this;
+
+ }
+
+ var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );
+ var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,
+ ratioB = Math.sin( t * halfTheta ) / sinHalfTheta;
+
+ this._w = ( w * ratioA + this._w * ratioB );
+ this._x = ( x * ratioA + this._x * ratioB );
+ this._y = ( y * ratioA + this._y * ratioB );
+ this._z = ( z * ratioA + this._z * ratioB );
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ equals: function ( quaternion ) {
+
+ return ( quaternion._x === this._x ) && ( quaternion._y === this._y ) && ( quaternion._z === this._z ) && ( quaternion._w === this._w );
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ this._x = array[ offset ];
+ this._y = array[ offset + 1 ];
+ this._z = array[ offset + 2 ];
+ this._w = array[ offset + 3 ];
+
+ this.onChangeCallback();
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ array[ offset ] = this._x;
+ array[ offset + 1 ] = this._y;
+ array[ offset + 2 ] = this._z;
+ array[ offset + 3 ] = this._w;
+
+ return array;
+
+ },
+
+ onChange: function ( callback ) {
+
+ this.onChangeCallback = callback;
+
+ return this;
+
+ },
+
+ onChangeCallback: function () {}
+
+ } );
+
+ /**
+ * @author mrdoob / http://mrdoob.com/
+ * @author kile / http://kile.stravaganza.org/
+ * @author philogb / http://blog.thejit.org/
+ * @author mikael emtinger / http://gomo.se/
+ * @author egraether / http://egraether.com/
+ * @author WestLangley / http://github.com/WestLangley
+ */
+
+ function Vector3( x, y, z ) {
+
+ this.x = x || 0;
+ this.y = y || 0;
+ this.z = z || 0;
+
+ }
+
+ Object.assign( Vector3.prototype, {
+
+ isVector3: true,
+
+ set: function ( x, y, z ) {
+
+ this.x = x;
+ this.y = y;
+ this.z = z;
+
+ return this;
+
+ },
+
+ setScalar: function ( scalar ) {
+
+ this.x = scalar;
+ this.y = scalar;
+ this.z = scalar;
+
+ return this;
+
+ },
+
+ setX: function ( x ) {
+
+ this.x = x;
+
+ return this;
+
+ },
+
+ setY: function ( y ) {
+
+ this.y = y;
+
+ return this;
+
+ },
+
+ setZ: function ( z ) {
+
+ this.z = z;
+
+ return this;
+
+ },
+
+ setComponent: function ( index, value ) {
+
+ switch ( index ) {
+
+ case 0: this.x = value; break;
+ case 1: this.y = value; break;
+ case 2: this.z = value; break;
+ default: throw new Error( 'index is out of range: ' + index );
+
+ }
+
+ return this;
+
+ },
+
+ getComponent: function ( index ) {
+
+ switch ( index ) {
+
+ case 0: return this.x;
+ case 1: return this.y;
+ case 2: return this.z;
+ default: throw new Error( 'index is out of range: ' + index );
+
+ }
+
+ },
+
+ clone: function () {
+
+ return new this.constructor( this.x, this.y, this.z );
+
+ },
+
+ copy: function ( v ) {
+
+ this.x = v.x;
+ this.y = v.y;
+ this.z = v.z;
+
+ return this;
+
+ },
+
+ add: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
+ return this.addVectors( v, w );
+
+ }
+
+ this.x += v.x;
+ this.y += v.y;
+ this.z += v.z;
+
+ return this;
+
+ },
+
+ addScalar: function ( s ) {
+
+ this.x += s;
+ this.y += s;
+ this.z += s;
+
+ return this;
+
+ },
+
+ addVectors: function ( a, b ) {
+
+ this.x = a.x + b.x;
+ this.y = a.y + b.y;
+ this.z = a.z + b.z;
+
+ return this;
+
+ },
+
+ addScaledVector: function ( v, s ) {
+
+ this.x += v.x * s;
+ this.y += v.y * s;
+ this.z += v.z * s;
+
+ return this;
+
+ },
+
+ sub: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
+ return this.subVectors( v, w );
+
+ }
+
+ this.x -= v.x;
+ this.y -= v.y;
+ this.z -= v.z;
+
+ return this;
+
+ },
+
+ subScalar: function ( s ) {
+
+ this.x -= s;
+ this.y -= s;
+ this.z -= s;
+
+ return this;
+
+ },
+
+ subVectors: function ( a, b ) {
+
+ this.x = a.x - b.x;
+ this.y = a.y - b.y;
+ this.z = a.z - b.z;
+
+ return this;
+
+ },
+
+ multiply: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' );
+ return this.multiplyVectors( v, w );
+
+ }
+
+ this.x *= v.x;
+ this.y *= v.y;
+ this.z *= v.z;
+
+ return this;
+
+ },
+
+ multiplyScalar: function ( scalar ) {
+
+ this.x *= scalar;
+ this.y *= scalar;
+ this.z *= scalar;
+
+ return this;
+
+ },
+
+ multiplyVectors: function ( a, b ) {
+
+ this.x = a.x * b.x;
+ this.y = a.y * b.y;
+ this.z = a.z * b.z;
+
+ return this;
+
+ },
+
+ applyEuler: function () {
+
+ var quaternion = new Quaternion();
+
+ return function applyEuler( euler ) {
+
+ if ( ! ( euler && euler.isEuler ) ) {
+
+ console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );
+
+ }
+
+ return this.applyQuaternion( quaternion.setFromEuler( euler ) );
+
+ };
+
+ }(),
+
+ applyAxisAngle: function () {
+
+ var quaternion = new Quaternion();
+
+ return function applyAxisAngle( axis, angle ) {
+
+ return this.applyQuaternion( quaternion.setFromAxisAngle( axis, angle ) );
+
+ };
+
+ }(),
+
+ applyMatrix3: function ( m ) {
+
+ var x = this.x, y = this.y, z = this.z;
+ var e = m.elements;
+
+ this.x = e[ 0 ] * x + e[ 3 ] * y + e[ 6 ] * z;
+ this.y = e[ 1 ] * x + e[ 4 ] * y + e[ 7 ] * z;
+ this.z = e[ 2 ] * x + e[ 5 ] * y + e[ 8 ] * z;
+
+ return this;
+
+ },
+
+ applyMatrix4: function ( m ) {
+
+ var x = this.x, y = this.y, z = this.z;
+ var e = m.elements;
+
+ var w = 1 / ( e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] );
+
+ this.x = ( e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] ) * w;
+ this.y = ( e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] ) * w;
+ this.z = ( e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] ) * w;
+
+ return this;
+
+ },
+
+ applyQuaternion: function ( q ) {
+
+ var x = this.x, y = this.y, z = this.z;
+ var qx = q.x, qy = q.y, qz = q.z, qw = q.w;
+
+ // calculate quat * vector
+
+ var ix = qw * x + qy * z - qz * y;
+ var iy = qw * y + qz * x - qx * z;
+ var iz = qw * z + qx * y - qy * x;
+ var iw = - qx * x - qy * y - qz * z;
+
+ // calculate result * inverse quat
+
+ this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy;
+ this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz;
+ this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx;
+
+ return this;
+
+ },
+
+ project: function () {
+
+ var matrix = new Matrix4();
+
+ return function project( camera ) {
+
+ matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) );
+ return this.applyMatrix4( matrix );
+
+ };
+
+ }(),
+
+ unproject: function () {
+
+ var matrix = new Matrix4();
+
+ return function unproject( camera ) {
+
+ matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) );
+ return this.applyMatrix4( matrix );
+
+ };
+
+ }(),
+
+ transformDirection: function ( m ) {
+
+ // input: THREE.Matrix4 affine matrix
+ // vector interpreted as a direction
+
+ var x = this.x, y = this.y, z = this.z;
+ var e = m.elements;
+
+ this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z;
+ this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z;
+ this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z;
+
+ return this.normalize();
+
+ },
+
+ divide: function ( v ) {
+
+ this.x /= v.x;
+ this.y /= v.y;
+ this.z /= v.z;
+
+ return this;
+
+ },
+
+ divideScalar: function ( scalar ) {
+
+ return this.multiplyScalar( 1 / scalar );
+
+ },
+
+ min: function ( v ) {
+
+ this.x = Math.min( this.x, v.x );
+ this.y = Math.min( this.y, v.y );
+ this.z = Math.min( this.z, v.z );
+
+ return this;
+
+ },
+
+ max: function ( v ) {
+
+ this.x = Math.max( this.x, v.x );
+ this.y = Math.max( this.y, v.y );
+ this.z = Math.max( this.z, v.z );
+
+ return this;
+
+ },
+
+ clamp: function ( min, max ) {
+
+ // assumes min < max, componentwise
+
+ this.x = Math.max( min.x, Math.min( max.x, this.x ) );
+ this.y = Math.max( min.y, Math.min( max.y, this.y ) );
+ this.z = Math.max( min.z, Math.min( max.z, this.z ) );
+
+ return this;
+
+ },
+
+ clampScalar: function () {
+
+ var min = new Vector3();
+ var max = new Vector3();
+
+ return function clampScalar( minVal, maxVal ) {
+
+ min.set( minVal, minVal, minVal );
+ max.set( maxVal, maxVal, maxVal );
+
+ return this.clamp( min, max );
+
+ };
+
+ }(),
+
+ clampLength: function ( min, max ) {
+
+ var length = this.length();
+
+ return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );
+
+ },
+
+ floor: function () {
+
+ this.x = Math.floor( this.x );
+ this.y = Math.floor( this.y );
+ this.z = Math.floor( this.z );
+
+ return this;
+
+ },
+
+ ceil: function () {
+
+ this.x = Math.ceil( this.x );
+ this.y = Math.ceil( this.y );
+ this.z = Math.ceil( this.z );
+
+ return this;
+
+ },
+
+ round: function () {
+
+ this.x = Math.round( this.x );
+ this.y = Math.round( this.y );
+ this.z = Math.round( this.z );
+
+ return this;
+
+ },
+
+ roundToZero: function () {
+
+ this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );
+ this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );
+ this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );
+
+ return this;
+
+ },
+
+ negate: function () {
+
+ this.x = - this.x;
+ this.y = - this.y;
+ this.z = - this.z;
+
+ return this;
+
+ },
+
+ dot: function ( v ) {
+
+ return this.x * v.x + this.y * v.y + this.z * v.z;
+
+ },
+
+ // TODO lengthSquared?
+
+ lengthSq: function () {
+
+ return this.x * this.x + this.y * this.y + this.z * this.z;
+
+ },
+
+ length: function () {
+
+ return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );
+
+ },
+
+ manhattanLength: function () {
+
+ return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z );
+
+ },
+
+ normalize: function () {
+
+ return this.divideScalar( this.length() || 1 );
+
+ },
+
+ setLength: function ( length ) {
+
+ return this.normalize().multiplyScalar( length );
+
+ },
+
+ lerp: function ( v, alpha ) {
+
+ this.x += ( v.x - this.x ) * alpha;
+ this.y += ( v.y - this.y ) * alpha;
+ this.z += ( v.z - this.z ) * alpha;
+
+ return this;
+
+ },
+
+ lerpVectors: function ( v1, v2, alpha ) {
+
+ return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );
+
+ },
+
+ cross: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' );
+ return this.crossVectors( v, w );
+
+ }
+
+ return this.crossVectors( this, v );
+
+ },
+
+ crossVectors: function ( a, b ) {
+
+ var ax = a.x, ay = a.y, az = a.z;
+ var bx = b.x, by = b.y, bz = b.z;
+
+ this.x = ay * bz - az * by;
+ this.y = az * bx - ax * bz;
+ this.z = ax * by - ay * bx;
+
+ return this;
+
+ },
+
+ projectOnVector: function ( vector ) {
+
+ var scalar = vector.dot( this ) / vector.lengthSq();
+
+ return this.copy( vector ).multiplyScalar( scalar );
+
+ },
+
+ projectOnPlane: function () {
+
+ var v1 = new Vector3();
+
+ return function projectOnPlane( planeNormal ) {
+
+ v1.copy( this ).projectOnVector( planeNormal );
+
+ return this.sub( v1 );
+
+ };
+
+ }(),
+
+ reflect: function () {
+
+ // reflect incident vector off plane orthogonal to normal
+ // normal is assumed to have unit length
+
+ var v1 = new Vector3();
+
+ return function reflect( normal ) {
+
+ return this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );
+
+ };
+
+ }(),
+
+ angleTo: function ( v ) {
+
+ var theta = this.dot( v ) / ( Math.sqrt( this.lengthSq() * v.lengthSq() ) );
+
+ // clamp, to handle numerical problems
+
+ return Math.acos( _Math.clamp( theta, - 1, 1 ) );
+
+ },
+
+ distanceTo: function ( v ) {
+
+ return Math.sqrt( this.distanceToSquared( v ) );
+
+ },
+
+ distanceToSquared: function ( v ) {
+
+ var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;
+
+ return dx * dx + dy * dy + dz * dz;
+
+ },
+
+ manhattanDistanceTo: function ( v ) {
+
+ return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );
+
+ },
+
+ setFromSpherical: function ( s ) {
+
+ var sinPhiRadius = Math.sin( s.phi ) * s.radius;
+
+ this.x = sinPhiRadius * Math.sin( s.theta );
+ this.y = Math.cos( s.phi ) * s.radius;
+ this.z = sinPhiRadius * Math.cos( s.theta );
+
+ return this;
+
+ },
+
+ setFromCylindrical: function ( c ) {
+
+ this.x = c.radius * Math.sin( c.theta );
+ this.y = c.y;
+ this.z = c.radius * Math.cos( c.theta );
+
+ return this;
+
+ },
+
+ setFromMatrixPosition: function ( m ) {
+
+ var e = m.elements;
+
+ this.x = e[ 12 ];
+ this.y = e[ 13 ];
+ this.z = e[ 14 ];
+
+ return this;
+
+ },
+
+ setFromMatrixScale: function ( m ) {
+
+ var sx = this.setFromMatrixColumn( m, 0 ).length();
+ var sy = this.setFromMatrixColumn( m, 1 ).length();
+ var sz = this.setFromMatrixColumn( m, 2 ).length();
+
+ this.x = sx;
+ this.y = sy;
+ this.z = sz;
+
+ return this;
+
+ },
+
+ setFromMatrixColumn: function ( m, index ) {
+
+ return this.fromArray( m.elements, index * 4 );
+
+ },
+
+ equals: function ( v ) {
+
+ return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) );
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ this.x = array[ offset ];
+ this.y = array[ offset + 1 ];
+ this.z = array[ offset + 2 ];
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ array[ offset ] = this.x;
+ array[ offset + 1 ] = this.y;
+ array[ offset + 2 ] = this.z;
+
+ return array;
+
+ },
+
+ fromBufferAttribute: function ( attribute, index, offset ) {
+
+ if ( offset !== undefined ) {
+
+ console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' );
+
+ }
+
+ this.x = attribute.getX( index );
+ this.y = attribute.getY( index );
+ this.z = attribute.getZ( index );
+
+ return this;
+
+ }
+
+ } );
+
+ /**
+ * @author alteredq / http://alteredqualia.com/
+ * @author WestLangley / http://github.com/WestLangley
+ * @author bhouston / http://clara.io
+ * @author tschw
+ */
+
+ function Matrix3() {
+
+ this.elements = [
+
+ 1, 0, 0,
+ 0, 1, 0,
+ 0, 0, 1
+
+ ];
+
+ if ( arguments.length > 0 ) {
+
+ console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' );
+
+ }
+
+ }
+
+ Object.assign( Matrix3.prototype, {
+
+ isMatrix3: true,
+
+ set: function ( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
+
+ var te = this.elements;
+
+ te[ 0 ] = n11; te[ 1 ] = n21; te[ 2 ] = n31;
+ te[ 3 ] = n12; te[ 4 ] = n22; te[ 5 ] = n32;
+ te[ 6 ] = n13; te[ 7 ] = n23; te[ 8 ] = n33;
+
+ return this;
+
+ },
+
+ identity: function () {
+
+ this.set(
+
+ 1, 0, 0,
+ 0, 1, 0,
+ 0, 0, 1
+
+ );
+
+ return this;
+
+ },
+
+ clone: function () {
+
+ return new this.constructor().fromArray( this.elements );
+
+ },
+
+ copy: function ( m ) {
+
+ var te = this.elements;
+ var me = m.elements;
+
+ te[ 0 ] = me[ 0 ]; te[ 1 ] = me[ 1 ]; te[ 2 ] = me[ 2 ];
+ te[ 3 ] = me[ 3 ]; te[ 4 ] = me[ 4 ]; te[ 5 ] = me[ 5 ];
+ te[ 6 ] = me[ 6 ]; te[ 7 ] = me[ 7 ]; te[ 8 ] = me[ 8 ];
+
+ return this;
+
+ },
+
+ setFromMatrix4: function ( m ) {
+
+ var me = m.elements;
+
+ this.set(
+
+ me[ 0 ], me[ 4 ], me[ 8 ],
+ me[ 1 ], me[ 5 ], me[ 9 ],
+ me[ 2 ], me[ 6 ], me[ 10 ]
+
+ );
+
+ return this;
+
+ },
+
+ applyToBufferAttribute: function () {
+
+ var v1 = new Vector3();
+
+ return function applyToBufferAttribute( attribute ) {
+
+ for ( var i = 0, l = attribute.count; i < l; i ++ ) {
+
+ v1.x = attribute.getX( i );
+ v1.y = attribute.getY( i );
+ v1.z = attribute.getZ( i );
+
+ v1.applyMatrix3( this );
+
+ attribute.setXYZ( i, v1.x, v1.y, v1.z );
+
+ }
+
+ return attribute;
+
+ };
+
+ }(),
+
+ multiply: function ( m ) {
+
+ return this.multiplyMatrices( this, m );
+
+ },
+
+ premultiply: function ( m ) {
+
+ return this.multiplyMatrices( m, this );
+
+ },
+
+ multiplyMatrices: function ( a, b ) {
+
+ var ae = a.elements;
+ var be = b.elements;
+ var te = this.elements;
+
+ var a11 = ae[ 0 ], a12 = ae[ 3 ], a13 = ae[ 6 ];
+ var a21 = ae[ 1 ], a22 = ae[ 4 ], a23 = ae[ 7 ];
+ var a31 = ae[ 2 ], a32 = ae[ 5 ], a33 = ae[ 8 ];
+
+ var b11 = be[ 0 ], b12 = be[ 3 ], b13 = be[ 6 ];
+ var b21 = be[ 1 ], b22 = be[ 4 ], b23 = be[ 7 ];
+ var b31 = be[ 2 ], b32 = be[ 5 ], b33 = be[ 8 ];
+
+ te[ 0 ] = a11 * b11 + a12 * b21 + a13 * b31;
+ te[ 3 ] = a11 * b12 + a12 * b22 + a13 * b32;
+ te[ 6 ] = a11 * b13 + a12 * b23 + a13 * b33;
+
+ te[ 1 ] = a21 * b11 + a22 * b21 + a23 * b31;
+ te[ 4 ] = a21 * b12 + a22 * b22 + a23 * b32;
+ te[ 7 ] = a21 * b13 + a22 * b23 + a23 * b33;
+
+ te[ 2 ] = a31 * b11 + a32 * b21 + a33 * b31;
+ te[ 5 ] = a31 * b12 + a32 * b22 + a33 * b32;
+ te[ 8 ] = a31 * b13 + a32 * b23 + a33 * b33;
+
+ return this;
+
+ },
+
+ multiplyScalar: function ( s ) {
+
+ var te = this.elements;
+
+ te[ 0 ] *= s; te[ 3 ] *= s; te[ 6 ] *= s;
+ te[ 1 ] *= s; te[ 4 ] *= s; te[ 7 ] *= s;
+ te[ 2 ] *= s; te[ 5 ] *= s; te[ 8 ] *= s;
+
+ return this;
+
+ },
+
+ determinant: function () {
+
+ var te = this.elements;
+
+ var a = te[ 0 ], b = te[ 1 ], c = te[ 2 ],
+ d = te[ 3 ], e = te[ 4 ], f = te[ 5 ],
+ g = te[ 6 ], h = te[ 7 ], i = te[ 8 ];
+
+ return a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;
+
+ },
+
+ getInverse: function ( matrix, throwOnDegenerate ) {
+
+ if ( matrix && matrix.isMatrix4 ) {
+
+ console.error( "THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument." );
+
+ }
+
+ var me = matrix.elements,
+ te = this.elements,
+
+ n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ],
+ n12 = me[ 3 ], n22 = me[ 4 ], n32 = me[ 5 ],
+ n13 = me[ 6 ], n23 = me[ 7 ], n33 = me[ 8 ],
+
+ t11 = n33 * n22 - n32 * n23,
+ t12 = n32 * n13 - n33 * n12,
+ t13 = n23 * n12 - n22 * n13,
+
+ det = n11 * t11 + n21 * t12 + n31 * t13;
+
+ if ( det === 0 ) {
+
+ var msg = "THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";
+
+ if ( throwOnDegenerate === true ) {
+
+ throw new Error( msg );
+
+ } else {
+
+ console.warn( msg );
+
+ }
+
+ return this.identity();
+
+ }
+
+ var detInv = 1 / det;
+
+ te[ 0 ] = t11 * detInv;
+ te[ 1 ] = ( n31 * n23 - n33 * n21 ) * detInv;
+ te[ 2 ] = ( n32 * n21 - n31 * n22 ) * detInv;
+
+ te[ 3 ] = t12 * detInv;
+ te[ 4 ] = ( n33 * n11 - n31 * n13 ) * detInv;
+ te[ 5 ] = ( n31 * n12 - n32 * n11 ) * detInv;
+
+ te[ 6 ] = t13 * detInv;
+ te[ 7 ] = ( n21 * n13 - n23 * n11 ) * detInv;
+ te[ 8 ] = ( n22 * n11 - n21 * n12 ) * detInv;
+
+ return this;
+
+ },
+
+ transpose: function () {
+
+ var tmp, m = this.elements;
+
+ tmp = m[ 1 ]; m[ 1 ] = m[ 3 ]; m[ 3 ] = tmp;
+ tmp = m[ 2 ]; m[ 2 ] = m[ 6 ]; m[ 6 ] = tmp;
+ tmp = m[ 5 ]; m[ 5 ] = m[ 7 ]; m[ 7 ] = tmp;
+
+ return this;
+
+ },
+
+ getNormalMatrix: function ( matrix4 ) {
+
+ return this.setFromMatrix4( matrix4 ).getInverse( this ).transpose();
+
+ },
+
+ transposeIntoArray: function ( r ) {
+
+ var m = this.elements;
+
+ r[ 0 ] = m[ 0 ];
+ r[ 1 ] = m[ 3 ];
+ r[ 2 ] = m[ 6 ];
+ r[ 3 ] = m[ 1 ];
+ r[ 4 ] = m[ 4 ];
+ r[ 5 ] = m[ 7 ];
+ r[ 6 ] = m[ 2 ];
+ r[ 7 ] = m[ 5 ];
+ r[ 8 ] = m[ 8 ];
+
+ return this;
+
+ },
+
+ setUvTransform: function ( tx, ty, sx, sy, rotation, cx, cy ) {
+
+ var c = Math.cos( rotation );
+ var s = Math.sin( rotation );
+
+ this.set(
+ sx * c, sx * s, - sx * ( c * cx + s * cy ) + cx + tx,
+ - sy * s, sy * c, - sy * ( - s * cx + c * cy ) + cy + ty,
+ 0, 0, 1
+ );
+
+ },
+
+ scale: function ( sx, sy ) {
+
+ var te = this.elements;
+
+ te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx;
+ te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy;
+
+ return this;
+
+ },
+
+ rotate: function ( theta ) {
+
+ var c = Math.cos( theta );
+ var s = Math.sin( theta );
+
+ var te = this.elements;
+
+ var a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ];
+ var a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ];
+
+ te[ 0 ] = c * a11 + s * a21;
+ te[ 3 ] = c * a12 + s * a22;
+ te[ 6 ] = c * a13 + s * a23;
+
+ te[ 1 ] = - s * a11 + c * a21;
+ te[ 4 ] = - s * a12 + c * a22;
+ te[ 7 ] = - s * a13 + c * a23;
+
+ return this;
+
+ },
+
+ translate: function ( tx, ty ) {
+
+ var te = this.elements;
+
+ te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ];
+ te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ];
+
+ return this;
+
+ },
+
+ equals: function ( matrix ) {
+
+ var te = this.elements;
+ var me = matrix.elements;
+
+ for ( var i = 0; i < 9; i ++ ) {
+
+ if ( te[ i ] !== me[ i ] ) return false;
+
+ }
+
+ return true;
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ for ( var i = 0; i < 9; i ++ ) {
+
+ this.elements[ i ] = array[ i + offset ];
+
+ }
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ var te = this.elements;
+
+ array[ offset ] = te[ 0 ];
+ array[ offset + 1 ] = te[ 1 ];
+ array[ offset + 2 ] = te[ 2 ];
+
+ array[ offset + 3 ] = te[ 3 ];
+ array[ offset + 4 ] = te[ 4 ];
+ array[ offset + 5 ] = te[ 5 ];
+
+ array[ offset + 6 ] = te[ 6 ];
+ array[ offset + 7 ] = te[ 7 ];
+ array[ offset + 8 ] = te[ 8 ];
+
+ return array;
+
+ }
+
+ } );
+
+ /**
+ * @author mrdoob / http://mrdoob.com/
+ * @author alteredq / http://alteredqualia.com/
+ * @author szimek / https://github.com/szimek/
+ */
+
+ var textureId = 0;
+
+ function Texture( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
+
+ Object.defineProperty( this, 'id', { value: textureId ++ } );
+
+ this.uuid = _Math.generateUUID();
+
+ this.name = '';
+
+ this.image = image !== undefined ? image : Texture.DEFAULT_IMAGE;
+ this.mipmaps = [];
+
+ this.mapping = mapping !== undefined ? mapping : Texture.DEFAULT_MAPPING;
+
+ this.wrapS = wrapS !== undefined ? wrapS : ClampToEdgeWrapping;
+ this.wrapT = wrapT !== undefined ? wrapT : ClampToEdgeWrapping;
+
+ this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
+ this.minFilter = minFilter !== undefined ? minFilter : LinearMipMapLinearFilter;
+
+ this.anisotropy = anisotropy !== undefined ? anisotropy : 1;
+
+ this.format = format !== undefined ? format : RGBAFormat;
+ this.type = type !== undefined ? type : UnsignedByteType;
+
+ this.offset = new Vector2( 0, 0 );
+ this.repeat = new Vector2( 1, 1 );
+ this.center = new Vector2( 0, 0 );
+ this.rotation = 0;
+
+ this.matrixAutoUpdate = true;
+ this.matrix = new Matrix3();
+
+ this.generateMipmaps = true;
+ this.premultiplyAlpha = false;
+ this.flipY = true;
+ this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
+
+ // Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.
+ //
+ // Also changing the encoding after already used by a Material will not automatically make the Material
+ // update. You need to explicitly call Material.needsUpdate to trigger it to recompile.
+ this.encoding = encoding !== undefined ? encoding : LinearEncoding;
+
+ this.version = 0;
+ this.onUpdate = null;
+
+ }
+
+ Texture.DEFAULT_IMAGE = undefined;
+ Texture.DEFAULT_MAPPING = UVMapping;
+
+ Object.defineProperty( Texture.prototype, "needsUpdate", {
+
+ set: function ( value ) {
+
+ if ( value === true ) this.version ++;
+
+ }
+
+ } );
+
+ Object.assign( Texture.prototype, EventDispatcher.prototype, {
+
+ constructor: Texture,
+
+ isTexture: true,
+
+ clone: function () {
+
+ return new this.constructor().copy( this );
+
+ },
+
+ copy: function ( source ) {
+
+ this.name = source.name;
+
+ this.image = source.image;
+ this.mipmaps = source.mipmaps.slice( 0 );
+
+ this.mapping = source.mapping;
+
+ this.wrapS = source.wrapS;
+ this.wrapT = source.wrapT;
+
+ this.magFilter = source.magFilter;
+ this.minFilter = source.minFilter;
+
+ this.anisotropy = source.anisotropy;
+
+ this.format = source.format;
+ this.type = source.type;
+
+ this.offset.copy( source.offset );
+ this.repeat.copy( source.repeat );
+ this.center.copy( source.center );
+ this.rotation = source.rotation;
+
+ this.matrixAutoUpdate = source.matrixAutoUpdate;
+ this.matrix.copy( source.matrix );
+
+ this.generateMipmaps = source.generateMipmaps;
+ this.premultiplyAlpha = source.premultiplyAlpha;
+ this.flipY = source.flipY;
+ this.unpackAlignment = source.unpackAlignment;
+ this.encoding = source.encoding;
+
+ return this;
+
+ },
+
+ toJSON: function ( meta ) {
+
+ var isRootObject = ( meta === undefined || typeof meta === 'string' );
+
+ if ( ! isRootObject && meta.textures[ this.uuid ] !== undefined ) {
+
+ return meta.textures[ this.uuid ];
+
+ }
+
+ function getDataURL( image ) {
+
+ var canvas;
+
+ if ( image instanceof HTMLCanvasElement ) {
+
+ canvas = image;
+
+ } else {
+
+ canvas = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' );
+ canvas.width = image.width;
+ canvas.height = image.height;
+
+ var context = canvas.getContext( '2d' );
+
+ if ( image instanceof ImageData ) {
+
+ context.putImageData( image, 0, 0 );
+
+ } else {
+
+ context.drawImage( image, 0, 0, image.width, image.height );
+
+ }
+
+ }
+
+ if ( canvas.width > 2048 || canvas.height > 2048 ) {
+
+ return canvas.toDataURL( 'image/jpeg', 0.6 );
+
+ } else {
+
+ return canvas.toDataURL( 'image/png' );
+
+ }
+
+ }
+
+ var output = {
+ metadata: {
+ version: 4.5,
+ type: 'Texture',
+ generator: 'Texture.toJSON'
+ },
+
+ uuid: this.uuid,
+ name: this.name,
+
+ mapping: this.mapping,
+
+ repeat: [ this.repeat.x, this.repeat.y ],
+ offset: [ this.offset.x, this.offset.y ],
+ center: [ this.center.x, this.center.y ],
+ rotation: this.rotation,
+
+ wrap: [ this.wrapS, this.wrapT ],
+
+ minFilter: this.minFilter,
+ magFilter: this.magFilter,
+ anisotropy: this.anisotropy,
+
+ flipY: this.flipY
+ };
+
+ if ( this.image !== undefined ) {
+
+ // TODO: Move to THREE.Image
+
+ var image = this.image;
+
+ if ( image.uuid === undefined ) {
+
+ image.uuid = _Math.generateUUID(); // UGH
+
+ }
+
+ if ( ! isRootObject && meta.images[ image.uuid ] === undefined ) {
+
+ meta.images[ image.uuid ] = {
+ uuid: image.uuid,
+ url: getDataURL( image )
+ };
+
+ }
+
+ output.image = image.uuid;
+
+ }
+
+ if ( ! isRootObject ) {
+
+ meta.textures[ this.uuid ] = output;
+
+ }
+
+ return output;
+
+ },
+
+ dispose: function () {
+
+ this.dispatchEvent( { type: 'dispose' } );
+
+ },
+
+ transformUv: function ( uv ) {
+
+ if ( this.mapping !== UVMapping ) return;
+
+ uv.applyMatrix3( this.matrix );
+
+ if ( uv.x < 0 || uv.x > 1 ) {
+
+ switch ( this.wrapS ) {
+
+ case RepeatWrapping:
+
+ uv.x = uv.x - Math.floor( uv.x );
+ break;
+
+ case ClampToEdgeWrapping:
+
+ uv.x = uv.x < 0 ? 0 : 1;
+ break;
+
+ case MirroredRepeatWrapping:
+
+ if ( Math.abs( Math.floor( uv.x ) % 2 ) === 1 ) {
+
+ uv.x = Math.ceil( uv.x ) - uv.x;
+
+ } else {
+
+ uv.x = uv.x - Math.floor( uv.x );
+
+ }
+ break;
+
+ }
+
+ }
+
+ if ( uv.y < 0 || uv.y > 1 ) {
+
+ switch ( this.wrapT ) {
+
+ case RepeatWrapping:
+
+ uv.y = uv.y - Math.floor( uv.y );
+ break;
+
+ case ClampToEdgeWrapping:
+
+ uv.y = uv.y < 0 ? 0 : 1;
+ break;
+
+ case MirroredRepeatWrapping:
+
+ if ( Math.abs( Math.floor( uv.y ) % 2 ) === 1 ) {
+
+ uv.y = Math.ceil( uv.y ) - uv.y;
+
+ } else {
+
+ uv.y = uv.y - Math.floor( uv.y );
+
+ }
+ break;
+
+ }
+
+ }
+
+ if ( this.flipY ) {
+
+ uv.y = 1 - uv.y;
+
+ }
+
+ }
+
+ } );
+
+ /**
+ * @author supereggbert / http://www.paulbrunt.co.uk/
+ * @author philogb / http://blog.thejit.org/
+ * @author mikael emtinger / http://gomo.se/
+ * @author egraether / http://egraether.com/
+ * @author WestLangley / http://github.com/WestLangley
+ */
+
+ function Vector4( x, y, z, w ) {
+
+ this.x = x || 0;
+ this.y = y || 0;
+ this.z = z || 0;
+ this.w = ( w !== undefined ) ? w : 1;
+
+ }
+
+ Object.assign( Vector4.prototype, {
+
+ isVector4: true,
+
+ set: function ( x, y, z, w ) {
+
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.w = w;
+
+ return this;
+
+ },
+
+ setScalar: function ( scalar ) {
+
+ this.x = scalar;
+ this.y = scalar;
+ this.z = scalar;
+ this.w = scalar;
+
+ return this;
+
+ },
+
+ setX: function ( x ) {
+
+ this.x = x;
+
+ return this;
+
+ },
+
+ setY: function ( y ) {
+
+ this.y = y;
+
+ return this;
+
+ },
+
+ setZ: function ( z ) {
+
+ this.z = z;
+
+ return this;
+
+ },
+
+ setW: function ( w ) {
+
+ this.w = w;
+
+ return this;
+
+ },
+
+ setComponent: function ( index, value ) {
+
+ switch ( index ) {
+
+ case 0: this.x = value; break;
+ case 1: this.y = value; break;
+ case 2: this.z = value; break;
+ case 3: this.w = value; break;
+ default: throw new Error( 'index is out of range: ' + index );
+
+ }
+
+ return this;
+
+ },
+
+ getComponent: function ( index ) {
+
+ switch ( index ) {
+
+ case 0: return this.x;
+ case 1: return this.y;
+ case 2: return this.z;
+ case 3: return this.w;
+ default: throw new Error( 'index is out of range: ' + index );
+
+ }
+
+ },
+
+ clone: function () {
+
+ return new this.constructor( this.x, this.y, this.z, this.w );
+
+ },
+
+ copy: function ( v ) {
+
+ this.x = v.x;
+ this.y = v.y;
+ this.z = v.z;
+ this.w = ( v.w !== undefined ) ? v.w : 1;
+
+ return this;
+
+ },
+
+ add: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
+ return this.addVectors( v, w );
+
+ }
+
+ this.x += v.x;
+ this.y += v.y;
+ this.z += v.z;
+ this.w += v.w;
+
+ return this;
+
+ },
+
+ addScalar: function ( s ) {
+
+ this.x += s;
+ this.y += s;
+ this.z += s;
+ this.w += s;
+
+ return this;
+
+ },
+
+ addVectors: function ( a, b ) {
+
+ this.x = a.x + b.x;
+ this.y = a.y + b.y;
+ this.z = a.z + b.z;
+ this.w = a.w + b.w;
+
+ return this;
+
+ },
+
+ addScaledVector: function ( v, s ) {
+
+ this.x += v.x * s;
+ this.y += v.y * s;
+ this.z += v.z * s;
+ this.w += v.w * s;
+
+ return this;
+
+ },
+
+ sub: function ( v, w ) {
+
+ if ( w !== undefined ) {
+
+ console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
+ return this.subVectors( v, w );
+
+ }
+
+ this.x -= v.x;
+ this.y -= v.y;
+ this.z -= v.z;
+ this.w -= v.w;
+
+ return this;
+
+ },
+
+ subScalar: function ( s ) {
+
+ this.x -= s;
+ this.y -= s;
+ this.z -= s;
+ this.w -= s;
+
+ return this;
+
+ },
+
+ subVectors: function ( a, b ) {
+
+ this.x = a.x - b.x;
+ this.y = a.y - b.y;
+ this.z = a.z - b.z;
+ this.w = a.w - b.w;
+
+ return this;
+
+ },
+
+ multiplyScalar: function ( scalar ) {
+
+ this.x *= scalar;
+ this.y *= scalar;
+ this.z *= scalar;
+ this.w *= scalar;
+
+ return this;
+
+ },
+
+ applyMatrix4: function ( m ) {
+
+ var x = this.x, y = this.y, z = this.z, w = this.w;
+ var e = m.elements;
+
+ this.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;
+ this.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;
+ this.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;
+ this.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;
+
+ return this;
+
+ },
+
+ divideScalar: function ( scalar ) {
+
+ return this.multiplyScalar( 1 / scalar );
+
+ },
+
+ setAxisAngleFromQuaternion: function ( q ) {
+
+ // http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm
+
+ // q is assumed to be normalized
+
+ this.w = 2 * Math.acos( q.w );
+
+ var s = Math.sqrt( 1 - q.w * q.w );
+
+ if ( s < 0.0001 ) {
+
+ this.x = 1;
+ this.y = 0;
+ this.z = 0;
+
+ } else {
+
+ this.x = q.x / s;
+ this.y = q.y / s;
+ this.z = q.z / s;
+
+ }
+
+ return this;
+
+ },
+
+ setAxisAngleFromRotationMatrix: function ( m ) {
+
+ // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
+
+ // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
+
+ var angle, x, y, z, // variables for result
+ epsilon = 0.01, // margin to allow for rounding errors
+ epsilon2 = 0.1, // margin to distinguish between 0 and 180 degrees
+
+ te = m.elements,
+
+ m11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],
+ m21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],
+ m31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];
+
+ if ( ( Math.abs( m12 - m21 ) < epsilon ) &&
+ ( Math.abs( m13 - m31 ) < epsilon ) &&
+ ( Math.abs( m23 - m32 ) < epsilon ) ) {
+
+ // singularity found
+ // first check for identity matrix which must have +1 for all terms
+ // in leading diagonal and zero in other terms
+
+ if ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&
+ ( Math.abs( m13 + m31 ) < epsilon2 ) &&
+ ( Math.abs( m23 + m32 ) < epsilon2 ) &&
+ ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {
+
+ // this singularity is identity matrix so angle = 0
+
+ this.set( 1, 0, 0, 0 );
+
+ return this; // zero angle, arbitrary axis
+
+ }
+
+ // otherwise this singularity is angle = 180
+
+ angle = Math.PI;
+
+ var xx = ( m11 + 1 ) / 2;
+ var yy = ( m22 + 1 ) / 2;
+ var zz = ( m33 + 1 ) / 2;
+ var xy = ( m12 + m21 ) / 4;
+ var xz = ( m13 + m31 ) / 4;
+ var yz = ( m23 + m32 ) / 4;
+
+ if ( ( xx > yy ) && ( xx > zz ) ) {
+
+ // m11 is the largest diagonal term
+
+ if ( xx < epsilon ) {
+
+ x = 0;
+ y = 0.707106781;
+ z = 0.707106781;
+
+ } else {
+
+ x = Math.sqrt( xx );
+ y = xy / x;
+ z = xz / x;
+
+ }
+
+ } else if ( yy > zz ) {
+
+ // m22 is the largest diagonal term
+
+ if ( yy < epsilon ) {
+
+ x = 0.707106781;
+ y = 0;
+ z = 0.707106781;
+
+ } else {
+
+ y = Math.sqrt( yy );
+ x = xy / y;
+ z = yz / y;
+
+ }
+
+ } else {
+
+ // m33 is the largest diagonal term so base result on this
+
+ if ( zz < epsilon ) {
+
+ x = 0.707106781;
+ y = 0.707106781;
+ z = 0;
+
+ } else {
+
+ z = Math.sqrt( zz );
+ x = xz / z;
+ y = yz / z;
+
+ }
+
+ }
+
+ this.set( x, y, z, angle );
+
+ return this; // return 180 deg rotation
+
+ }
+
+ // as we have reached here there are no singularities so we can handle normally
+
+ var s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +
+ ( m13 - m31 ) * ( m13 - m31 ) +
+ ( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize
+
+ if ( Math.abs( s ) < 0.001 ) s = 1;
+
+ // prevent divide by zero, should not happen if matrix is orthogonal and should be
+ // caught by singularity test above, but I've left it in just in case
+
+ this.x = ( m32 - m23 ) / s;
+ this.y = ( m13 - m31 ) / s;
+ this.z = ( m21 - m12 ) / s;
+ this.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );
+
+ return this;
+
+ },
+
+ min: function ( v ) {
+
+ this.x = Math.min( this.x, v.x );
+ this.y = Math.min( this.y, v.y );
+ this.z = Math.min( this.z, v.z );
+ this.w = Math.min( this.w, v.w );
+
+ return this;
+
+ },
+
+ max: function ( v ) {
+
+ this.x = Math.max( this.x, v.x );
+ this.y = Math.max( this.y, v.y );
+ this.z = Math.max( this.z, v.z );
+ this.w = Math.max( this.w, v.w );
+
+ return this;
+
+ },
+
+ clamp: function ( min, max ) {
+
+ // assumes min < max, componentwise
+
+ this.x = Math.max( min.x, Math.min( max.x, this.x ) );
+ this.y = Math.max( min.y, Math.min( max.y, this.y ) );
+ this.z = Math.max( min.z, Math.min( max.z, this.z ) );
+ this.w = Math.max( min.w, Math.min( max.w, this.w ) );
+
+ return this;
+
+ },
+
+ clampScalar: function () {
+
+ var min, max;
+
+ return function clampScalar( minVal, maxVal ) {
+
+ if ( min === undefined ) {
+
+ min = new Vector4();
+ max = new Vector4();
+
+ }
+
+ min.set( minVal, minVal, minVal, minVal );
+ max.set( maxVal, maxVal, maxVal, maxVal );
+
+ return this.clamp( min, max );
+
+ };
+
+ }(),
+
+ clampLength: function ( min, max ) {
+
+ var length = this.length();
+
+ return this.divideScalar( length || 1 ).multiplyScalar( Math.max( min, Math.min( max, length ) ) );
+
+ },
+
+ floor: function () {
+
+ this.x = Math.floor( this.x );
+ this.y = Math.floor( this.y );
+ this.z = Math.floor( this.z );
+ this.w = Math.floor( this.w );
+
+ return this;
+
+ },
+
+ ceil: function () {
+
+ this.x = Math.ceil( this.x );
+ this.y = Math.ceil( this.y );
+ this.z = Math.ceil( this.z );
+ this.w = Math.ceil( this.w );
+
+ return this;
+
+ },
+
+ round: function () {
+
+ this.x = Math.round( this.x );
+ this.y = Math.round( this.y );
+ this.z = Math.round( this.z );
+ this.w = Math.round( this.w );
+
+ return this;
+
+ },
+
+ roundToZero: function () {
+
+ this.x = ( this.x < 0 ) ? Math.ceil( this.x ) : Math.floor( this.x );
+ this.y = ( this.y < 0 ) ? Math.ceil( this.y ) : Math.floor( this.y );
+ this.z = ( this.z < 0 ) ? Math.ceil( this.z ) : Math.floor( this.z );
+ this.w = ( this.w < 0 ) ? Math.ceil( this.w ) : Math.floor( this.w );
+
+ return this;
+
+ },
+
+ negate: function () {
+
+ this.x = - this.x;
+ this.y = - this.y;
+ this.z = - this.z;
+ this.w = - this.w;
+
+ return this;
+
+ },
+
+ dot: function ( v ) {
+
+ return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;
+
+ },
+
+ lengthSq: function () {
+
+ return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
+
+ },
+
+ length: function () {
+
+ return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );
+
+ },
+
+ manhattanLength: function () {
+
+ return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );
+
+ },
+
+ normalize: function () {
+
+ return this.divideScalar( this.length() || 1 );
+
+ },
+
+ setLength: function ( length ) {
+
+ return this.normalize().multiplyScalar( length );
+
+ },
+
+ lerp: function ( v, alpha ) {
+
+ this.x += ( v.x - this.x ) * alpha;
+ this.y += ( v.y - this.y ) * alpha;
+ this.z += ( v.z - this.z ) * alpha;
+ this.w += ( v.w - this.w ) * alpha;
+
+ return this;
+
+ },
+
+ lerpVectors: function ( v1, v2, alpha ) {
+
+ return this.subVectors( v2, v1 ).multiplyScalar( alpha ).add( v1 );
+
+ },
+
+ equals: function ( v ) {
+
+ return ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ this.x = array[ offset ];
+ this.y = array[ offset + 1 ];
+ this.z = array[ offset + 2 ];
+ this.w = array[ offset + 3 ];
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ array[ offset ] = this.x;
+ array[ offset + 1 ] = this.y;
+ array[ offset + 2 ] = this.z;
+ array[ offset + 3 ] = this.w;
+
+ return array;
+
+ },
+
+ fromBufferAttribute: function ( attribute, index, offset ) {
+
+ if ( offset !== undefined ) {
+
+ console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' );
+
+ }
+
+ this.x = attribute.getX( index );
+ this.y = attribute.getY( index );
+ this.z = attribute.getZ( index );
+ this.w = attribute.getW( index );
+
+ return this;
+
+ }
+
+ } );
+
+ /**
+ * @author szimek / https://github.com/szimek/
+ * @author alteredq / http://alteredqualia.com/
+ * @author Marius Kintel / https://github.com/kintel
+ */
+
+ /*
+ In options, we can specify:
+ * Texture parameters for an auto-generated target texture
+ * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers
+ */
+ function WebGLRenderTarget( width, height, options ) {
+
+ this.uuid = _Math.generateUUID();
+
+ this.width = width;
+ this.height = height;
+
+ this.scissor = new Vector4( 0, 0, width, height );
+ this.scissorTest = false;
+
+ this.viewport = new Vector4( 0, 0, width, height );
+
+ options = options || {};
+
+ if ( options.minFilter === undefined ) options.minFilter = LinearFilter;
+
+ this.texture = new Texture( undefined, undefined, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding );
+
+ this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
+ this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
+ this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;
+
+ }
+
+ Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
+
+ isWebGLRenderTarget: true,
+
+ setSize: function ( width, height ) {
+
+ if ( this.width !== width || this.height !== height ) {
+
+ this.width = width;
+ this.height = height;
+
+ this.dispose();
+
+ }
+
+ this.viewport.set( 0, 0, width, height );
+ this.scissor.set( 0, 0, width, height );
+
+ },
+
+ clone: function () {
+
+ return new this.constructor().copy( this );
+
+ },
+
+ copy: function ( source ) {
+
+ this.width = source.width;
+ this.height = source.height;
+
+ this.viewport.copy( source.viewport );
+
+ this.texture = source.texture.clone();
+
+ this.depthBuffer = source.depthBuffer;
+ this.stencilBuffer = source.stencilBuffer;
+ this.depthTexture = source.depthTexture;
+
+ return this;
+
+ },
+
+ dispose: function () {
+
+ this.dispatchEvent( { type: 'dispose' } );
+
+ }
+
+ } );
+
+ /**
+ * @author alteredq / http://alteredqualia.com
+ */
+
+ function WebGLRenderTargetCube( width, height, options ) {
+
+ WebGLRenderTarget.call( this, width, height, options );
+
+ this.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5
+ this.activeMipMapLevel = 0;
+
+ }
+
+ WebGLRenderTargetCube.prototype = Object.create( WebGLRenderTarget.prototype );
+ WebGLRenderTargetCube.prototype.constructor = WebGLRenderTargetCube;
+
+ WebGLRenderTargetCube.prototype.isWebGLRenderTargetCube = true;
+
+ /**
+ * @author alteredq / http://alteredqualia.com/
+ */
+
+ function DataTexture( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding ) {
+
+ Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+
+ this.image = { data: data, width: width, height: height };
+
+ this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
+ this.minFilter = minFilter !== undefined ? minFilter : NearestFilter;
+
+ this.generateMipmaps = false;
+ this.flipY = false;
+ this.unpackAlignment = 1;
+
+ }
+
+ DataTexture.prototype = Object.create( Texture.prototype );
+ DataTexture.prototype.constructor = DataTexture;
+
+ DataTexture.prototype.isDataTexture = true;
+
+ /**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+ function CubeTexture( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding ) {
+
+ images = images !== undefined ? images : [];
+ mapping = mapping !== undefined ? mapping : CubeReflectionMapping;
+
+ Texture.call( this, images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+
+ this.flipY = false;
+
+ }
+
+ CubeTexture.prototype = Object.create( Texture.prototype );
+ CubeTexture.prototype.constructor = CubeTexture;
+
+ CubeTexture.prototype.isCubeTexture = true;
+
+ Object.defineProperty( CubeTexture.prototype, 'images', {
+
+ get: function () {
+
+ return this.image;
+
+ },
+
+ set: function ( value ) {
+
+ this.image = value;
+
+ }
+
+ } );
+
+ /**
+ * @author tschw
+ *
+ * Uniforms of a program.
+ * Those form a tree structure with a special top-level container for the root,
+ * which you get by calling 'new WebGLUniforms( gl, program, renderer )'.
+ *
+ *
+ * Properties of inner nodes including the top-level container:
+ *
+ * .seq - array of nested uniforms
+ * .map - nested uniforms by name
+ *
+ *
+ * Methods of all nodes except the top-level container:
+ *
+ * .setValue( gl, value, [renderer] )
+ *
+ * uploads a uniform value(s)
+ * the 'renderer' parameter is needed for sampler uniforms
+ *
+ *
+ * Static methods of the top-level container (renderer factorizations):
+ *
+ * .upload( gl, seq, values, renderer )
+ *
+ * sets uniforms in 'seq' to 'values[id].value'
+ *
+ * .seqWithValue( seq, values ) : filteredSeq
+ *
+ * filters 'seq' entries with corresponding entry in values
+ *
+ *
+ * Methods of the top-level container (renderer factorizations):
+ *
+ * .setValue( gl, name, value )
+ *
+ * sets uniform with name 'name' to 'value'
+ *
+ * .set( gl, obj, prop )
+ *
+ * sets uniform from object and property with same name than uniform
+ *
+ * .setOptional( gl, obj, prop )
+ *
+ * like .set for an optional property of the object
+ *
+ */
+
+ var emptyTexture = new Texture();
+ var emptyCubeTexture = new CubeTexture();
+
+ // --- Base for inner nodes (including the root) ---
+
+ function UniformContainer() {
+
+ this.seq = [];
+ this.map = {};
+
+ }
+
+ // --- Utilities ---
+
+ // Array Caches (provide typed arrays for temporary by size)
+
+ var arrayCacheF32 = [];
+ var arrayCacheI32 = [];
+
+ // Float32Array caches used for uploading Matrix uniforms
+
+ var mat4array = new Float32Array( 16 );
+ var mat3array = new Float32Array( 9 );
+
+ // Flattening for arrays of vectors and matrices
+
+ function flatten( array, nBlocks, blockSize ) {
+
+ var firstElem = array[ 0 ];
+
+ if ( firstElem <= 0 || firstElem > 0 ) return array;
+ // unoptimized: ! isNaN( firstElem )
+ // see http://jacksondunstan.com/articles/983
+
+ var n = nBlocks * blockSize,
+ r = arrayCacheF32[ n ];
+
+ if ( r === undefined ) {
+
+ r = new Float32Array( n );
+ arrayCacheF32[ n ] = r;
+
+ }
+
+ if ( nBlocks !== 0 ) {
+
+ firstElem.toArray( r, 0 );
+
+ for ( var i = 1, offset = 0; i !== nBlocks; ++ i ) {
+
+ offset += blockSize;
+ array[ i ].toArray( r, offset );
+
+ }
+
+ }
+
+ return r;
+
+ }
+
+ // Texture unit allocation
+
+ function allocTexUnits( renderer, n ) {
+
+ var r = arrayCacheI32[ n ];
+
+ if ( r === undefined ) {
+
+ r = new Int32Array( n );
+ arrayCacheI32[ n ] = r;
+
+ }
+
+ for ( var i = 0; i !== n; ++ i )
+ r[ i ] = renderer.allocTextureUnit();
+
+ return r;
+
+ }
+
+ // --- Setters ---
+
+ // Note: Defining these methods externally, because they come in a bunch
+ // and this way their names minify.
+
+ // Single scalar
+
+ function setValue1f( gl, v ) {
+
+ gl.uniform1f( this.addr, v );
+
+ }
+
+ function setValue1i( gl, v ) {
+
+ gl.uniform1i( this.addr, v );
+
+ }
+
+ // Single float vector (from flat array or THREE.VectorN)
+
+ function setValue2fv( gl, v ) {
+
+ if ( v.x === undefined ) {
+
+ gl.uniform2fv( this.addr, v );
+
+ } else {
+
+ gl.uniform2f( this.addr, v.x, v.y );
+
+ }
+
+ }
+
+ function setValue3fv( gl, v ) {
+
+ if ( v.x !== undefined ) {
+
+ gl.uniform3f( this.addr, v.x, v.y, v.z );
+
+ } else if ( v.r !== undefined ) {
+
+ gl.uniform3f( this.addr, v.r, v.g, v.b );
+
+ } else {
+
+ gl.uniform3fv( this.addr, v );
+
+ }
+
+ }
+
+ function setValue4fv( gl, v ) {
+
+ if ( v.x === undefined ) {
+
+ gl.uniform4fv( this.addr, v );
+
+ } else {
+
+ gl.uniform4f( this.addr, v.x, v.y, v.z, v.w );
+
+ }
+
+ }
+
+ // Single matrix (from flat array or MatrixN)
+
+ function setValue2fm( gl, v ) {
+
+ gl.uniformMatrix2fv( this.addr, false, v.elements || v );
+
+ }
+
+ function setValue3fm( gl, v ) {
+
+ if ( v.elements === undefined ) {
+
+ gl.uniformMatrix3fv( this.addr, false, v );
+
+ } else {
+
+ mat3array.set( v.elements );
+ gl.uniformMatrix3fv( this.addr, false, mat3array );
+
+ }
+
+ }
+
+ function setValue4fm( gl, v ) {
+
+ if ( v.elements === undefined ) {
+
+ gl.uniformMatrix4fv( this.addr, false, v );
+
+ } else {
+
+ mat4array.set( v.elements );
+ gl.uniformMatrix4fv( this.addr, false, mat4array );
+
+ }
+
+ }
+
+ // Single texture (2D / Cube)
+
+ function setValueT1( gl, v, renderer ) {
+
+ var unit = renderer.allocTextureUnit();
+ gl.uniform1i( this.addr, unit );
+ renderer.setTexture2D( v || emptyTexture, unit );
+
+ }
+
+ function setValueT6( gl, v, renderer ) {
+
+ var unit = renderer.allocTextureUnit();
+ gl.uniform1i( this.addr, unit );
+ renderer.setTextureCube( v || emptyCubeTexture, unit );
+
+ }
+
+ // Integer / Boolean vectors or arrays thereof (always flat arrays)
+
+ function setValue2iv( gl, v ) {
+
+ gl.uniform2iv( this.addr, v );
+
+ }
+
+ function setValue3iv( gl, v ) {
+
+ gl.uniform3iv( this.addr, v );
+
+ }
+
+ function setValue4iv( gl, v ) {
+
+ gl.uniform4iv( this.addr, v );
+
+ }
+
+ // Helper to pick the right setter for the singular case
+
+ function getSingularSetter( type ) {
+
+ switch ( type ) {
+
+ case 0x1406: return setValue1f; // FLOAT
+ case 0x8b50: return setValue2fv; // _VEC2
+ case 0x8b51: return setValue3fv; // _VEC3
+ case 0x8b52: return setValue4fv; // _VEC4
+
+ case 0x8b5a: return setValue2fm; // _MAT2
+ case 0x8b5b: return setValue3fm; // _MAT3
+ case 0x8b5c: return setValue4fm; // _MAT4
+
+ case 0x8b5e: case 0x8d66: return setValueT1; // SAMPLER_2D, SAMPLER_EXTERNAL_OES
+ case 0x8b60: return setValueT6; // SAMPLER_CUBE
+
+ case 0x1404: case 0x8b56: return setValue1i; // INT, BOOL
+ case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2
+ case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3
+ case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4
+
+ }
+
+ }
+
+ // Array of scalars
+
+ function setValue1fv( gl, v ) {
+
+ gl.uniform1fv( this.addr, v );
+
+ }
+ function setValue1iv( gl, v ) {
+
+ gl.uniform1iv( this.addr, v );
+
+ }
+
+ // Array of vectors (flat or from THREE classes)
+
+ function setValueV2a( gl, v ) {
+
+ gl.uniform2fv( this.addr, flatten( v, this.size, 2 ) );
+
+ }
+
+ function setValueV3a( gl, v ) {
+
+ gl.uniform3fv( this.addr, flatten( v, this.size, 3 ) );
+
+ }
+
+ function setValueV4a( gl, v ) {
+
+ gl.uniform4fv( this.addr, flatten( v, this.size, 4 ) );
+
+ }
+
+ // Array of matrices (flat or from THREE clases)
+
+ function setValueM2a( gl, v ) {
+
+ gl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );
+
+ }
+
+ function setValueM3a( gl, v ) {
+
+ gl.uniformMatrix3fv( this.addr, false, flatten( v, this.size, 9 ) );
+
+ }
+
+ function setValueM4a( gl, v ) {
+
+ gl.uniformMatrix4fv( this.addr, false, flatten( v, this.size, 16 ) );
+
+ }
+
+ // Array of textures (2D / Cube)
+
+ function setValueT1a( gl, v, renderer ) {
+
+ var n = v.length,
+ units = allocTexUnits( renderer, n );
+
+ gl.uniform1iv( this.addr, units );
+
+ for ( var i = 0; i !== n; ++ i ) {
+
+ renderer.setTexture2D( v[ i ] || emptyTexture, units[ i ] );
+
+ }
+
+ }
+
+ function setValueT6a( gl, v, renderer ) {
+
+ var n = v.length,
+ units = allocTexUnits( renderer, n );
+
+ gl.uniform1iv( this.addr, units );
+
+ for ( var i = 0; i !== n; ++ i ) {
+
+ renderer.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] );
+
+ }
+
+ }
+
+ // Helper to pick the right setter for a pure (bottom-level) array
+
+ function getPureArraySetter( type ) {
+
+ switch ( type ) {
+
+ case 0x1406: return setValue1fv; // FLOAT
+ case 0x8b50: return setValueV2a; // _VEC2
+ case 0x8b51: return setValueV3a; // _VEC3
+ case 0x8b52: return setValueV4a; // _VEC4
+
+ case 0x8b5a: return setValueM2a; // _MAT2
+ case 0x8b5b: return setValueM3a; // _MAT3
+ case 0x8b5c: return setValueM4a; // _MAT4
+
+ case 0x8b5e: return setValueT1a; // SAMPLER_2D
+ case 0x8b60: return setValueT6a; // SAMPLER_CUBE
+
+ case 0x1404: case 0x8b56: return setValue1iv; // INT, BOOL
+ case 0x8b53: case 0x8b57: return setValue2iv; // _VEC2
+ case 0x8b54: case 0x8b58: return setValue3iv; // _VEC3
+ case 0x8b55: case 0x8b59: return setValue4iv; // _VEC4
+
+ }
+
+ }
+
+ // --- Uniform Classes ---
+
+ function SingleUniform( id, activeInfo, addr ) {
+
+ this.id = id;
+ this.addr = addr;
+ this.setValue = getSingularSetter( activeInfo.type );
+
+ // this.path = activeInfo.name; // DEBUG
+
+ }
+
+ function PureArrayUniform( id, activeInfo, addr ) {
+
+ this.id = id;
+ this.addr = addr;
+ this.size = activeInfo.size;
+ this.setValue = getPureArraySetter( activeInfo.type );
+
+ // this.path = activeInfo.name; // DEBUG
+
+ }
+
+ function StructuredUniform( id ) {
+
+ this.id = id;
+
+ UniformContainer.call( this ); // mix-in
+
+ }
+
+ StructuredUniform.prototype.setValue = function ( gl, value ) {
+
+ // Note: Don't need an extra 'renderer' parameter, since samplers
+ // are not allowed in structured uniforms.
+
+ var seq = this.seq;
+
+ for ( var i = 0, n = seq.length; i !== n; ++ i ) {
+
+ var u = seq[ i ];
+ u.setValue( gl, value[ u.id ] );
+
+ }
+
+ };
+
+ // --- Top-level ---
+
+ // Parser - builds up the property tree from the path strings
+
+ var RePathPart = /([\w\d_]+)(\])?(\[|\.)?/g;
+
+ // extracts
+ // - the identifier (member name or array index)
+ // - followed by an optional right bracket (found when array index)
+ // - followed by an optional left bracket or dot (type of subscript)
+ //
+ // Note: These portions can be read in a non-overlapping fashion and
+ // allow straightforward parsing of the hierarchy that WebGL encodes
+ // in the uniform names.
+
+ function addUniform( container, uniformObject ) {
+
+ container.seq.push( uniformObject );
+ container.map[ uniformObject.id ] = uniformObject;
+
+ }
+
+ function parseUniform( activeInfo, addr, container ) {
+
+ var path = activeInfo.name,
+ pathLength = path.length;
+
+ // reset RegExp object, because of the early exit of a previous run
+ RePathPart.lastIndex = 0;
+
+ for ( ; ; ) {
+
+ var match = RePathPart.exec( path ),
+ matchEnd = RePathPart.lastIndex,
+
+ id = match[ 1 ],
+ idIsIndex = match[ 2 ] === ']',
+ subscript = match[ 3 ];
+
+ if ( idIsIndex ) id = id | 0; // convert to integer
+
+ if ( subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength ) {
+
+ // bare name or "pure" bottom-level array "[0]" suffix
+
+ addUniform( container, subscript === undefined ?
+ new SingleUniform( id, activeInfo, addr ) :
+ new PureArrayUniform( id, activeInfo, addr ) );
+
+ break;
+
+ } else {
+
+ // step into inner node / create it in case it doesn't exist
+
+ var map = container.map, next = map[ id ];
+
+ if ( next === undefined ) {
+
+ next = new StructuredUniform( id );
+ addUniform( container, next );
+
+ }
+
+ container = next;
+
+ }
+
+ }
+
+ }
+
+ // Root Container
+
+ function WebGLUniforms( gl, program, renderer ) {
+
+ UniformContainer.call( this );
+
+ this.renderer = renderer;
+
+ var n = gl.getProgramParameter( program, gl.ACTIVE_UNIFORMS );
+
+ for ( var i = 0; i < n; ++ i ) {
+
+ var info = gl.getActiveUniform( program, i ),
+ path = info.name,
+ addr = gl.getUniformLocation( program, path );
+
+ parseUniform( info, addr, this );
+
+ }
+
+ }
+
+ WebGLUniforms.prototype.setValue = function ( gl, name, value ) {
+
+ var u = this.map[ name ];
+
+ if ( u !== undefined ) u.setValue( gl, value, this.renderer );
+
+ };
+
+ WebGLUniforms.prototype.setOptional = function ( gl, object, name ) {
+
+ var v = object[ name ];
+
+ if ( v !== undefined ) this.setValue( gl, name, v );
+
+ };
+
+
+ // Static interface
+
+ WebGLUniforms.upload = function ( gl, seq, values, renderer ) {
+
+ for ( var i = 0, n = seq.length; i !== n; ++ i ) {
+
+ var u = seq[ i ],
+ v = values[ u.id ];
+
+ if ( v.needsUpdate !== false ) {
+
+ // note: always updating when .needsUpdate is undefined
+ u.setValue( gl, v.value, renderer );
+
+ }
+
+ }
+
+ };
+
+ WebGLUniforms.seqWithValue = function ( seq, values ) {
+
+ var r = [];
+
+ for ( var i = 0, n = seq.length; i !== n; ++ i ) {
+
+ var u = seq[ i ];
+ if ( u.id in values ) r.push( u );
+
+ }
+
+ return r;
+
+ };
+
+ /**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+ var ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
+ 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,
+ 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,
+ 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,
+ 'darkgoldenrod': 0xB8860B, 'darkgray': 0xA9A9A9, 'darkgreen': 0x006400, 'darkgrey': 0xA9A9A9, 'darkkhaki': 0xBDB76B, 'darkmagenta': 0x8B008B,
+ 'darkolivegreen': 0x556B2F, 'darkorange': 0xFF8C00, 'darkorchid': 0x9932CC, 'darkred': 0x8B0000, 'darksalmon': 0xE9967A, 'darkseagreen': 0x8FBC8F,
+ 'darkslateblue': 0x483D8B, 'darkslategray': 0x2F4F4F, 'darkslategrey': 0x2F4F4F, 'darkturquoise': 0x00CED1, 'darkviolet': 0x9400D3,
+ 'deeppink': 0xFF1493, 'deepskyblue': 0x00BFFF, 'dimgray': 0x696969, 'dimgrey': 0x696969, 'dodgerblue': 0x1E90FF, 'firebrick': 0xB22222,
+ 'floralwhite': 0xFFFAF0, 'forestgreen': 0x228B22, 'fuchsia': 0xFF00FF, 'gainsboro': 0xDCDCDC, 'ghostwhite': 0xF8F8FF, 'gold': 0xFFD700,
+ 'goldenrod': 0xDAA520, 'gray': 0x808080, 'green': 0x008000, 'greenyellow': 0xADFF2F, 'grey': 0x808080, 'honeydew': 0xF0FFF0, 'hotpink': 0xFF69B4,
+ 'indianred': 0xCD5C5C, 'indigo': 0x4B0082, 'ivory': 0xFFFFF0, 'khaki': 0xF0E68C, 'lavender': 0xE6E6FA, 'lavenderblush': 0xFFF0F5, 'lawngreen': 0x7CFC00,
+ 'lemonchiffon': 0xFFFACD, 'lightblue': 0xADD8E6, 'lightcoral': 0xF08080, 'lightcyan': 0xE0FFFF, 'lightgoldenrodyellow': 0xFAFAD2, 'lightgray': 0xD3D3D3,
+ 'lightgreen': 0x90EE90, 'lightgrey': 0xD3D3D3, 'lightpink': 0xFFB6C1, 'lightsalmon': 0xFFA07A, 'lightseagreen': 0x20B2AA, 'lightskyblue': 0x87CEFA,
+ 'lightslategray': 0x778899, 'lightslategrey': 0x778899, 'lightsteelblue': 0xB0C4DE, 'lightyellow': 0xFFFFE0, 'lime': 0x00FF00, 'limegreen': 0x32CD32,
+ 'linen': 0xFAF0E6, 'magenta': 0xFF00FF, 'maroon': 0x800000, 'mediumaquamarine': 0x66CDAA, 'mediumblue': 0x0000CD, 'mediumorchid': 0xBA55D3,
+ 'mediumpurple': 0x9370DB, 'mediumseagreen': 0x3CB371, 'mediumslateblue': 0x7B68EE, 'mediumspringgreen': 0x00FA9A, 'mediumturquoise': 0x48D1CC,
+ 'mediumvioletred': 0xC71585, 'midnightblue': 0x191970, 'mintcream': 0xF5FFFA, 'mistyrose': 0xFFE4E1, 'moccasin': 0xFFE4B5, 'navajowhite': 0xFFDEAD,
+ 'navy': 0x000080, 'oldlace': 0xFDF5E6, 'olive': 0x808000, 'olivedrab': 0x6B8E23, 'orange': 0xFFA500, 'orangered': 0xFF4500, 'orchid': 0xDA70D6,
+ 'palegoldenrod': 0xEEE8AA, 'palegreen': 0x98FB98, 'paleturquoise': 0xAFEEEE, 'palevioletred': 0xDB7093, 'papayawhip': 0xFFEFD5, 'peachpuff': 0xFFDAB9,
+ 'peru': 0xCD853F, 'pink': 0xFFC0CB, 'plum': 0xDDA0DD, 'powderblue': 0xB0E0E6, 'purple': 0x800080, 'rebeccapurple': 0x663399, 'red': 0xFF0000, 'rosybrown': 0xBC8F8F,
+ 'royalblue': 0x4169E1, 'saddlebrown': 0x8B4513, 'salmon': 0xFA8072, 'sandybrown': 0xF4A460, 'seagreen': 0x2E8B57, 'seashell': 0xFFF5EE,
+ 'sienna': 0xA0522D, 'silver': 0xC0C0C0, 'skyblue': 0x87CEEB, 'slateblue': 0x6A5ACD, 'slategray': 0x708090, 'slategrey': 0x708090, 'snow': 0xFFFAFA,
+ 'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,
+ 'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };
+
+ function Color( r, g, b ) {
+
+ if ( g === undefined && b === undefined ) {
+
+ // r is THREE.Color, hex or string
+ return this.set( r );
+
+ }
+
+ return this.setRGB( r, g, b );
+
+ }
+
+ Object.assign( Color.prototype, {
+
+ isColor: true,
+
+ r: 1, g: 1, b: 1,
+
+ set: function ( value ) {
+
+ if ( value && value.isColor ) {
+
+ this.copy( value );
+
+ } else if ( typeof value === 'number' ) {
+
+ this.setHex( value );
+
+ } else if ( typeof value === 'string' ) {
+
+ this.setStyle( value );
+
+ }
+
+ return this;
+
+ },
+
+ setScalar: function ( scalar ) {
+
+ this.r = scalar;
+ this.g = scalar;
+ this.b = scalar;
+
+ return this;
+
+ },
+
+ setHex: function ( hex ) {
+
+ hex = Math.floor( hex );
+
+ this.r = ( hex >> 16 & 255 ) / 255;
+ this.g = ( hex >> 8 & 255 ) / 255;
+ this.b = ( hex & 255 ) / 255;
+
+ return this;
+
+ },
+
+ setRGB: function ( r, g, b ) {
+
+ this.r = r;
+ this.g = g;
+ this.b = b;
+
+ return this;
+
+ },
+
+ setHSL: function () {
+
+ function hue2rgb( p, q, t ) {
+
+ if ( t < 0 ) t += 1;
+ if ( t > 1 ) t -= 1;
+ if ( t < 1 / 6 ) return p + ( q - p ) * 6 * t;
+ if ( t < 1 / 2 ) return q;
+ if ( t < 2 / 3 ) return p + ( q - p ) * 6 * ( 2 / 3 - t );
+ return p;
+
+ }
+
+ return function setHSL( h, s, l ) {
+
+ // h,s,l ranges are in 0.0 - 1.0
+ h = _Math.euclideanModulo( h, 1 );
+ s = _Math.clamp( s, 0, 1 );
+ l = _Math.clamp( l, 0, 1 );
+
+ if ( s === 0 ) {
+
+ this.r = this.g = this.b = l;
+
+ } else {
+
+ var p = l <= 0.5 ? l * ( 1 + s ) : l + s - ( l * s );
+ var q = ( 2 * l ) - p;
+
+ this.r = hue2rgb( q, p, h + 1 / 3 );
+ this.g = hue2rgb( q, p, h );
+ this.b = hue2rgb( q, p, h - 1 / 3 );
+
+ }
+
+ return this;
+
+ };
+
+ }(),
+
+ setStyle: function ( style ) {
+
+ function handleAlpha( string ) {
+
+ if ( string === undefined ) return;
+
+ if ( parseFloat( string ) < 1 ) {
+
+ console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );
+
+ }
+
+ }
+
+
+ var m;
+
+ if ( m = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec( style ) ) {
+
+ // rgb / hsl
+
+ var color;
+ var name = m[ 1 ];
+ var components = m[ 2 ];
+
+ switch ( name ) {
+
+ case 'rgb':
+ case 'rgba':
+
+ if ( color = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) {
+
+ // rgb(255,0,0) rgba(255,0,0,0.5)
+ this.r = Math.min( 255, parseInt( color[ 1 ], 10 ) ) / 255;
+ this.g = Math.min( 255, parseInt( color[ 2 ], 10 ) ) / 255;
+ this.b = Math.min( 255, parseInt( color[ 3 ], 10 ) ) / 255;
+
+ handleAlpha( color[ 5 ] );
+
+ return this;
+
+ }
+
+ if ( color = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) {
+
+ // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)
+ this.r = Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100;
+ this.g = Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100;
+ this.b = Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100;
+
+ handleAlpha( color[ 5 ] );
+
+ return this;
+
+ }
+
+ break;
+
+ case 'hsl':
+ case 'hsla':
+
+ if ( color = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec( components ) ) {
+
+ // hsl(120,50%,50%) hsla(120,50%,50%,0.5)
+ var h = parseFloat( color[ 1 ] ) / 360;
+ var s = parseInt( color[ 2 ], 10 ) / 100;
+ var l = parseInt( color[ 3 ], 10 ) / 100;
+
+ handleAlpha( color[ 5 ] );
+
+ return this.setHSL( h, s, l );
+
+ }
+
+ break;
+
+ }
+
+ } else if ( m = /^\#([A-Fa-f0-9]+)$/.exec( style ) ) {
+
+ // hex color
+
+ var hex = m[ 1 ];
+ var size = hex.length;
+
+ if ( size === 3 ) {
+
+ // #ff0
+ this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 0 ), 16 ) / 255;
+ this.g = parseInt( hex.charAt( 1 ) + hex.charAt( 1 ), 16 ) / 255;
+ this.b = parseInt( hex.charAt( 2 ) + hex.charAt( 2 ), 16 ) / 255;
+
+ return this;
+
+ } else if ( size === 6 ) {
+
+ // #ff0000
+ this.r = parseInt( hex.charAt( 0 ) + hex.charAt( 1 ), 16 ) / 255;
+ this.g = parseInt( hex.charAt( 2 ) + hex.charAt( 3 ), 16 ) / 255;
+ this.b = parseInt( hex.charAt( 4 ) + hex.charAt( 5 ), 16 ) / 255;
+
+ return this;
+
+ }
+
+ }
+
+ if ( style && style.length > 0 ) {
+
+ // color keywords
+ var hex = ColorKeywords[ style ];
+
+ if ( hex !== undefined ) {
+
+ // red
+ this.setHex( hex );
+
+ } else {
+
+ // unknown color
+ console.warn( 'THREE.Color: Unknown color ' + style );
+
+ }
+
+ }
+
+ return this;
+
+ },
+
+ clone: function () {
+
+ return new this.constructor( this.r, this.g, this.b );
+
+ },
+
+ copy: function ( color ) {
+
+ this.r = color.r;
+ this.g = color.g;
+ this.b = color.b;
+
+ return this;
+
+ },
+
+ copyGammaToLinear: function ( color, gammaFactor ) {
+
+ if ( gammaFactor === undefined ) gammaFactor = 2.0;
+
+ this.r = Math.pow( color.r, gammaFactor );
+ this.g = Math.pow( color.g, gammaFactor );
+ this.b = Math.pow( color.b, gammaFactor );
+
+ return this;
+
+ },
+
+ copyLinearToGamma: function ( color, gammaFactor ) {
+
+ if ( gammaFactor === undefined ) gammaFactor = 2.0;
+
+ var safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0;
+
+ this.r = Math.pow( color.r, safeInverse );
+ this.g = Math.pow( color.g, safeInverse );
+ this.b = Math.pow( color.b, safeInverse );
+
+ return this;
+
+ },
+
+ convertGammaToLinear: function () {
+
+ var r = this.r, g = this.g, b = this.b;
+
+ this.r = r * r;
+ this.g = g * g;
+ this.b = b * b;
+
+ return this;
+
+ },
+
+ convertLinearToGamma: function () {
+
+ this.r = Math.sqrt( this.r );
+ this.g = Math.sqrt( this.g );
+ this.b = Math.sqrt( this.b );
+
+ return this;
+
+ },
+
+ getHex: function () {
+
+ return ( this.r * 255 ) << 16 ^ ( this.g * 255 ) << 8 ^ ( this.b * 255 ) << 0;
+
+ },
+
+ getHexString: function () {
+
+ return ( '000000' + this.getHex().toString( 16 ) ).slice( - 6 );
+
+ },
+
+ getHSL: function ( optionalTarget ) {
+
+ // h,s,l ranges are in 0.0 - 1.0
+
+ var hsl = optionalTarget || { h: 0, s: 0, l: 0 };
+
+ var r = this.r, g = this.g, b = this.b;
+
+ var max = Math.max( r, g, b );
+ var min = Math.min( r, g, b );
+
+ var hue, saturation;
+ var lightness = ( min + max ) / 2.0;
+
+ if ( min === max ) {
+
+ hue = 0;
+ saturation = 0;
+
+ } else {
+
+ var delta = max - min;
+
+ saturation = lightness <= 0.5 ? delta / ( max + min ) : delta / ( 2 - max - min );
+
+ switch ( max ) {
+
+ case r: hue = ( g - b ) / delta + ( g < b ? 6 : 0 ); break;
+ case g: hue = ( b - r ) / delta + 2; break;
+ case b: hue = ( r - g ) / delta + 4; break;
+
+ }
+
+ hue /= 6;
+
+ }
+
+ hsl.h = hue;
+ hsl.s = saturation;
+ hsl.l = lightness;
+
+ return hsl;
+
+ },
+
+ getStyle: function () {
+
+ return 'rgb(' + ( ( this.r * 255 ) | 0 ) + ',' + ( ( this.g * 255 ) | 0 ) + ',' + ( ( this.b * 255 ) | 0 ) + ')';
+
+ },
+
+ offsetHSL: function ( h, s, l ) {
+
+ var hsl = this.getHSL();
+
+ hsl.h += h; hsl.s += s; hsl.l += l;
+
+ this.setHSL( hsl.h, hsl.s, hsl.l );
+
+ return this;
+
+ },
+
+ add: function ( color ) {
+
+ this.r += color.r;
+ this.g += color.g;
+ this.b += color.b;
+
+ return this;
+
+ },
+
+ addColors: function ( color1, color2 ) {
+
+ this.r = color1.r + color2.r;
+ this.g = color1.g + color2.g;
+ this.b = color1.b + color2.b;
+
+ return this;
+
+ },
+
+ addScalar: function ( s ) {
+
+ this.r += s;
+ this.g += s;
+ this.b += s;
+
+ return this;
+
+ },
+
+ sub: function ( color ) {
+
+ this.r = Math.max( 0, this.r - color.r );
+ this.g = Math.max( 0, this.g - color.g );
+ this.b = Math.max( 0, this.b - color.b );
+
+ return this;
+
+ },
+
+ multiply: function ( color ) {
+
+ this.r *= color.r;
+ this.g *= color.g;
+ this.b *= color.b;
+
+ return this;
+
+ },
+
+ multiplyScalar: function ( s ) {
+
+ this.r *= s;
+ this.g *= s;
+ this.b *= s;
+
+ return this;
+
+ },
+
+ lerp: function ( color, alpha ) {
+
+ this.r += ( color.r - this.r ) * alpha;
+ this.g += ( color.g - this.g ) * alpha;
+ this.b += ( color.b - this.b ) * alpha;
+
+ return this;
+
+ },
+
+ equals: function ( c ) {
+
+ return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
+
+ },
+
+ fromArray: function ( array, offset ) {
+
+ if ( offset === undefined ) offset = 0;
+
+ this.r = array[ offset ];
+ this.g = array[ offset + 1 ];
+ this.b = array[ offset + 2 ];
+
+ return this;
+
+ },
+
+ toArray: function ( array, offset ) {
+
+ if ( array === undefined ) array = [];
+ if ( offset === undefined ) offset = 0;
+
+ array[ offset ] = this.r;
+ array[ offset + 1 ] = this.g;
+ array[ offset + 2 ] = this.b;
+
+ return array;
+
+ },
+
+ toJSON: function () {
+
+ return this.getHex();
+
+ }
+
+ } );
+
+ /**
+ * Uniforms library for shared webgl shaders
+ */
+
+ var UniformsLib = {
+
+ common: {
+
+ diffuse: { value: new Color( 0xeeeeee ) },
+ opacity: { value: 1.0 },
+
+ map: { value: null },
+ uvTransform: { value: new Matrix3() },
+
+ alphaMap: { value: null },
+
+ },
+
+ specularmap: {
+
+ specularMap: { value: null },
+
+ },
+
+ envmap: {
+
+ envMap: { value: null },
+ flipEnvMap: { value: - 1 },
+ reflectivity: { value: 1.0 },
+ refractionRatio: { value: 0.98 }
+
+ },
+
+ aomap: {
+
+ aoMap: { value: null },
+ aoMapIntensity: { value: 1 }
+
+ },
+
+ lightmap: {
+
+ lightMap: { value: null },
+ lightMapIntensity: { value: 1 }
+
+ },
+
+ emissivemap: {
+
+ emissiveMap: { value: null }
+
+ },
+
+ bumpmap: {
+
+ bumpMap: { value: null },
+ bumpScale: { value: 1 }
+
+ },
+
+ normalmap: {
+
+ normalMap: { value: null },
+ normalScale: { value: new Vector2( 1, 1 ) }
+
+ },
+
+ displacementmap: {
+
+ displacementMap: { value: null },
+ displacementScale: { value: 1 },
+ displacementBias: { value: 0 }
+
+ },
+
+ roughnessmap: {
+
+ roughnessMap: { value: null }
+
+ },
+
+ metalnessmap: {
+
+ metalnessMap: { value: null }
+
+ },
+
+ gradientmap: {
+
+ gradientMap: { value: null }
+
+ },
+
+ fog: {
+
+ fogDensity: { value: 0.00025 },
+ fogNear: { value: 1 },
+ fogFar: { value: 2000 },
+ fogColor: { value: new Color( 0xffffff ) }
+
+ },
+
+ lights: {
+
+ ambientLightColor: { value: [] },
+
+ directionalLights: { value: [], properties: {
+ direction: {},
+ color: {},
+
+ shadow: {},
+ shadowBias: {},
+ shadowRadius: {},
+ shadowMapSize: {}
+ } },
+
+ directionalShadowMap: { value: [] },
+ directionalShadowMatrix: { value: [] },
+
+ spotLights: { value: [], properties: {
+ color: {},
+ position: {},
+ direction: {},
+ distance: {},
+ coneCos: {},
+ penumbraCos: {},
+ decay: {},
+
+ shadow: {},
+ shadowBias: {},
+ shadowRadius: {},
+ shadowMapSize: {}
+ } },
+
+ spotShadowMap: { value: [] },
+ spotShadowMatrix: { value: [] },
+
+ pointLights: { value: [], properties: {
+ color: {},
+ position: {},
+ decay: {},
+ distance: {},
+
+ shadow: {},
+ shadowBias: {},
+ shadowRadius: {},
+ shadowMapSize: {},
+ shadowCameraNear: {},
+ shadowCameraFar: {}
+ } },
+
+ pointShadowMap: { value: [] },
+ pointShadowMatrix: { value: [] },
+
+ hemisphereLights: { value: [], properties: {
+ direction: {},
+ skyColor: {},
+ groundColor: {}
+ } },
+
+ // TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src
+ rectAreaLights: { value: [], properties: {
+ color: {},
+ position: {},
+ width: {},
+ height: {}
+ } }
+
+ },
+
+ points: {
+
+ diffuse: { value: new Color( 0xeeeeee ) },
+ opacity: { value: 1.0 },
+ size: { value: 1.0 },
+ scale: { value: 1.0 },
+ map: { value: null },
+ uvTransform: { value: new Matrix3() }
+
+ }
+
+ };
+
+ /**
+ * Uniform Utilities
+ */
+
+ var UniformsUtils = {
+
+ merge: function ( uniforms ) {
+
+ var merged = {};
+
+ for ( var u = 0; u < uniforms.length; u ++ ) {
+
+ var tmp = this.clone( uniforms[ u ] );
+
+ for ( var p in tmp ) {
+
+ merged[ p ] = tmp[ p ];
+
+ }
+
+ }
+
+ return merged;
+
+ },
+
+ clone: function ( uniforms_src ) {
+
+ var uniforms_dst = {};
+
+ for ( var u in uniforms_src ) {
+
+ uniforms_dst[ u ] = {};
+
+ for ( var p in uniforms_src[ u ] ) {
+
+ var parameter_src = uniforms_src[ u ][ p ];
+
+ if ( parameter_src && ( parameter_src.isColor ||
+ parameter_src.isMatrix3 || parameter_src.isMatrix4 ||
+ parameter_src.isVector2 || parameter_src.isVector3 || parameter_src.isVector4 ||
+ parameter_src.isTexture ) ) {
+
+ uniforms_dst[ u ][ p ] = parameter_src.clone();
+
+ } else if ( Array.isArray( parameter_src ) ) {
+
+ uniforms_dst[ u ][ p ] = parameter_src.slice();
+
+ } else {
+
+ uniforms_dst[ u ][ p ] = parameter_src;
+
+ }
+
+ }
+
+ }
+
+ return uniforms_dst;
+
+ }
+
+ };
+
+ var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n";
+
+ var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n";
+
+ var alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n";
+
+ var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n";
+
+ var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";
+
+ var begin_vertex = "\nvec3 transformed = vec3( position );\n";
+
+ var beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n";
+
+ var bsdfs = "float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n";
+
+ var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n";
+
+ var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n";
+
+ var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n";
+
+ var clipping_planes_pars_vertex = "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n";
+
+ var clipping_planes_vertex = "#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n";
+
+ var color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif";
+
+ var color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n";
+
+ var color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif";
+
+ var color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif";
+
+ var common = "#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\n";
+
+ var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n";
+
+ var defaultnormal_vertex = "vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n";
+
+ var displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n";
+
+ var displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n";
+
+ var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n";
+
+ var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n";
+
+ var encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n";
+
+ var encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n";
+
+ var envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n";
+
+ var envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n";
+
+ var envmap_pars_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n";
+
+ var envmap_vertex = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n";
+
+ var fog_vertex = "\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif";
+
+ var fog_pars_vertex = "#ifdef USE_FOG\n varying float fogDepth;\n#endif\n";
+
+ var fog_fragment = "#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n";
+
+ var fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n";
+
+ var gradientmap_pars_fragment = "#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n";
+
+ var lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n";
+
+ var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif";
+
+ var lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n";
+
+ var lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n";
+
+ var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n";
+
+ var lights_phong_pars_fragment = "varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n";
+
+ var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n";
+
+ var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n";
+
+ var lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n";
+
+ var logdepthbuf_fragment = "#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif";
+
+ var logdepthbuf_pars_fragment = "#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n";
+
+ var logdepthbuf_pars_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif";
+
+ var logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n";
+
+ var map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n";
+
+ var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n";
+
+ var map_particle_fragment = "#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n";
+
+ var map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n";
+
+ var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n";
+
+ var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";
+
+ var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n";
+
+ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
+
+ var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
+
+ var normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n";
+
+ var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n";
+
+ var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n";
+
+ var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n";
+
+ var project_vertex = "vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n";
+
+ var dithering_fragment = "#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n";
+
+ var dithering_pars_fragment = "#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n";
+
+ var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n";
+
+ var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif";
+
+ var shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n";
+
+ var shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n";
+
+ var shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n";
+
+ var shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n";
+
+ var skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif";
+
+ var skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n";
+
+ var skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n";
+
+ var skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n";
+
+ var specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif";
+
+ var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif";
+
+ var tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n";
+
+ var tonemapping_pars_fragment = "#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n";
+
+ var uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif";
+
+ var uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n";
+
+ var uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif";
+
+ var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif";
+
+ var uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif";
+
+ var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif";
+
+ var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n";
+
+ var cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n";
+
+ var cube_vert = "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}\n";
+
+ var depth_frag = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n";
+
+ var depth_vert = "#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n";
+
+ var distanceRGBA_frag = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n";
+
+ var distanceRGBA_vert = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}\n";
+
+ var equirect_frag = "uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n";
+
+ var equirect_vert = "varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n";
+
+ var linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n";
+
+ var linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n";
+
+ var meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n";
+
+ var meshbasic_vert = "#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n";
+
+ var meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include