x_ite
Version:
X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.
2 lines • 11.5 kB
JavaScript
/* X_ITE v12.2.3 */
const e=window[Symbol.for("X_ITE.X3D-12.2.3")];(()=>{var t={n:e=>{var i=e&&e.__esModule?()=>e.default:()=>e;return t.d(i,{a:i}),i},d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const i=e.Components;var n=t.n(i);const s=e.Fields;var o=t.n(s);const r=e.X3DFieldDefinition;var l=t.n(r);const d=e.FieldDefinitionArray;var u=t.n(d);const a=e.X3DNode;var c=t.n(a);const b=e.X3DGroupingNode;var p=t.n(b);const O=e.X3DChildNode;var h=t.n(O);const w=e.X3DConstants;var j=t.n(w);const y=e.Namespace;var S=t.n(y);function _(e){h().call(this,e),this.addType(j().X3DProductStructureChildNode)}Object.setPrototypeOf(_.prototype,h().prototype),Object.defineProperties(_,c().getStaticProperties("X3DProductStructureChildNode","CADGeometry",2));const m=_,F=S().add("X3DProductStructureChildNode",m);function f(e){p().call(this,e),F.call(this,e),this.addType(j().CADAssembly)}Object.setPrototypeOf(f.prototype,p().prototype),Object.defineProperties(f,{...c().getStaticProperties("CADAssembly","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(u())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOnly,"addChildren",new(o().MFNode)),new(l())(j().inputOnly,"removeChildren",new(o().MFNode)),new(l())(j().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const g=f,C=S().add("CADAssembly",g),v=e.X3DBoundedObject;var D=t.n(v);const N=e.TraverseType;var P=t.n(N);const x=e.X3DCast;var B=t.n(x);function I(e){F.call(this,e),D().call(this,e),this.addType(j().CADFace),this.addChildObjects(j().outputOnly,"rebuild",new(o().SFTime)),this.setBoundedObject(!0),this.setPointingObject(!0),this.setCollisionObject(!0),this.setShadowObject(!0),this.setVisibleObject(!0),this.visibleObjects=[]}Object.assign(Object.setPrototypeOf(I.prototype,F.prototype),D().prototype,{initialize(){F.prototype.initialize.call(this),D().prototype.initialize.call(this),this._rebuild.addInterest("set_children__",this),this._bboxSize.addInterest("set_boundedObjects__",this),this._shape.addInterest("requestRebuild",this),this.set_children__()},getBBox(e,t){return this.isDefaultBBoxSize()?this.boundedObject?.getBBox(e,t)??e.set():e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getShapes(e,t){for(const i of this.visibleObjects)i.getShapes(e,t);return e},requestRebuild(){this._rebuild.addEvent()},set_children__(){this.setChild(B()(j().X3DChildNode,this._shape))},setChild(e){if(this.childNode){const e=this.childNode;e._isBoundedObject.removeInterest("requestRebuild",this),e._isPointingObject.removeInterest("requestRebuild",this),e._isCameraObject.removeInterest("requestRebuild",this),e._isPickableObject.removeInterest("requestRebuild",this),e._isCollisionObject.removeInterest("requestRebuild",this),e._isShadowObject.removeInterest("requestRebuild",this),e._isVisibleObject.removeInterest("requestRebuild",this),B()(j().X3DBoundedObject,e)&&(e._display.removeInterest("requestRebuild",this),e._bboxDisplay.removeInterest("requestRebuild",this))}if(this.childNode=null,this.boundedObject=null,this.pointingObject=null,this.cameraObject=null,this.pickableObject=null,this.collisionObject=null,this.shadowObject=null,this.visibleObjects.length=0,e){const t=e.getType();for(let i=t.length-1;i>=0;--i){switch(t[i]){case j().LOD:case j().Transform:case j().X3DShapeNode:e._isBoundedObject.addInterest("requestRebuild",this),e._isPointingObject.addInterest("requestRebuild",this),e._isCameraObject.addInterest("requestRebuild",this),e._isPickableObject.addInterest("requestRebuild",this),e._isCollisionObject.addInterest("requestRebuild",this),e._isShadowObject.addInterest("requestRebuild",this),e._isVisibleObject.addInterest("requestRebuild",this),this.childNode=e,e.isVisible()&&(e.isBoundedObject()&&(this.boundedObject=e),e.isPointingObject()&&(this.pointingObject=e),e.isCameraObject()&&(this.cameraObject=e),e.isPickableObject()&&(this.pickableObject=e),e.isCollisionObject()&&(this.collisionObject=e),e.isShadowObject()&&(this.shadowObject=e),e.isVisibleObject()&&this.visibleObjects.push(e)),B()(j().X3DBoundedObject,e)&&(e._display.addInterest("requestRebuild",this),e._bboxDisplay.addInterest("requestRebuild",this),e.isBBoxVisible()&&this.visibleObjects.push(e.getBBoxNode()));break;default:continue}break}}this.set_pointingObjects__(),this.set_cameraObjects__(),this.set_pickableObjects__(),this.set_collisionObjects__(),this.set_shadowObjects__(),this.set_visibleObjects__(),this.set_boundedObjects__()},set_boundedObjects__(){this.setBoundedObject(this.boundedObject||!this.isDefaultBBoxSize())},set_pointingObjects__(){this.setPointingObject(this.pointingObject)},set_cameraObjects__(){this.setCameraObject(this.cameraObject)},set_pickableObjects__(){this.setPickableObject(this.getTransformSensors().size||this.pickableObject)},set_collisionObjects__(){this.setCollisionObject(this.collisionObject)},set_shadowObjects__(){this.setShadowObject(this.shadowObject)},set_visibleObjects__(){this.setVisibleObject(this.visibleObjects.length)},traverse(e,t){switch(e){case P().POINTER:return void this.pointingObject?.traverse(e,t);case P().CAMERA:return void this.cameraObject?.traverse(e,t);case P().PICKING:if(this.getBrowser().getPickable().at(-1))for(const i of this.visibleObjects)i.traverse(e,t);else this.pickableObject?.traverse(e,t);return;case P().COLLISION:return void this.collisionObject?.traverse(e,t);case P().SHADOW:return void this.shadowObject?.traverse(e,t);case P().DISPLAY:for(const i of this.visibleObjects)i.traverse(e,t);return}},dispose(){D().prototype.dispose.call(this),F.prototype.dispose.call(this)}}),Object.defineProperties(I,{...c().getStaticProperties("CADFace","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(u())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOutput,"shape",new(o().SFNode))]),enumerable:!0}});const z=I,V=S().add("CADFace",z);function A(e){p().call(this,e),this.addType(j().CADLayer)}Object.setPrototypeOf(A.prototype,p().prototype),Object.defineProperties(A,{...c().getStaticProperties("CADLayer","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(u())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOnly,"addChildren",new(o().MFNode)),new(l())(j().inputOnly,"removeChildren",new(o().MFNode)),new(l())(j().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const R=A,q=S().add("CADLayer",R),T=e.X3DTransformNode;var X=t.n(T);function k(e){X().call(this,e),F.call(this,e),this.addType(j().CADPart)}Object.setPrototypeOf(k.prototype,X().prototype),Object.defineProperties(k,{...c().getStaticProperties("CADPart","CADGeometry",2,"children","3.1"),fieldDefinitions:{value:new(u())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOutput,"name",new(o().SFString)),new(l())(j().inputOutput,"translation",new(o().SFVec3f)),new(l())(j().inputOutput,"rotation",new(o().SFRotation)),new(l())(j().inputOutput,"scale",new(o().SFVec3f)(1,1,1)),new(l())(j().inputOutput,"scaleOrientation",new(o().SFRotation)),new(l())(j().inputOutput,"center",new(o().SFVec3f)),new(l())(j().inputOutput,"visible",new(o().SFBool)(!0)),new(l())(j().inputOutput,"bboxDisplay",new(o().SFBool)),new(l())(j().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(l())(j().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(l())(j().inputOnly,"addChildren",new(o().MFNode)),new(l())(j().inputOnly,"removeChildren",new(o().MFNode)),new(l())(j().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const M=k,G=S().add("CADPart",M),L=e.X3DComposedGeometryNode;var Q=t.n(L);function E(e){Q().call(this,e),this.addType(j().IndexedQuadSet)}Object.assign(Object.setPrototypeOf(E.prototype,Q().prototype),{initialize(){Q().prototype.initialize.call(this),this._set_index.addFieldInterest(this._index)},getTriangleIndex:(()=>{const e=[0,1,2,0,2,3];return function(t){const i=t%6;return(t-i)/6*4+e[i]}})(),getPolygonIndex(e){return this._index[e]},getVerticesPerPolygon:()=>4,getNumVertices(){return this.checkVertexCount(this._index.length,4)},build(){const e=this.getNumVertices();Q().prototype.build.call(this,4,e,6,e/4*6)}}),Object.defineProperties(E,{...c().getStaticProperties("IndexedQuadSet","CADGeometry",1,"geometry","3.1"),fieldDefinitions:{value:new(u())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().inputOnly,"set_index",new(o().MFInt32)),new(l())(j().initializeOnly,"solid",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"ccw",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"colorPerVertex",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"normalPerVertex",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"index",new(o().MFInt32)),new(l())(j().inputOutput,"attrib",new(o().MFNode)),new(l())(j().inputOutput,"fogCoord",new(o().SFNode)),new(l())(j().inputOutput,"color",new(o().SFNode)),new(l())(j().inputOutput,"texCoord",new(o().SFNode)),new(l())(j().inputOutput,"tangent",new(o().SFNode)),new(l())(j().inputOutput,"normal",new(o().SFNode)),new(l())(j().inputOutput,"coord",new(o().SFNode))]),enumerable:!0}});const H=E,K=S().add("IndexedQuadSet",H);function W(e){Q().call(this,e),this.addType(j().QuadSet)}Object.assign(Object.setPrototypeOf(W.prototype,Q().prototype),{getTriangleIndex:(()=>{const e=[0,1,2,0,2,3];return function(t){const i=t%6;return(t-i)/6*4+e[i]}})(),getVerticesPerPolygon:()=>4,getNumVertices(){return this.checkVertexCount(this.getCoord()?.getSize()??0,4)},build(){const e=this.getNumVertices();Q().prototype.build.call(this,4,e,6,e/4*6)},createNormals(e,t,i){return this.createFaceNormals(e,t,i)}}),Object.defineProperties(W,{...c().getStaticProperties("QuadSet","CADGeometry",1,"geometry","3.1"),fieldDefinitions:{value:new(u())([new(l())(j().inputOutput,"metadata",new(o().SFNode)),new(l())(j().initializeOnly,"solid",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"ccw",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"colorPerVertex",new(o().SFBool)(!0)),new(l())(j().initializeOnly,"normalPerVertex",new(o().SFBool)(!0)),new(l())(j().inputOutput,"attrib",new(o().MFNode)),new(l())(j().inputOutput,"fogCoord",new(o().SFNode)),new(l())(j().inputOutput,"color",new(o().SFNode)),new(l())(j().inputOutput,"texCoord",new(o().SFNode)),new(l())(j().inputOutput,"tangent",new(o().SFNode)),new(l())(j().inputOutput,"normal",new(o().SFNode)),new(l())(j().inputOutput,"coord",new(o().SFNode))]),enumerable:!0}});const Y=W,J=S().add("QuadSet",Y);n().add({name:"CADGeometry",concreteNodes:[C,V,q,G,K,J],abstractNodes:[F]});S().add("CADGeometryComponent",undefined)})();