UNPKG

x_ite

Version:

X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.

1,298 lines (1,110 loc) 79.9 kB
/* X_ITE v11.5.0 */ const __X_ITE_X3D__ = window [Symbol .for ("X_ITE.X3D-11.5.0")]; /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ // UNUSED EXPORTS: default ;// external "__X_ITE_X3D__ .Components" const external_X_ITE_X3D_Components_namespaceObject = __X_ITE_X3D__ .Components; var external_X_ITE_X3D_Components_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Components_namespaceObject); ;// external "__X_ITE_X3D__ .X3DBaseNode" const external_X_ITE_X3D_X3DBaseNode_namespaceObject = __X_ITE_X3D__ .X3DBaseNode; var external_X_ITE_X3D_X3DBaseNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DBaseNode_namespaceObject); ;// external "__X_ITE_X3D__ .X3DConstants" const external_X_ITE_X3D_X3DConstants_namespaceObject = __X_ITE_X3D__ .X3DConstants; var external_X_ITE_X3D_X3DConstants_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DConstants_namespaceObject); ;// external "__X_ITE_X3D__ .Fields" const external_X_ITE_X3D_Fields_namespaceObject = __X_ITE_X3D__ .Fields; var external_X_ITE_X3D_Fields_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Fields_namespaceObject); ;// external "__X_ITE_X3D__ .Namespace" const external_X_ITE_X3D_Namespace_namespaceObject = __X_ITE_X3D__ .Namespace; var external_X_ITE_X3D_Namespace_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Namespace_namespaceObject); ;// ./src/x_ite/Browser/Geometry2D/Arc2DOptions.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function Arc2DOptions (executionContext) { external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext); this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40)) } Object .setPrototypeOf (Arc2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype); Object .defineProperties (Arc2DOptions, { typeName: { value: "Arc2DOptions", enumerable: true, }, }); const __default__ = Arc2DOptions; ; /* harmony default export */ const Geometry2D_Arc2DOptions = (external_X_ITE_X3D_Namespace_default().add ("Arc2DOptions", __default__)); ;// ./src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function ArcClose2DOptions (executionContext) { external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext); this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40)) } Object .setPrototypeOf (ArcClose2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype); Object .defineProperties (ArcClose2DOptions, { typeName: { value: "ArcClose2DOptions", enumerable: true, }, }); const ArcClose2DOptions_default_ = ArcClose2DOptions; ; /* harmony default export */ const Geometry2D_ArcClose2DOptions = (external_X_ITE_X3D_Namespace_default().add ("ArcClose2DOptions", ArcClose2DOptions_default_)); ;// external "__X_ITE_X3D__ .IndexedLineSet" const external_X_ITE_X3D_IndexedLineSet_namespaceObject = __X_ITE_X3D__ .IndexedLineSet; var external_X_ITE_X3D_IndexedLineSet_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_IndexedLineSet_namespaceObject); ;// external "__X_ITE_X3D__ .Coordinate" const external_X_ITE_X3D_Coordinate_namespaceObject = __X_ITE_X3D__ .Coordinate; var external_X_ITE_X3D_Coordinate_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Coordinate_namespaceObject); ;// external "__X_ITE_X3D__ .Complex" const external_X_ITE_X3D_Complex_namespaceObject = __X_ITE_X3D__ .Complex; var external_X_ITE_X3D_Complex_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Complex_namespaceObject); ;// ./src/x_ite/Browser/Geometry2D/Circle2DOptions.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function Circle2DOptions (executionContext) { external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext); this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40)) } Object .assign (Object .setPrototypeOf (Circle2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype), { initialize () { external_X_ITE_X3D_X3DBaseNode_default().prototype .initialize .call (this); this .addInterest ("eventsProcessed", this); }, getGeometry () { if (!this .geometry) this .build (); return this .geometry; }, createCoordIndex () { const dimension = this ._dimension .getValue (), coordIndex = this .geometry ._coordIndex; for (let n = 0; n < dimension; ++ n) coordIndex .push (n); coordIndex .push (0, -1); }, createPoints () { const dimension = this ._dimension .getValue (), angle = Math .PI * 2 / dimension, point = this .geometry ._coord .getValue () ._point; for (let n = 0; n < dimension; ++ n) { const p = external_X_ITE_X3D_Complex_default().Polar (1, angle * n); point .push (new (external_X_ITE_X3D_Fields_default()).SFVec3f (p .real, p .imag, 0)); } }, build () { this .geometry = new (external_X_ITE_X3D_IndexedLineSet_default()) (this .getExecutionContext ()); this .geometry ._coord = new (external_X_ITE_X3D_Coordinate_default()) (this .getExecutionContext ()); this .createCoordIndex (); this .createPoints (); const geometry = this .geometry, coord = this .geometry ._coord .getValue (); coord .setup (); geometry .setup (); }, eventsProcessed () { this .geometry = null; }, }); Object .defineProperties (Circle2DOptions, { typeName: { value: "Circle2DOptions", enumerable: true, }, }); const Circle2DOptions_default_ = Circle2DOptions; ; /* harmony default export */ const Geometry2D_Circle2DOptions = (external_X_ITE_X3D_Namespace_default().add ("Circle2DOptions", Circle2DOptions_default_)); ;// external "__X_ITE_X3D__ .X3DGeometryNode" const external_X_ITE_X3D_X3DGeometryNode_namespaceObject = __X_ITE_X3D__ .X3DGeometryNode; var external_X_ITE_X3D_X3DGeometryNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DGeometryNode_namespaceObject); ;// ./src/x_ite/Browser/Geometry2D/Disk2DOptions.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function Disk2DOptions (executionContext) { external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext); this .addChildObjects ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "dimension", new (external_X_ITE_X3D_Fields_default()).SFInt32 (40)) this .diskTexCoords = external_X_ITE_X3D_X3DGeometryNode_default().createArray (); this .diskNormals = external_X_ITE_X3D_X3DGeometryNode_default().createArray (); this .diskVertices = external_X_ITE_X3D_X3DGeometryNode_default().createArray (); } Object .assign (Object .setPrototypeOf (Disk2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype), { initialize () { external_X_ITE_X3D_X3DBaseNode_default().prototype .initialize .call (this); this .addInterest ("eventsProcessed", this); }, getDiskTexCoords () { if (!this .diskTexCoords .length) this .build (); return this .diskTexCoords; }, getDiskNormals () { if (!this .diskNormals .length) this .build (); return this .diskNormals; }, getDiskVertices () { if (!this .diskVertices .length) this .build (); return this .diskVertices; }, build: (() => { const half = new (external_X_ITE_X3D_Complex_default()) (0.5, 0.5), texCoord1 = new (external_X_ITE_X3D_Complex_default()) (), texCoord2 = new (external_X_ITE_X3D_Complex_default()) (), point1 = new (external_X_ITE_X3D_Complex_default()) (), point2 = new (external_X_ITE_X3D_Complex_default()) (); return function () { const dimension = this ._dimension .getValue (), angle = Math .PI * 2 / dimension, diskTexCoords = this .diskTexCoords, diskNormals = this .diskNormals, diskVertices = this .diskVertices; for (let n = 0; n < dimension; ++ n) { const theta1 = angle * n, theta2 = angle * (n + 1); texCoord1 .setPolar (0.5, theta1) .add (half); texCoord2 .setPolar (0.5, theta2) .add (half); point1 .setPolar (1, theta1); point2 .setPolar (1, theta2); // Disk diskTexCoords .push (0.5, 0.5, 0, 1, texCoord1 .real, texCoord1 .imag, 0, 1, texCoord2 .real, texCoord2 .imag, 0, 1); diskNormals .push (0, 0, 1, 0, 0, 1, 0, 0, 1); diskVertices .push (0, 0, 0, 1, point1 .real, point1 .imag, 0, 1, point2 .real, point2 .imag, 0, 1); } diskTexCoords .shrinkToFit (); diskNormals .shrinkToFit (); diskVertices .shrinkToFit (); }; })(), eventsProcessed () { this .diskTexCoords .length = 0; this .diskNormals .length = 0; this .diskVertices .length = 0; }, }); Object .defineProperties (Disk2DOptions, { typeName: { value: "Disk2DOptions", enumerable: true, }, }); const Disk2DOptions_default_ = Disk2DOptions; ; /* harmony default export */ const Geometry2D_Disk2DOptions = (external_X_ITE_X3D_Namespace_default().add ("Disk2DOptions", Disk2DOptions_default_)); ;// external "__X_ITE_X3D__ .IndexedFaceSet" const external_X_ITE_X3D_IndexedFaceSet_namespaceObject = __X_ITE_X3D__ .IndexedFaceSet; var external_X_ITE_X3D_IndexedFaceSet_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_IndexedFaceSet_namespaceObject); ;// external "__X_ITE_X3D__ .TextureCoordinate" const external_X_ITE_X3D_TextureCoordinate_namespaceObject = __X_ITE_X3D__ .TextureCoordinate; var external_X_ITE_X3D_TextureCoordinate_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_TextureCoordinate_namespaceObject); ;// ./src/x_ite/Browser/Geometry2D/Rectangle2DOptions.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function Rectangle2DOptions (executionContext) { external_X_ITE_X3D_X3DBaseNode_default().call (this, executionContext); } Object .assign (Object .setPrototypeOf (Rectangle2DOptions .prototype, (external_X_ITE_X3D_X3DBaseNode_default()).prototype), { getGeometry () { if (this .geometry) return this .geometry; this .geometry = new (external_X_ITE_X3D_IndexedFaceSet_default()) (this .getExecutionContext ()); this .geometry ._texCoord = new (external_X_ITE_X3D_TextureCoordinate_default()) (this .getExecutionContext ()); this .geometry ._coord = new (external_X_ITE_X3D_Coordinate_default()) (this .getExecutionContext ()); const geometry = this .geometry, texCoord = this .geometry ._texCoord .getValue (), coord = this .geometry ._coord .getValue (); texCoord ._point = [1, 1, 0, 1, 0, 0, 1, 0]; coord ._point = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0]; geometry ._coordIndex = [0, 1, 2, 3, -1]; texCoord .setup (); coord .setup (); geometry .setup (); return this .geometry; }, }); Object .defineProperties (Rectangle2DOptions, { typeName: { value: "Rectangle2DOptions", enumerable: true, }, }); const Rectangle2DOptions_default_ = Rectangle2DOptions; ; /* harmony default export */ const Geometry2D_Rectangle2DOptions = (external_X_ITE_X3D_Namespace_default().add ("Rectangle2DOptions", Rectangle2DOptions_default_)); ;// external "__X_ITE_X3D__ .PrimitiveQuality" const external_X_ITE_X3D_PrimitiveQuality_namespaceObject = __X_ITE_X3D__ .PrimitiveQuality; var external_X_ITE_X3D_PrimitiveQuality_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_PrimitiveQuality_namespaceObject); ;// ./src/x_ite/Browser/Geometry2D/X3DGeometry2DContext.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ const _arc2DOptions = Symbol (), _arcClose2DOptions = Symbol (), _circle2DOptions = Symbol (), _disk2DOptions = Symbol (), _rectangle2DOptions = Symbol (); function X3DGeometry2DContext () { } Object .assign (X3DGeometry2DContext .prototype, { initialize () { this .setPrimitiveQuality2D (this .getBrowserOptions () .getPrimitiveQuality ()); }, getArc2DOptions () { return getOptionNode .call (this, _arc2DOptions, Geometry2D_Arc2DOptions); }, getArcClose2DOptions () { return getOptionNode .call (this, _arcClose2DOptions, Geometry2D_ArcClose2DOptions); }, getCircle2DOptions () { return getOptionNode .call (this, _circle2DOptions, Geometry2D_Circle2DOptions); }, getDisk2DOptions () { return getOptionNode .call (this, _disk2DOptions, Geometry2D_Disk2DOptions); }, getRectangle2DOptions () { return getOptionNode .call (this, _rectangle2DOptions, Geometry2D_Rectangle2DOptions); }, setPrimitiveQuality2D (primitiveQuality) { const arc = this .getArc2DOptions (), arcClose = this .getArcClose2DOptions (), circle = this .getCircle2DOptions (), disk = this .getDisk2DOptions (); switch (primitiveQuality) { case (external_X_ITE_X3D_PrimitiveQuality_default()).LOW: { arc ._dimension = 20; arcClose ._dimension = 20; circle ._dimension = 20; disk ._dimension = 20; break; } case (external_X_ITE_X3D_PrimitiveQuality_default()).MEDIUM: { arc ._dimension = 40; arcClose ._dimension = 40; circle ._dimension = 40; disk ._dimension = 40; break; } case (external_X_ITE_X3D_PrimitiveQuality_default()).HIGH: { arc ._dimension = 80; arcClose ._dimension = 80; circle ._dimension = 80; disk ._dimension = 80; break; } } }, }); function getOptionNode (key, OptionNode) { return this [key] ??= (() => { const optionNode = new OptionNode (this .getPrivateScene ()); optionNode .setup (); return optionNode; })(); } const X3DGeometry2DContext_default_ = X3DGeometry2DContext; ; /* harmony default export */ const Geometry2D_X3DGeometry2DContext = (external_X_ITE_X3D_Namespace_default().add ("X3DGeometry2DContext", X3DGeometry2DContext_default_)); ;// external "__X_ITE_X3D__ .X3DFieldDefinition" const external_X_ITE_X3D_X3DFieldDefinition_namespaceObject = __X_ITE_X3D__ .X3DFieldDefinition; var external_X_ITE_X3D_X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DFieldDefinition_namespaceObject); ;// external "__X_ITE_X3D__ .FieldDefinitionArray" const external_X_ITE_X3D_FieldDefinitionArray_namespaceObject = __X_ITE_X3D__ .FieldDefinitionArray; var external_X_ITE_X3D_FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_FieldDefinitionArray_namespaceObject); ;// external "__X_ITE_X3D__ .X3DNode" const external_X_ITE_X3D_X3DNode_namespaceObject = __X_ITE_X3D__ .X3DNode; var external_X_ITE_X3D_X3DNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DNode_namespaceObject); ;// external "__X_ITE_X3D__ .X3DLineGeometryNode" const external_X_ITE_X3D_X3DLineGeometryNode_namespaceObject = __X_ITE_X3D__ .X3DLineGeometryNode; var external_X_ITE_X3D_X3DLineGeometryNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DLineGeometryNode_namespaceObject); ;// external "__X_ITE_X3D__ .Algorithm" const external_X_ITE_X3D_Algorithm_namespaceObject = __X_ITE_X3D__ .Algorithm; var external_X_ITE_X3D_Algorithm_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_Algorithm_namespaceObject); ;// ./src/x_ite/Components/Geometry2D/Arc2D.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function Arc2D (executionContext) { external_X_ITE_X3D_X3DLineGeometryNode_default().call (this, executionContext); this .addType ((external_X_ITE_X3D_X3DConstants_default()).Arc2D); // Units this ._startAngle .setUnit ("angle"); this ._endAngle .setUnit ("angle"); this ._radius .setUnit ("length"); } Object .assign (Object .setPrototypeOf (Arc2D .prototype, (external_X_ITE_X3D_X3DLineGeometryNode_default()).prototype), { set_live__ () { external_X_ITE_X3D_X3DLineGeometryNode_default().prototype .set_live__ .call (this); const browser = this .getBrowser (), alwaysUpdate = this .isLive () && browser .getBrowserOption ("AlwaysUpdateGeometries"); if (this .getLive () .getValue () || alwaysUpdate) browser .getArc2DOptions () .addInterest ("requestRebuild", this); else browser .getArc2DOptions () .removeInterest ("requestRebuild", this); }, getSweepAngle () { const start = external_X_ITE_X3D_Algorithm_default().interval (this ._startAngle .getValue (), 0, Math .PI * 2), end = external_X_ITE_X3D_Algorithm_default().interval (this ._endAngle .getValue (), 0, Math .PI * 2); if (start === end) return Math .PI * 2; const sweepAngle = Math .abs (end - start); if (start > end) return (Math .PI * 2) - sweepAngle; if (! isNaN (sweepAngle)) return sweepAngle; // We must test for NAN, as NAN to int is undefined. return 0; }, build () { const options = this .getBrowser () .getArc2DOptions (), dimension = options ._dimension .getValue (), startAngle = this ._startAngle .getValue (), radius = Math .abs (this ._radius .getValue ()), sweepAngle = this .getSweepAngle (), steps = Math .max (3, Math .floor (sweepAngle * dimension / (Math .PI * 2))), vertexArray = this .getVertices (); for (let n = 0; n < steps; ++ n) { const t1 = n / steps, theta1 = startAngle + (sweepAngle * t1), point1 = external_X_ITE_X3D_Complex_default().Polar (radius, theta1), t2 = (n + 1) / steps, theta2 = startAngle + (sweepAngle * t2), point2 = external_X_ITE_X3D_Complex_default().Polar (radius, theta2); vertexArray .push (point1 .real, point1 .imag, 0, 1); vertexArray .push (point2 .real, point2 .imag, 0, 1); } this .getMin () .set (-radius, -radius, 0); this .getMax () .set ( radius, radius, 0); }, }); Object .defineProperties (Arc2D, { ... external_X_ITE_X3D_X3DNode_default().getStaticProperties ("Arc2D", "Geometry2D", 2, "geometry", "3.0"), fieldDefinitions: { value: new (external_X_ITE_X3D_FieldDefinitionArray_default()) ([ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "metadata", new (external_X_ITE_X3D_Fields_default()).SFNode ()), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "startAngle", new (external_X_ITE_X3D_Fields_default()).SFFloat ()), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "endAngle", new (external_X_ITE_X3D_Fields_default()).SFFloat (1.570796)), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "radius", new (external_X_ITE_X3D_Fields_default()).SFFloat (1)), ]), enumerable: true, }, }); const Arc2D_default_ = Arc2D; ; /* harmony default export */ const Geometry2D_Arc2D = (external_X_ITE_X3D_Namespace_default().add ("Arc2D", Arc2D_default_)); ;// ./src/x_ite/Components/Geometry2D/ArcClose2D.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function ArcClose2D (executionContext) { external_X_ITE_X3D_X3DGeometryNode_default().call (this, executionContext); this .addType ((external_X_ITE_X3D_X3DConstants_default()).ArcClose2D); this .setGeometryType (2); // Units this ._startAngle .setUnit ("angle"); this ._endAngle .setUnit ("angle"); this ._radius .setUnit ("length"); } Object .assign (Object .setPrototypeOf (ArcClose2D .prototype, (external_X_ITE_X3D_X3DGeometryNode_default()).prototype), { set_live__ () { external_X_ITE_X3D_X3DGeometryNode_default().prototype .set_live__ .call (this); const browser = this .getBrowser (), alwaysUpdate = this .isLive () && browser .getBrowserOption ("AlwaysUpdateGeometries"); if (this .getLive () .getValue () || alwaysUpdate) browser .getArcClose2DOptions () .addInterest ("requestRebuild", this); else browser .getArcClose2DOptions () .removeInterest ("requestRebuild", this); }, getSweepAngle () { const start = external_X_ITE_X3D_Algorithm_default().interval (this ._startAngle .getValue (), 0, Math .PI * 2), end = external_X_ITE_X3D_Algorithm_default().interval (this ._endAngle .getValue (), 0, Math .PI * 2); if (start === end) return Math .PI * 2; const sweepAngle = Math .abs (end - start); if (start > end) return (Math .PI * 2) - sweepAngle; if (! isNaN (sweepAngle)) return sweepAngle; // We must test for NAN, as NAN to int is undefined. return 0; }, build: (() => { const half = new (external_X_ITE_X3D_Complex_default()) (0.5, 0.5); return function () { const options = this .getBrowser () .getArcClose2DOptions (), chord = this ._closureType .getValue () === "CHORD", dimension = options ._dimension .getValue (), startAngle = this ._startAngle .getValue (), radius = Math .abs (this ._radius .getValue ()), sweepAngle = this .getSweepAngle (), steps = Math .max (4, Math .floor (sweepAngle * dimension / (Math .PI * 2))), texCoordArray = this .getTexCoords (), normalArray = this .getNormals (), vertexArray = this .getVertices (), texCoords = [ ], points = [ ]; this .getMultiTexCoords () .push (texCoordArray); const steps_1 = steps - 1; for (let n = 0; n < steps; ++ n) { const t = n / steps_1, theta = startAngle + (sweepAngle * t); texCoords .push (external_X_ITE_X3D_Complex_default().Polar (0.5, theta) .add (half)); points .push (external_X_ITE_X3D_Complex_default().Polar (radius, theta)); } if (chord) { const t0 = texCoords [0], p0 = points [0]; for (let i = 1; i < steps_1; ++ i) { const t1 = texCoords [i], t2 = texCoords [i + 1], p1 = points [i], p2 = points [i + 1]; texCoordArray .push (t0 .real, t0 .imag, 0, 1, t1 .real, t1 .imag, 0, 1, t2 .real, t2 .imag, 0, 1); normalArray .push (0, 0, 1, 0, 0, 1, 0, 0, 1); vertexArray .push (p0 .real, p0 .imag, 0, 1, p1 .real, p1 .imag, 0, 1, p2 .real, p2 .imag, 0, 1); } } else { for (let i = 0; i < steps_1; ++ i) { const t1 = texCoords [i], t2 = texCoords [i + 1], p1 = points [i], p2 = points [i + 1]; texCoordArray .push (0.5, 0.5, 0, 1, t1 .real, t1 .imag, 0, 1, t2 .real, t2 .imag, 0, 1); normalArray .push (0, 0, 1, 0, 0, 1, 0, 0, 1); vertexArray .push (0, 0, 0, 1, p1 .real, p1 .imag, 0, 1, p2 .real, p2 .imag, 0, 1); } } this .getMin () .set (-radius, -radius, 0); this .getMax () .set ( radius, radius, 0); this .setSolid (this ._solid .getValue ()); }; })(), }); Object .defineProperties (ArcClose2D, { ... external_X_ITE_X3D_X3DNode_default().getStaticProperties ("ArcClose2D", "Geometry2D", 2, "geometry", "3.0"), fieldDefinitions: { value: new (external_X_ITE_X3D_FieldDefinitionArray_default()) ([ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "metadata", new (external_X_ITE_X3D_Fields_default()).SFNode ()), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "closureType", new (external_X_ITE_X3D_Fields_default()).SFString ("PIE")), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "startAngle", new (external_X_ITE_X3D_Fields_default()).SFFloat ()), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "endAngle", new (external_X_ITE_X3D_Fields_default()).SFFloat (1.570796)), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "radius", new (external_X_ITE_X3D_Fields_default()).SFFloat (1)), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "solid", new (external_X_ITE_X3D_Fields_default()).SFBool ()), ]), enumerable: true, }, }); const ArcClose2D_default_ = ArcClose2D; ; /* harmony default export */ const Geometry2D_ArcClose2D = (external_X_ITE_X3D_Namespace_default().add ("ArcClose2D", ArcClose2D_default_)); ;// ./src/x_ite/Components/Geometry2D/Circle2D.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written * permission of create3000. * * NON-MILITARY USE ONLY * * All create3000 software are effectively free software with a non-military use * restriction. It is free. Well commented source is provided. You may reuse the * source in any way you please with the exception anything that uses it must be * marked to indicate is contains 'non-military use only' components. * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2011 - 2022, Holger Seelig <holger.seelig@yahoo.de>. * * This file is part of the X_ITE Project. * * X_ITE is free software: you can redistribute it and/or modify it under the * terms of the GNU General Public License version 3 only, as published by the * Free Software Foundation. * * X_ITE 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 version 3 for more * details (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU General Public License version 3 * along with X_ITE. If not, see <https://www.gnu.org/licenses/gpl.html> for a * copy of the GPLv3 License. * * For Silvio, Joy and Adi. * ******************************************************************************/ function Circle2D (executionContext) { external_X_ITE_X3D_X3DLineGeometryNode_default().call (this, executionContext); this .addType ((external_X_ITE_X3D_X3DConstants_default()).Circle2D); // Units this ._radius .setUnit ("length"); } Object .assign (Object .setPrototypeOf (Circle2D .prototype, (external_X_ITE_X3D_X3DLineGeometryNode_default()).prototype), { set_live__ () { external_X_ITE_X3D_X3DLineGeometryNode_default().prototype .set_live__ .call (this); const browser = this .getBrowser (), alwaysUpdate = this .isLive () && browser .getBrowserOption ("AlwaysUpdateGeometries"); if (this .getLive () .getValue () || alwaysUpdate) browser .getCircle2DOptions () .addInterest ("requestRebuild", this); else browser .getCircle2DOptions () .removeInterest ("requestRebuild", this); }, build () { const options = this .getBrowser () .getCircle2DOptions (), geometry = options .getGeometry (), vertexArray = this .getVertices (), radius = this ._radius .getValue (); if (radius === 1) { vertexArray .assign (geometry .getVertices ()); } else { const defaultVertices = geometry .getVertices () .getValue (); for (let i = 0, length = defaultVertices .length; i < length; i += 4) vertexArray .push (defaultVertices [i] * radius, defaultVertices [i + 1] * radius, 0, 1); } this .getMin () .set (-radius, -radius, 0); this .getMax () .set ( radius, radius, 0); }, }); Object .defineProperties (Circle2D, { ... external_X_ITE_X3D_X3DNode_default().getStaticProperties ("Circle2D", "Geometry2D", 2, "geometry", "3.0"), fieldDefinitions: { value: new (external_X_ITE_X3D_FieldDefinitionArray_default()) ([ new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).inputOutput, "metadata", new (external_X_ITE_X3D_Fields_default()).SFNode ()), new (external_X_ITE_X3D_X3DFieldDefinition_default()) ((external_X_ITE_X3D_X3DConstants_default()).initializeOnly, "radius", new (external_X_ITE_X3D_Fields_default()).SFFloat (1)), ]), enumerable: true, }, }); const Circle2D_default_ = Circle2D; ; /* harmony default export */ const Geometry2D_Circle2D = (external_X_ITE_X3D_Namespace_default().add ("Circle2D", Circle2D_default_)); ;// external "__X_ITE_X3D__ .X3DPointGeometryNode" const external_X_ITE_X3D_X3DPointGeometryNode_namespaceObject = __X_ITE_X3D__ .X3DPointGeometryNode; var external_X_ITE_X3D_X3DPointGeometryNode_default = /*#__PURE__*/__webpack_require__.n(external_X_ITE_X3D_X3DPointGeometryNode_namespaceObject); ;// ./src/x_ite/Components/Geometry2D/Disk2D.js /******************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright create3000, Scheffelstraße 31a, Leipzig, Germany 2011 - 2022. * * All rights reserved. Holger Seelig <holger.seelig@yahoo.de>. * * The copyright notice above does not evidence any actual of intended * publication of such source code, and is an unpublished work by create3000. * This material contains CONFIDENTIAL INFORMATION that is the property of * create3000. * * No permission is granted to copy, distribute, or create derivative works from * the contents of this software, in whole or in part, without the prior written *