x_ite 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/components/annotation.js +2 -2
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +2 -2
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +2 -2
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +2 -2
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +2 -2
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +2 -2
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +2 -2
- package/dist/assets/components/geospatial.min.js +1 -1
- package/dist/assets/components/h-anim.js +2 -2
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +2 -2
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +2 -2
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +2 -2
- package/dist/assets/components/nurbs.min.js +1 -1
- package/dist/assets/components/particle-systems.js +2 -2
- package/dist/assets/components/particle-systems.min.js +1 -1
- package/dist/assets/components/picking.js +2 -2
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +2 -2
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +2 -2
- package/dist/assets/components/rigid-body-physics.min.js +1 -1
- package/dist/assets/components/scripting.js +2 -2
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +2 -2
- package/dist/assets/components/texturing-3d.min.js +1 -1
- package/dist/assets/components/volume-rendering.js +2 -2
- package/dist/assets/components/volume-rendering.min.js +1 -1
- package/dist/assets/components/x_ite.js +2 -2
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/Phong.fs +3 -3
- package/dist/assets/shaders/webgl2/Phong.fs +3 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +2 -2
- package/dist/x_ite.js +14 -45
- package/dist/x_ite.min.js +4 -4
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/index.md +2 -2
- package/package.json +3 -3
- package/src/assets/shaders/webgl1/Phong.fs +3 -3
- package/src/assets/shaders/webgl2/Phong.fs +3 -3
- package/src/x_ite/Base/X3DBaseNode.js +8 -2
- package/src/x_ite/Browser/NURBS/NURBS.js +51 -51
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Components/Grouping/X3DGroupingNode.js +17 -16
- package/src/x_ite/Components/NURBS/Contour2D.js +53 -14
- package/src/x_ite/Components/NURBS/ContourPolyline2D.js +15 -12
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +9 -9
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +9 -9
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +6 -6
- package/src/x_ite/Components/NURBS/NurbsSet.js +31 -27
- package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +10 -10
- package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +5 -5
- package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +4 -4
- package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +6 -6
- package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +46 -7
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +30 -32
- package/src/x_ite/Components/Shape/Material.js +0 -20
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +0 -12
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +0 -8
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
8
|
-
require = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-5.0.2")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-5.0.2")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var module={},exports,process;const define=window[Symbol.for("X_ITE.X3D-5.0.
|
|
1
|
+
(function(){var module={},exports,process;const define=window[Symbol.for("X_ITE.X3D-5.0.2")].define,require=window[Symbol.for("X_ITE.X3D-5.0.2")].require;define("x_ite/Browser/Scripting/evaluate",[],(function(){return function(){with(arguments[0])return eval(arguments[1])}})),define("x_ite/Components/Scripting/X3DScriptNode",["x_ite/Components/Core/X3DChildNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Base/X3DConstants"],(function(e,t,i){"use strict";function n(n){e.call(this,n),t.call(this,n),this.addType(i.X3DScriptNode)}return n.prototype=Object.assign(Object.create(e.prototype),t.prototype,{constructor:n}),n})),define("x_ite/Components/Scripting/Script",["jquery","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Base/X3DField","x_ite/Base/X3DArrayField","x_ite/Fields","x_ite/Browser/X3DBrowser","x_ite/Configuration/ComponentInfo","x_ite/Configuration/ComponentInfoArray","x_ite/Configuration/ProfileInfo","x_ite/Configuration/ProfileInfoArray","x_ite/Configuration/UnitInfo","x_ite/Configuration/UnitInfoArray","x_ite/Execution/X3DExecutionContext","x_ite/Execution/X3DScene","x_ite/Prototype/ExternProtoDeclarationArray","x_ite/Prototype/ProtoDeclarationArray","x_ite/Prototype/X3DExternProtoDeclaration","x_ite/Prototype/X3DProtoDeclaration","x_ite/Routing/RouteArray","x_ite/Routing/X3DRoute","x_ite/Browser/Scripting/evaluate","x_ite/Components/Scripting/X3DScriptNode","x_ite/InputOutput/FileLoader","x_ite/Base/X3DConstants"],(function(e,t,i,n,o,r,s,a,c,u,l,d,p,f,h,F,v,g,S,_,x,m,M,D,y){function w(e){M.call(this,e),this.addType(y.Script),this.pauseTime=0}return w.prototype=Object.assign(Object.create(M.prototype),{constructor:w,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new i([new t(y.inputOutput,"metadata",new r.SFNode),new t(y.inputOutput,"load",new r.SFBool(!0)),new t(y.inputOutput,"url",new r.MFString),new t(y.inputOutput,"autoRefresh",new r.SFTime),new t(y.inputOutput,"autoRefreshTimeLimit",new r.SFTime(3600)),new t(y.initializeOnly,"directOutput",new r.SFBool),new t(y.initializeOnly,"mustEvaluate",new r.SFBool)]),getTypeName:function(){return"Script"},getComponentName:function(){return"Scripting"},getContainerField:function(){return"children"},initialize:function(){M.prototype.initialize.call(this);for(const e of this.getUserDefinedFields())e.setModificationTime(0);this.requestImmediateLoad()},getExtendedEventHandling:function(){return!1},canUserDefinedFields:function(){return!0},addUserDefinedField:function(e,t,i){M.prototype.addUserDefinedField.call(this,e,t,i),this.isInitialized()&&(this.setLoadState(y.NOT_STARTED_STATE),this.requestImmediateLoad())},removeUserDefinedField:function(e){M.prototype.removeUserDefinedField.call(this,e),this.isInitialized()&&(this.setLoadState(y.NOT_STARTED_STATE),this.requestImmediateLoad())},getSourceText:function(){return this._url},unloadNow:function(){this.initialize__("")},loadNow:function(){this.initialized=!1,new D(this).loadScript(this._url,function(e){null===e?this.setLoadState(y.FAILED_STATE):(this.setLoadState(y.COMPLETE_STATE),this.initialize__(e))}.bind(this))},getContext:function(e){try{const t=["initialize","prepareEvents","eventsProcessed","shutdown"];for(const e of this.getUserDefinedFields())switch(e.getAccessType()){case y.inputOnly:t.push(e.getName());break;case y.inputOutput:t.push("set_"+e.getName())}e+="\n;var "+t.join(",")+";",e+="\n["+t.join(",")+"];",this.global=this.getGlobal();const i=this.evaluate(e),n={};for(let e=0;e<t.length;++e)n[t[e]]=i[e];return n}catch(e){return this.setError("while evaluating script source",e),{}}},evaluate:function(e){return m(this.global,e)},getGlobal:function(){const e=this.getBrowser(),m=this.getExecutionContext(),M=this.isLive();function D(t){const i=e.createX3DFromString(String(t)),n=i.getRootNodes();if(M.addFieldInterest(i.isLive()),i.setLive(M.getValue()),i.setPrivate(m.getPrivate()),i.setExecutionContext(m),n.length&&n[0])return n[0];throw new Error("SFNode.new: invalid argument, must be 'string' is 'undefined'.")}D.prototype=r.SFNode.prototype;const w={NULL:{value:null},FALSE:{value:!1},TRUE:{value:!0},print:{value:e.println.bind(e)},trace:{value:e.println.bind(e)},Browser:{value:e},X3DConstants:{value:y},X3DBrowser:{value:s},X3DExecutionContext:{value:f},X3DScene:{value:h},ComponentInfo:{value:a},ComponentInfoArray:{value:c},ProfileInfo:{value:u},ProfileInfoArray:{value:l},UnitInfo:{value:d},UnitInfoArray:{value:p},ExternProtoDeclarationArray:{value:F},ProtoDeclarationArray:{value:v},X3DExternProtoDeclaration:{value:g},X3DProtoDeclaration:{value:S},RouteArray:{value:_},X3DRoute:{value:x},X3DFieldDefinition:{value:t},FieldDefinitionArray:{value:i},X3DField:{value:n},X3DArrayField:{value:o},SFColor:{value:r.SFColor},SFColorRGBA:{value:r.SFColorRGBA},SFImage:{value:r.SFImage},SFMatrix3d:{value:r.SFMatrix3d},SFMatrix3f:{value:r.SFMatrix3f},SFMatrix4d:{value:r.SFMatrix4d},SFMatrix4f:{value:r.SFMatrix4f},SFNode:{value:D},SFRotation:{value:r.SFRotation},SFVec2d:{value:r.SFVec2d},SFVec2f:{value:r.SFVec2f},SFVec3d:{value:r.SFVec3d},SFVec3f:{value:r.SFVec3f},SFVec4d:{value:r.SFVec4d},SFVec4f:{value:r.SFVec4f},VrmlMatrix:{value:r.VrmlMatrix},MFBool:{value:r.MFBool},MFColor:{value:r.MFColor},MFColorRGBA:{value:r.MFColorRGBA},MFDouble:{value:r.MFDouble},MFFloat:{value:r.MFFloat},MFImage:{value:r.MFImage},MFInt32:{value:r.MFInt32},MFMatrix3d:{value:r.MFMatrix3d},MFMatrix3f:{value:r.MFMatrix3f},MFMatrix4d:{value:r.MFMatrix4d},MFMatrix4f:{value:r.MFMatrix4f},MFNode:{value:r.MFNode},MFRotation:{value:r.MFRotation},MFString:{value:r.MFString},MFTime:{value:r.MFTime},MFVec2d:{value:r.MFVec2d},MFVec2f:{value:r.MFVec2f},MFVec3d:{value:r.MFVec3d},MFVec3f:{value:r.MFVec3f},MFVec4d:{value:r.MFVec4d},MFVec4f:{value:r.MFVec4f}};for(const e of this.getUserDefinedFields()){const t=e.getName();e.getAccessType()!==y.inputOnly&&(t in w||(w[t]={get:e.valueOf.bind(e),set:e.setValue.bind(e)}),e.getAccessType()===y.inputOutput&&(w[t+"_changed"]={get:e.valueOf.bind(e),set:e.setValue.bind(e)}))}return Object.create(Object.prototype,w)},processOutstandingEvents:function(){for(const t of this.getUserDefinedFields())if(!(t.getModificationTime()<=this.pauseTime))switch(t.getAccessType()){case y.inputOnly:{const i=this.context[t.getName()];e.isFunction(i)&&this.set_field__(i,t);break}case y.inputOutput:{const i=this.context["set_"+t.getName()];e.isFunction(i)&&this.set_field__(i,t);break}}},initialize__:function(e){this.context=this.getContext(e),this.set_live__()},set_live__:function(){if(M.prototype.set_live__.call(this),this.context)if(this.isLive().getValue()){if(!this.initialized){if(this.initialized=!0,e.isFunction(this.context.initialize)){const e=this.getBrowser();e.getScriptStack().push(this);try{this.context.initialize()}catch(e){this.setError("in function 'initialize'",e)}e.getScriptStack().pop()}e.isFunction(this.context.shutdown)&&e(window).on("unload",this.shutdown__.bind(this))}e.isFunction(this.context.prepareEvents)&&this.getBrowser().prepareEvents().addInterest("prepareEvents__",this),e.isFunction(this.context.eventsProcessed)&&this.addInterest("eventsProcessed__",this);for(const t of this.getUserDefinedFields())switch(t.getAccessType()){case y.inputOnly:{const i=this.context[t.getName()];e.isFunction(i)&&t.addInterest("set_field__",this,i);break}case y.inputOutput:{const i=this.context["set_"+t.getName()];e.isFunction(i)&&t.addInterest("set_field__",this,i);break}}this.processOutstandingEvents()}else{this.context.prepareEvents&&this.getBrowser().prepareEvents().removeInterest("prepareEvents__",this),this.context.eventsProcessed&&this.removeInterest("eventsProcessed__",this);for(const e of this.getUserDefinedFields())switch(e.getAccessType()){case y.inputOnly:case y.inputOutput:e.removeInterest("set_field__",this)}this.initialized&&(this.pauseTime=performance.now())}},prepareEvents__:function(){const e=this.getBrowser();e.getScriptStack().push(this);try{this.context.prepareEvents(e.getCurrentTime()),e.addBrowserEvent()}catch(e){this.setError("in function 'prepareEvents'",e)}e.getScriptStack().pop()},set_field__:function(e,t){const i=this.getBrowser();t.setTainted(!0),i.getScriptStack().push(this);try{e(t.valueOf(),i.getCurrentTime())}catch(e){this.setError("in function '"+t.getName()+"'",e)}i.getScriptStack().pop(),t.setTainted(!1)},eventsProcessed__:function(){const e=this.getBrowser();e.getScriptStack().push(this);try{this.context.eventsProcessed()}catch(e){this.setError("in function 'eventsProcessed'",e)}e.getScriptStack().pop()},shutdown__:function(){const e=this.getBrowser();e.getScriptStack().push(this);try{this.context.shutdown()}catch(e){this.setError("in function 'shutdown'",e)}e.getScriptStack().pop()},setError:function(e,t){console.error("JavaScript Error in Script '"+this.getName()+"', "+e+"\nworld url is '"+this.getExecutionContext().getWorldURL()+"':"),console.error(t)}}),w})),define(require.getComponentUrl("scripting"),["x_ite/Components","x_ite/Components/Scripting/Script","x_ite/Components/Scripting/X3DScriptNode"],(function(e,t,i){"use strict";e.addComponent({name:"Scripting",types:{Script:t},abstractTypes:{X3DScriptNode:i}})}))})();
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
8
|
-
require = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-5.0.2")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-5.0.2")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var module={},exports,process;const define=window[Symbol.for("X_ITE.X3D-5.0.
|
|
1
|
+
(function(){var module={},exports,process;const define=window[Symbol.for("X_ITE.X3D-5.0.2")].define,require=window[Symbol.for("X_ITE.X3D-5.0.2")].require;
|
|
2
2
|
/*! dicom-parser - 1.8.12 - 2022-02-07 | (c) 2017 Chris Hafey | https://github.com/cornerstonejs/dicomParser */
|
|
3
3
|
var root,factory;define("x_ite/Components/Texturing3D/X3DTexture3DNode",["x_ite/Components/Texturing/X3DSingleTextureNode","x_ite/Base/X3DConstants"],(function(e,i){"use strict";const r=new Uint8Array([255,255,255,255]);function t(r){e.call(this,r),this.addType(i.X3DTexture3DNode);const t=this.getBrowser().getContext();this.target=t.TEXTURE_3D,this.width=0,this.height=0,this.depth=0,this.data=null}return t.prototype=Object.assign(Object.create(e.prototype),{constructor:t,initialize:function(){e.prototype.initialize.call(this),this._repeatS.addInterest("updateTextureProperties",this),this._repeatT.addInterest("updateTextureProperties",this),this._repeatR.addInterest("updateTextureProperties",this);const i=this.getBrowser().getContext();i.getVersion()<2||(i.bindTexture(i.TEXTURE_3D,this.getTexture()),i.texImage3D(i.TEXTURE_3D,0,i.RGBA,1,1,1,0,i.RGBA,i.UNSIGNED_BYTE,r))},getTarget:function(){return this.target},getTextureType:function(){return 3},getTextureTypeString:function(){return"3D"},getWidth:function(){return this.width},getHeight:function(){return this.height},getDepth:function(){return this.depth},getFlipY:function(){return!1},getData:function(){return this.data},clearTexture:function(){const e=this.getBrowser().getContext();this.setTexture(1,1,1,!1,e.RGBA,r),this.data=null},setTexture:function(e,i,r,t,n,f){try{this.width=e,this.height=i,this.depth=r,this.data=f;const a=this.getBrowser().getContext();if(a.getVersion()<2)return;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),a.pixelStorei(a.UNPACK_ALIGNMENT,1),a.bindTexture(a.TEXTURE_3D,this.getTexture()),a.texImage3D(a.TEXTURE_3D,0,n,e,i,r,0,n,a.UNSIGNED_BYTE,f),this.setTransparent(t),this.updateTextureProperties(),this.addNodeEvent()}catch(e){}},updateTextureProperties:function(){e.prototype.updateTextureProperties.call(this,this.target,this._textureProperties.getValue(),this.texturePropertiesNode,this.width,this.height,this._repeatS.getValue(),this._repeatT.getValue(),this._repeatR.getValue())},setShaderUniformsToChannel:function(e,i,r,t){if(e.getVersion()>=2){const i=r.getBrowser().getTexture3DUnit();e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_3D,this.getTexture()),e.uniform1i(t.textureType,3),e.uniform1i(t.texture3D,i)}else e.uniform1i(t.textureType,3)}}),t})),define("x_ite/Components/Texturing3D/ComposedTexture3D",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Texturing3D/X3DTexture3DNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,i,r,t,n,f){"use strict";function a(i){t.call(this,i),this.addType(n.ComposedTexture3D),this.addChildObjects("loadState",new e.SFInt32(n.NOT_STARTED_STATE)),this.textureNodes=[]}return a.prototype=Object.assign(Object.create(t.prototype),{constructor:a,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new r([new i(n.inputOutput,"metadata",new e.SFNode),new i(n.inputOutput,"description",new e.SFString),new i(n.initializeOnly,"repeatS",new e.SFBool),new i(n.initializeOnly,"repeatT",new e.SFBool),new i(n.initializeOnly,"repeatR",new e.SFBool),new i(n.initializeOnly,"textureProperties",new e.SFNode),new i(n.inputOutput,"texture",new e.MFNode)]),getTypeName:function(){return"ComposedTexture3D"},getComponentName:function(){return"Texturing3D"},getContainerField:function(){return"texture"},initialize:function(){t.prototype.initialize.call(this),this._texture.addInterest("set_texture__",this),this.set_texture__()},checkLoadState:function(){return this._loadState.getValue()},set_texture__:function(){const e=this.textureNodes;for(const i of e)i.removeInterest("update",this);e.length=0;for(const i of this._texture){const r=f(n.X3DTexture2DNode,i);r&&e.push(r)}for(const i of e)i.addInterest("update",this);this.update()},update:function(){const e=this.textureNodes,i=e.every((function(e){return e.checkLoadState()===n.COMPLETE_STATE}));if(0!==e.length&&i){const i=this.getBrowser().getContext(),r=e[0],t=r.getWidth(),f=r.getHeight(),a=e.length,s=t*f*4,l=new Uint8Array(s*a);let o=0;for(let e=0,i=0;e<a;++e,i+=s){const r=this.textureNodes[e],n=r.getData();r.getWidth()===t&&r.getHeight()===f?(o+=r.getTransparent(),l.set(n,i)):console.log("ComposedTexture3D: all textures must have same size.")}this.setTexture(t,f,a,!!o,i.RGBA,l),this._loadState=n.COMPLETE_STATE}else this.clearTexture(),this._loadState=n.FAILED_STATE}}),a})),define("x_ite/Browser/Texturing3D/NRRDParser",["pako_inflate"],(function(e){"use strict";var i,r,t,n,f={NRRD:new RegExp("^NRRD(\\d+)\\n","gy"),field:new RegExp("([\\w\\s]+):\\s*(.+?)\\n","gy"),comment:new RegExp("#[^\\n]*\\n","gy"),newLine:new RegExp("\n","gy"),data:new RegExp("([^]*)$","gy")};function a(e){return this.lastIndex=e.lastIndex,e.result=this.exec(e.input),!!e.result&&(e.lastIndex=this.lastIndex,!0)}for(var s in f)f[s].parse=a;function l(){this.fieldFunction=new Map([["type",this.getType],["encoding",this.getEncoding],["dimension",this.getDimension],["sizes",this.getSizes],["endian",this.getEndian]])}return l.prototype={parse:function(e){return this.setInput(e),this.getNRRD()&&(this.getFields(),this.getData()),this.nrrd},setInput:function(e){this.input=e,this.lastIndex=0,this.nrrd={},this.endian="little"},getNRRD:function(){return f.NRRD.parse(this)?(this.nrrd.nrrd=!0,this.nrrd.version=parseInt(this.result[1]),this.endian=this.getEndianess(),!0):(this.nrrd.nrrd=!1,!1)},getFields:function(){for(;f.comment.parse(this););for(;f.field.parse(this);){var e=this.result[1].toLowerCase(),i=this.result[2].trim().toLowerCase(),r=this.fieldFunction.get(e);for(r&&r.call(this,i);f.comment.parse(this););}},getType:(n=new Map([["signed char",["signed char",1]],["int8",["signed char",1]],["int8_t",["signed char",1]],["uchar",["unsigned char",1]],["unsigned char",["unsigned char",1]],["uint8",["unsigned char",1]],["uint8_t",["unsigned char",1]],["short",["signed short",2]],["short int",["signed short",2]],["signed short",["signed short",2]],["signed short int",["signed short",2]],["int16",["signed short",2]],["int16_t",["signed short",2]],["ushort",["unsigned short",2]],["unsigned short",["unsigned short",2]],["unsigned short int",["unsigned short",2]],["uint16",["unsigned short",2]],["uint16_t",["unsigned short",2]],["int",["signed int",4]],["signed int",["signed int",4]],["int32",["signed int",4]],["int32_t",["signed int",4]],["uint",["unsigned int",4]],["unsigned int",["unsigned int",4]],["uint32",["unsigned int",4]],["uint32_t",["unsigned int",4]],["float",["float",4]],["double",["double",8]]]),function(e){var i=n.get(e);if(void 0===i)throw new Error("Unsupported NRRD type '"+e+"'.");this.byteType=i[0],this.bytes=i[1]}),getEncoding:(t=new Map([["ascii","ascii"],["txt","ascii"],["text","ascii"],["raw","raw"],["hex","hex"],["gz","gzip"],["gzip","gzip"]]),function(e){var i=t.get(e);if(void 0===i)throw new Error("Unsupported NRRD encoding '"+e+"'.");this.encoding=i}),getDimension:function(e){var i=e.match(/(\d+)/),r=0;if(i)switch(r=parseInt(i[1])){case 1:case 2:case 3:case 4:return void(this.dimension=r)}throw new Error("Unsupported NRRD dimension '"+r+"', must be 1, 2, 3, or 4.")},getSizes:function(e){for(var i=new RegExp("\\s*(\\d+)","gy"),r=null,t=[];r=i.exec(e);)t.push(parseInt(r[1]));switch(t.length){case 1:return this.nrrd.components=1,this.nrrd.width=t[0],this.nrrd.height=1,void(this.nrrd.depth=1);case 2:return this.nrrd.components=1,this.nrrd.width=t[0],this.nrrd.height=t[1],void(this.nrrd.depth=1);case 3:return this.nrrd.components=1,this.nrrd.width=t[0],this.nrrd.height=t[1],void(this.nrrd.depth=t[2]);case 4:return this.nrrd.components=t[0],this.nrrd.width=t[1],this.nrrd.height=t[2],void(this.nrrd.depth=t[3]);default:throw new Error("Unsupported NRRD sizes.")}},getEndian:function(e){if("little"!==e&&"big"!==e)throw new Error("Unsupported NRRD endian, must be 'little' or 'big'.");this.endian=e},getData:function(){switch(this.encoding){case"ascii":this.ascii();break;case"raw":this.rawString(this.input);break;case"hex":this.hex();break;case"gzip":this.gzip()}},ascii:function(){var e=this.nrrd.components*this.nrrd.width*this.nrrd.height*this.nrrd.depth,i=new Uint8Array(e);if(this.nrrd.data=i,f.data.parse(this)){var r=this.result[1].trim().split(/\s+/);switch(this.byteType){case"signed char":case"unsigned char":return void r.forEach((function(e,r){i[r]=parseInt(e)}));case"signed short":case"unsigned short":return void r.forEach((function(e,r){i[r]=parseInt(e)/256}));case"signed int":case"unsigned int":return void r.forEach((function(e,r){i[r]=parseInt(e)/16777216}));case"float":return void r.forEach((function(e,r){i[r]=parseFloat(e)/256}));case"double":return void r.forEach((function(e,r){i[r]=parseFloat(e)/16777216}))}}},rawString:function(e){var i=this.nrrd.components*this.nrrd.width*this.nrrd.height*this.nrrd.depth,r=i*this.bytes,t=new Uint8Array(i);switch(this.nrrd.data=t,this.byteType){case"signed char":case"unsigned char":for(var n=e.length-r,f=0;n<e.length;++n,++f)t[f]=e.charCodeAt(n);return;case"signed short":case"unsigned short":if(this.getEndianess()===this.endian)var a=0,s=1;else a=1,s=0;for(n=e.length-r,f=0;n<e.length;n+=2,++f)t[f]=this.short2byte(e.charCodeAt(n+a),e.charCodeAt(n+s));return;case"signed int":case"unsigned int":if(this.getEndianess()===this.endian){a=0,s=1;var l=2,o=3}else a=3,s=2,l=1,o=0;for(n=e.length-r,f=0;n<e.length;n+=4,++f)t[f]=this.int2byte(e.charCodeAt(n+a),e.charCodeAt(n+s),e.charCodeAt(n+l),e.charCodeAt(n+o));return;case"float":if(this.getEndianess()===this.endian)a=0,s=1,l=2,o=3;else a=3,s=2,l=1,o=0;for(n=e.length-r,f=0;n<e.length;n+=4,++f)t[f]=this.float2byte(e.charCodeAt(n+a),e.charCodeAt(n+s),e.charCodeAt(n+l),e.charCodeAt(n+o));return;case"double":if(this.getEndianess()===this.endian){a=0,s=1,l=2,o=3;var u=4,c=5,d=6,h=7}else a=7,s=6,l=5,o=4,u=3,c=2,d=1,h=0;for(n=e.length-r,f=0;n<e.length;n+=8,++f)t[f]=this.double2byte(e.charCodeAt(n+a),e.charCodeAt(n+s),e.charCodeAt(n+l),e.charCodeAt(n+o),e.charCodeAt(n+u),e.charCodeAt(n+c),e.charCodeAt(n+d),e.charCodeAt(n+h));return}},rawArray:function(e){var i=this.nrrd.components*this.nrrd.width*this.nrrd.height*this.nrrd.depth,r=i*this.bytes,t=new Uint8Array(i);switch(this.nrrd.data=t,this.byteType){case"signed char":case"unsigned char":for(var n=e.length-r,f=0;n<e.length;++n,++f)t[f]=e[n];return;case"signed short":case"unsigned short":if(this.getEndianess()===this.endian)var a=0,s=1;else a=1,s=0;for(n=e.length-r,f=0;n<e.length;n+=2,++f)t[f]=this.short2byte(e[n+a],e[n+s]);return;case"signed int":case"unsigned int":if(this.getEndianess()===this.endian){a=0,s=1;var l=2,o=3}else a=3,s=2,l=1,o=0;for(n=e.length-r,f=0;n<e.length;n+=4,++f)t[f]=this.int2byte(e[n+a],e[n+s],e[n+l],e[n+o]);return;case"float":if(this.getEndianess()===this.endian)a=0,s=1,l=2,o=3;else a=3,s=2,l=1,o=0;for(n=e.length-r,f=0;n<e.length;n+=4,++f)t[f]=this.float2byte(e[n+a],e[n+s],e[n+l],e[n+o]);return;case"double":if(this.getEndianess()===this.endian){a=0,s=1,l=2,o=3;var u=4,c=5,d=6,h=7}else a=7,s=6,l=5,o=4,u=3,c=2,d=1,h=0;for(n=e.length-r,f=0;n<e.length;n+=8,++f)t[f]=this.double2byte(e[n+a],e[n+s],e[n+l],e[n+o],e[n+u],e[n+c],e[n+d],e[n+h]);return}},hex:function(){if(f.data.parse(this)){var e=this.result[1].match(/([0-9a-fA-F]{2})/g);if(e){var i=e.map((function(e){return parseInt(e,16)}));return void this.rawArray(i)}}throw new Error("Invalid NRRD data.")},gzip:function(){try{if(!f.newLine.parse(this))throw new Error("Invalid NRRD data.");f.data.parse(this);const i=this.binaryStringToBuffer(this.result[1]),r=e.ungzip(i,{to:"raw"});this.rawArray(r)}catch(e){throw new Error("Invalid NRRD data.")}},binaryStringToBuffer:function(e){const i=new Uint8Array(e.length);for(let r=0,t=e.length;r<t;++r)i[r]=e.charCodeAt(r);return i},getEndianess:function(){var e=new ArrayBuffer(4),i=new Uint32Array(e),r=new Uint8Array(e);if(i[0]=16909060,1==r[0]&&2==r[1]&&3==r[2]&&4==r[3])return"big";if(4==r[0]&&3==r[1]&&2==r[2]&&1==r[3])return"little";throw new Error("NRRD: unkown system endianess,")},short2byte:(i=new Uint8Array(2),r=new Uint16Array(i.buffer),function(e,t){return i[0]=e,i[1]=t,r[0]/256}),int2byte:function(){var e=new Uint8Array(4),i=new Uint32Array(e.buffer);return function(r,t,n,f){return e[0]=r,e[1]=t,e[2]=n,e[3]=f,i[0]/16777216}}(),float2byte:function(){var e=new Uint8Array(4),i=new Float32Array(e.buffer);return function(r,t,n,f){return e[0]=r,e[1]=t,e[2]=n,e[3]=f,i[0]/256}}(),double2byte:function(){var e=new Uint8Array(8),i=new Float64Array(e.buffer);return function(r,t,n,f,a,s,l,o){return e[0]=r,e[1]=t,e[2]=n,e[3]=f,e[4]=a,e[5]=s,e[6]=l,e[7]=o,i[0]/16777216}}()},l})),define("zlib",["zlib/dummy"],(function(e){return e})),define("zlib/dummy",(function(){})),root=this,factory=function(e){return function(e){var i=this.webpackHotUpdate;this.webpackHotUpdate=function(e,r){!function(e,i){if(g[e]&&v[e]){for(var r in v[e]=!1,i)Object.prototype.hasOwnProperty.call(i,r)&&(b[r]=i[r]);0==--m&&0===_&&S()}}(e,r),i&&i(e,r)};var r,t=!0,n="55a69ee645a02abc7461",f={},a=[],s=[];function l(e){var i=D[e];if(!i)return x;var t=function(t){return i.hot.active?(D[t]?-1===D[t].parents.indexOf(e)&&D[t].parents.push(e):(a=[e],r=t),-1===i.children.indexOf(t)&&i.children.push(t)):(console.warn("[HMR] unexpected require("+t+") from disposed module "+e),a=[]),x(t)},n=function(e){return{configurable:!0,enumerable:!0,get:function(){return x[e]},set:function(i){x[e]=i}}};for(var f in x)Object.prototype.hasOwnProperty.call(x,f)&&"e"!==f&&"t"!==f&&Object.defineProperty(t,f,n(f));return t.e=function(e){return"ready"===c&&d("prepare"),_++,x.e(e).then(i,(function(e){throw i(),e}));function i(){_--,"prepare"===c&&(p[e]||A(e),0===_&&0===m&&S())}},t.t=function(e,i){return 1&i&&(e=t(e)),x.t(e,-2&i)},t}function o(i){var t={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:r!==i,active:!0,accept:function(e,i){if(void 0===e)t._selfAccepted=!0;else if("function"==typeof e)t._selfAccepted=e;else if("object"==typeof e)for(var r=0;r<e.length;r++)t._acceptedDependencies[e[r]]=i||function(){};else t._acceptedDependencies[e]=i||function(){}},decline:function(e){if(void 0===e)t._selfDeclined=!0;else if("object"==typeof e)for(var i=0;i<e.length;i++)t._declinedDependencies[e[i]]=!0;else t._declinedDependencies[e]=!0},dispose:function(e){t._disposeHandlers.push(e)},addDisposeHandler:function(e){t._disposeHandlers.push(e)},removeDisposeHandler:function(e){var i=t._disposeHandlers.indexOf(e);i>=0&&t._disposeHandlers.splice(i,1)},invalidate:function(){switch(this._selfInvalidated=!0,c){case"idle":(b={})[i]=e[i],d("ready");break;case"ready":P(i);break;case"prepare":case"check":case"dispose":case"apply":(w=w||[]).push(i)}},check:E,apply:T,status:function(e){if(!e)return c;u.push(e)},addStatusHandler:function(e){u.push(e)},removeStatusHandler:function(e){var i=u.indexOf(e);i>=0&&u.splice(i,1)},data:f[i]};return r=void 0,t}var u=[],c="idle";function d(e){c=e;for(var i=0;i<u.length;i++)u[i].call(null,e)}var h,b,k,w,m=0,_=0,p={},v={},g={};function y(e){return+e+""===e?+e:e}function E(e){if("idle"!==c)throw new Error("check() is only allowed in idle status");return t=e,d("check"),(i=1e4,i=i||1e4,new Promise((function(e,r){if("undefined"==typeof XMLHttpRequest)return r(new Error("No browser support"));try{var t=new XMLHttpRequest,f=x.p+""+n+".hot-update.json";t.open("GET",f,!0),t.timeout=i,t.send(null)}catch(e){return r(e)}t.onreadystatechange=function(){if(4===t.readyState)if(0===t.status)r(new Error("Manifest request to "+f+" timed out."));else if(404===t.status)e();else if(200!==t.status&&304!==t.status)r(new Error("Manifest request to "+f+" failed."));else{try{var i=JSON.parse(t.responseText)}catch(e){return void r(e)}e(i)}}}))).then((function(e){if(!e)return d(C()?"ready":"idle"),null;v={},p={},g=e.c,k=e.h,d("prepare");var i=new Promise((function(e,i){h={resolve:e,reject:i}}));return b={},A("dicomParser"),"prepare"===c&&0===_&&0===m&&S(),i}));var i}function A(e){g[e]?(v[e]=!0,m++,function(e){var i=document.createElement("script");i.charset="utf-8",i.src=x.p+""+e+"."+n+".hot-update.js",document.head.appendChild(i)}(e)):p[e]=!0}function S(){d("ready");var e=h;if(h=null,e)if(t)Promise.resolve().then((function(){return T(t)})).then((function(i){e.resolve(i)}),(function(i){e.reject(i)}));else{var i=[];for(var r in b)Object.prototype.hasOwnProperty.call(b,r)&&i.push(y(r));e.resolve(i)}}function T(e){if("ready"!==c)throw new Error("apply() is only allowed in ready status");return M(e=e||{})}function M(i){var t,s,l,o,u;function c(e){for(var i=[e],r={},t=i.map((function(e){return{chain:[e],id:e}}));t.length>0;){var n=t.pop(),f=n.id,a=n.chain;if((o=D[f])&&(!o.hot._selfAccepted||o.hot._selfInvalidated)){if(o.hot._selfDeclined)return{type:"self-declined",chain:a,moduleId:f};if(o.hot._main)return{type:"unaccepted",chain:a,moduleId:f};for(var s=0;s<o.parents.length;s++){var l=o.parents[s],u=D[l];if(u){if(u.hot._declinedDependencies[f])return{type:"declined",chain:a.concat([l]),moduleId:f,parentId:l};-1===i.indexOf(l)&&(u.hot._acceptedDependencies[f]?(r[l]||(r[l]=[]),h(r[l],[f])):(delete r[l],i.push(l),t.push({chain:a.concat([l]),id:l})))}}}}return{type:"accepted",moduleId:e,outdatedModules:i,outdatedDependencies:r}}function h(e,i){for(var r=0;r<i.length;r++){var t=i[r];-1===e.indexOf(t)&&e.push(t)}}C();var m={},_=[],p={},v=function(){console.warn("[HMR] unexpected require("+A.moduleId+") to disposed module")};for(var E in b)if(Object.prototype.hasOwnProperty.call(b,E)){var A;u=y(E);var S=!1,T=!1,P=!1,L="";switch((A=b[E]?c(u):{type:"disposed",moduleId:E}).chain&&(L="\nUpdate propagation: "+A.chain.join(" -> ")),A.type){case"self-declined":i.onDeclined&&i.onDeclined(A),i.ignoreDeclined||(S=new Error("Aborted because of self decline: "+A.moduleId+L));break;case"declined":i.onDeclined&&i.onDeclined(A),i.ignoreDeclined||(S=new Error("Aborted because of declined dependency: "+A.moduleId+" in "+A.parentId+L));break;case"unaccepted":i.onUnaccepted&&i.onUnaccepted(A),i.ignoreUnaccepted||(S=new Error("Aborted because "+u+" is not accepted"+L));break;case"accepted":i.onAccepted&&i.onAccepted(A),T=!0;break;case"disposed":i.onDisposed&&i.onDisposed(A),P=!0;break;default:throw new Error("Unexception type "+A.type)}if(S)return d("abort"),Promise.reject(S);if(T)for(u in p[u]=b[u],h(_,A.outdatedModules),A.outdatedDependencies)Object.prototype.hasOwnProperty.call(A.outdatedDependencies,u)&&(m[u]||(m[u]=[]),h(m[u],A.outdatedDependencies[u]));P&&(h(_,[A.moduleId]),p[u]=v)}var O,R=[];for(s=0;s<_.length;s++)u=_[s],D[u]&&D[u].hot._selfAccepted&&p[u]!==v&&!D[u].hot._selfInvalidated&&R.push({module:u,parents:D[u].parents.slice(),errorHandler:D[u].hot._selfAccepted});d("dispose"),Object.keys(g).forEach((function(e){!1===g[e]&&function(e){delete installedChunks[e]}(e)}));for(var I,B,N=_.slice();N.length>0;)if(u=N.pop(),o=D[u]){var F={},j=o.hot._disposeHandlers;for(l=0;l<j.length;l++)(t=j[l])(F);for(f[u]=F,o.hot.active=!1,delete D[u],delete m[u],l=0;l<o.children.length;l++){var U=D[o.children[l]];U&&(O=U.parents.indexOf(u))>=0&&U.parents.splice(O,1)}}for(u in m)if(Object.prototype.hasOwnProperty.call(m,u)&&(o=D[u]))for(B=m[u],l=0;l<B.length;l++)I=B[l],(O=o.children.indexOf(I))>=0&&o.children.splice(O,1);for(u in d("apply"),void 0!==k&&(n=k,k=void 0),b=void 0,p)Object.prototype.hasOwnProperty.call(p,u)&&(e[u]=p[u]);var H=null;for(u in m)if(Object.prototype.hasOwnProperty.call(m,u)&&(o=D[u])){B=m[u];var Y=[];for(s=0;s<B.length;s++)if(I=B[s],t=o.hot._acceptedDependencies[I]){if(-1!==Y.indexOf(t))continue;Y.push(t)}for(s=0;s<Y.length;s++){t=Y[s];try{t(B)}catch(e){i.onErrored&&i.onErrored({type:"accept-errored",moduleId:u,dependencyId:B[s],error:e}),i.ignoreErrored||H||(H=e)}}}for(s=0;s<R.length;s++){var q=R[s];u=q.module,a=q.parents,r=u;try{x(u)}catch(e){if("function"==typeof q.errorHandler)try{q.errorHandler(e)}catch(r){i.onErrored&&i.onErrored({type:"self-accept-error-handler-errored",moduleId:u,error:r,originalError:e}),i.ignoreErrored||H||(H=r),H||(H=e)}else i.onErrored&&i.onErrored({type:"self-accept-errored",moduleId:u,error:e}),i.ignoreErrored||H||(H=e)}}return H?(d("fail"),Promise.reject(H)):w?M(i).then((function(e){return _.forEach((function(i){e.indexOf(i)<0&&e.push(i)})),e})):(d("idle"),new Promise((function(e){e(_)})))}function C(){if(w)return b||(b={}),w.forEach(P),w=void 0,!0}function P(i){Object.prototype.hasOwnProperty.call(b,i)||(b[i]=e[i])}var D={};function x(i){if(D[i])return D[i].exports;var r=D[i]={i:i,l:!1,exports:{},hot:o(i),parents:(s=a,a=[],s),children:[]};return e[i].call(r.exports,r,r.exports,l(i)),r.l=!0,r.exports}return x.m=e,x.c=D,x.d=function(e,i,r){x.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:r})},x.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},x.t=function(e,i){if(1&i&&(e=x(e)),8&i)return e;if(4&i&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(x.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var t in e)x.d(r,t,function(i){return e[i]}.bind(null,t));return r},x.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return x.d(i,"a",i),i},x.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},x.p="",x.h=function(){return n},l("./index.js")(x.s="./index.js")}({"./alloc.js":
|
|
4
4
|
/*!******************!*\
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
8
|
-
require = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-5.0.2")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-5.0.2")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){const e=window[Symbol.for("X_ITE.X3D-5.0.0")].define,t=window[Symbol.for("X_ITE.X3D-5.0.0")].require;e("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",["x_ite/Components/Core/X3DNode","x_ite/Base/X3DConstants"],(function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,addShaderFields:function(e){},getUniformsText:function(){return""},getFunctionsText:function(){return""},getVolumeData:function(){return this.volumeDataNodes},addVolumeData:function(e){this.volumeDataNodes.add(e)},removeVolumeData:function(e){this.volumeDataNodes.delete(e)},getNormalText:function(e){var t="";return e?(t+="uniform sampler3D surfaceNormals_"+this.getId()+";\n",t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec3 n = texture (surfaceNormals_"+this.getId()+", texCoord) .xyz * 2.0 - 1.0;\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"):(t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",t+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",t+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",t+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",t+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",t+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",t+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",t+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"),t}}),n})),e("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",["x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Base/X3DConstants"],(function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DComposableVolumeRenderStyleNode)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n}),n})),e("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.OpacityMapVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"transferFunction",new e.SFNode)]),getTypeName:function(){return"OpacityMapVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._transferFunction.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__:function(){this.transferFunctionNode=r(i.X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=r(i.X3DTexture3DNode,this._transferFunction)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields:function(t){this._enabled.getValue()&&t.addUserDefinedField(i.inputOutput,"transferFunction_"+this.getId(),new e.SFNode(this.transferFunctionNode))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",-1!==this.transferFunctionNode.getType().indexOf(i.X3DTexture2DNode)?(e+="uniform sampler2D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rg);\n",e+="}\n"):(e+="uniform sampler3D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rgb);\n",e+="}\n"),e},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// OpacityMapVolumeStyle\n",e+="\n",e+="\ttextureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n"}}),s})),e("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",["x_ite/Components/Texturing/PixelTexture","x_ite/Components/Texturing/TextureProperties","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle"],(function(e,t,n){"use strict";const o=Symbol(),i=Symbol(),r=Symbol();function s(){}return s.prototype={getDefaultVolumeStyle:function(){return this[o]=new n(this.getPrivateScene()),this[o].setup(),this.getDefaultVolumeStyle=function(){return this[o]},Object.defineProperty(this,"getDefaultVolumeStyle",{enumerable:!1}),this[o]},getDefaultBlendedVolumeStyle:function(){return this[i]=new n(this.getPrivateScene()),this[i].setup(),this.getDefaultBlendedVolumeStyle=function(){return this[i]},Object.defineProperty(this,"getDefaultBlendedVolumeStyle",{enumerable:!1}),this[i]},getDefaultTransferFunction:function(){this[r]=new e(this.getPrivateScene());const n=new t(this.getPrivateScene());n._generateMipMaps=!0,n._boundaryModeS="CLAMP_TO_EDGE",n._boundaryModeT="REPEAT",this[r]._textureProperties=n,this[r]._image.width=256,this[r]._image.height=1,this[r]._image.comp=2;const o=this[r]._image.array;for(let e=0;e<256;++e)o[e]=e<<8|e;return n.setup(),this[r].setup(),this.getDefaultTransferFunction=function(){return this[r]},Object.defineProperty(this,"getDefaultTransferFunction",{enumerable:!1}),this[r]}},s})),e("x_ite/Components/VolumeRendering/BlendedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","x_ite/DEBUG"],(function(e,t,n,o,i,r,s){"use strict";function a(e){o.call(this,e),this.addType(i.BlendedVolumeStyle)}return a.prototype=Object.assign(Object.create(o.prototype),{constructor:a,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"weightConstant1",new e.SFFloat(.5)),new t(i.inputOutput,"weightConstant2",new e.SFFloat(.5)),new t(i.inputOutput,"weightFunction1",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightFunction2",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightTransferFunction1",new e.SFNode),new t(i.inputOutput,"weightTransferFunction2",new e.SFNode),new t(i.inputOutput,"renderStyle",new e.SFNode),new t(i.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"BlendedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._weightTransferFunction1.addInterest("set_weightTransferFunction1__",this),this._weightTransferFunction2.addInterest("set_weightTransferFunction2__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addInterest("set_voxels__",this),this.set_weightTransferFunction1__(),this.set_weightTransferFunction2__(),this.set_renderStyle__(),this.set_voxels__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__:function(){this.weightTransferFunction1Node=r(i.X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__:function(){this.weightTransferFunction2Node=r(i.X3DTexture2DNode,this._weightTransferFunction2)},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.removeVolumeData(e)}.bind(this))),this.renderStyleNode=r(i.X3DComposableVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.addVolumeData(e)}.bind(this)))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=r(i.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){this.getVolumeData().forEach(function(e){try{var t=e.getShader().getField("textureSize_"+this.getId());t.x=this.voxelsNode.getWidth(),t.y=this.voxelsNode.getHeight(),t.z=this.voxelsNode.getDepth()}catch(e){s&&console.error(e)}}.bind(this))},addShaderFields:function(t){if(this._enabled.getValue()){if(t.addUserDefinedField(i.inputOutput,"weightConstant1_"+this.getId(),this._weightConstant1.copy()),t.addUserDefinedField(i.inputOutput,"weightConstant2_"+this.getId(),this._weightConstant2.copy()),this.weightTransferFunction1Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction1_"+this.getId(),new e.SFNode(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction2_"+this.getId(),new e.SFNode(this.weightTransferFunction2Node)),this.voxelsNode){var n=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());t.addUserDefinedField(i.inputOutput,"voxels_"+this.getId(),new e.SFNode(this.voxelsNode)),t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),n)}else t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),new e.SFVec3f);this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(t),this.renderStyleNode&&this.renderStyleNode.addShaderFields(t)}},getUniformsText:function(){if(!this._enabled.getValue())return"";if(!this.voxelsNode)return"";var e="";e+="\n",e+="// BlendedVolumeStyle\n",e+="\n",e+="uniform float weightConstant1_"+this.getId()+";\n",e+="uniform float weightConstant2_"+this.getId()+";\n",this.weightTransferFunction1Node&&(e+="uniform sampler2D weightTransferFunction1_"+this.getId()+";\n"),this.weightTransferFunction2Node&&(e+="uniform sampler2D weightTransferFunction2_"+this.getId()+";\n"),e+="uniform sampler3D voxels_"+this.getId()+";\n",e+="uniform vec3 textureSize_"+this.getId()+";\n";var t=this.getBrowser().getDefaultBlendedVolumeStyle().getUniformsText();this.renderStyleNode&&(t+=this.renderStyleNode.getUniformsText()),e+="\n",e+=t=(t=t.replace(/x3d_Texture3D \[0\]/g,"voxels_"+this.getId())).replace(/x3d_TextureSize/g,"textureSize_"+this.getId()),e+="\n",e+="vec4\n",e+="getBlendedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 blendColor_"+this.getId()+" = texture (voxels_"+this.getId()+", texCoord);";var n=this.getBrowser().getDefaultBlendedVolumeStyle().getFunctionsText();switch(this.renderStyleNode&&(n+=this.renderStyleNode.getFunctionsText()),e+="\n",e+=n=n.replace(/textureColor/g,"blendColor_"+this.getId()),this._weightFunction1.getValue()){default:e+="\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w1_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w1_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w1_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w1_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":this.weightTransferFunction1Node?e+="\tfloat w1_"+this.getId()+" = texture (weightTransferFunction1_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":e+="\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n"}switch(this._weightFunction2.getValue()){default:e+="\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w2_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w2_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w2_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w2_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":this.weightTransferFunction2Node?e+="\tfloat w2_"+this.getId()+" = texture (weightTransferFunction2_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":e+="\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n"}return e+="\n",e+="\treturn clamp (originalColor * w1_"+this.getId()+" + blendColor_"+this.getId()+" * w2_"+this.getId()+", 0.0, 1.0);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";if(!this.voxelsNode)return"";var e="";return e+="\n",e+="\t// BlendedVolumeStyle\n",e+="\n",e+="\ttextureColor = getBlendedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),a})),e("x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants"],(function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.BoundaryEnhancementVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"retainedOpacity",new e.SFFloat(.2)),new t(i.inputOutput,"boundaryOpacity",new e.SFFloat(.9)),new t(i.inputOutput,"opacityFactor",new e.SFFloat(2))]),getTypeName:function(){return"BoundaryEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(i.inputOutput,"retainedOpacity_"+this.getId(),this._retainedOpacity.copy()),e.addUserDefinedField(i.inputOutput,"boundaryOpacity_"+this.getId(),this._boundaryOpacity.copy()),e.addUserDefinedField(i.inputOutput,"opacityFactor_"+this.getId(),this._opacityFactor.copy()))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="uniform float retainedOpacity_"+this.getId()+";\n",e+="uniform float boundaryOpacity_"+this.getId()+";\n",e+="uniform float opacityFactor_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getBoundaryEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tfloat f0 = texture (x3d_Texture3D [0], texCoord) .r;\n",e+="\tfloat f1 = texture (x3d_Texture3D [0], texCoord + vec3 (0.0, 0.0, 1.0 / x3d_TextureSize .z)) .r;\n",e+="\tfloat f = abs (f0 - f1);\n",e+="\n",e+="\tfloat retainedOpacity = retainedOpacity_"+this.getId()+";\n",e+="\tfloat boundaryOpacity = boundaryOpacity_"+this.getId()+";\n",e+="\tfloat opacityFactor = opacityFactor_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (retainedOpacity + boundaryOpacity * pow (f, opacityFactor)));\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r})),e("x_ite/Components/VolumeRendering/CartoonVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.CartoonVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"colorSteps",new e.SFInt32(4)),new t(i.inputOutput,"orthogonalColor",new e.SFColorRGBA(1,1,1,1)),new t(i.inputOutput,"parallelColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"CartoonVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"colorSteps_"+this.getId(),this._colorSteps.copy()),t.addUserDefinedField(i.inputOutput,"orthogonalColor_"+this.getId(),this._orthogonalColor.copy()),t.addUserDefinedField(i.inputOutput,"parallelColor_"+this.getId(),this._parallelColor.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// CartoonVolumeStyle\n",e+="\n",e+="uniform int colorSteps_"+this.getId()+";\n",e+="uniform vec4 orthogonalColor_"+this.getId()+";\n",e+="uniform vec4 parallelColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec3\n",e+="rgb2hsv_"+this.getId()+" (in vec3 color)\n",e+="{\n",e+="\tfloat h = 0.0;\n",e+="\tfloat s = 0.0;\n",e+="\tfloat v = 0.0;\n",e+="\n",e+="\tfloat min = min (min (color .r, color .g), color .b);\n",e+="\tfloat max = max (max (color .r, color .g), color .b);\n",e+="\tv = max; // value\n",e+="\n",e+="\tfloat delta = max - min;\n",e+="\n",e+="\tif (max != 0.0 && delta != 0.0)\n",e+="\t{\n",e+="\t\ts = delta / max; // s\n",e+="\n",e+="\t\tif (color .r == max)\n",e+="\t\t\th = (color .g - color .b) / delta; // between yellow & magenta\n",e+="\t\telse if (color .g == max)\n",e+="\t\t\th = 2.0 + (color .b - color .r) / delta; // between cyan & yellow\n",e+="\t\telse\n",e+="\t\t\th = 4.0 + (color .r - color .g) / delta; // between magenta & cyan\n",e+="\n",e+="\t\th *= M_PI / 3.0; // radiants\n",e+="\t\tif (h < 0.0)\n",e+="\t\t\th += M_PI * 2.0;\n",e+="\t}\n",e+="\telse\n",e+="\t\ts = h = 0.0; // s = 0, h is undefined\n",e+="\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec3\n",e+="hsv2rgb_"+this.getId()+" (in vec3 hsv)\n",e+="{\n",e+="\tfloat h = hsv [0];\n",e+="\tfloat s = clamp (hsv [1], 0.0, 1.0);\n",e+="\tfloat v = clamp (hsv [2], 0.0, 1.0);\n",e+="\n",e+="\t// H is given on [0, 2 * Pi]. S and V are given on [0, 1].\n",e+="\t// RGB are each returned on [0, 1].\n",e+="\n",e+="\tif (s == 0.0)\n",e+="\t{\n",e+="\t\t// achromatic (grey)\n",e+="\t\treturn vec3 (v, v, v);\n",e+="\t}\n",e+="\telse\n",e+="\t{\n",e+="\t\tfloat w = (h * (180.0 / M_PI)) / 60.0; // sector 0 to 5\n",e+="\n",e+="\t\tfloat i = floor (w);\n",e+="\t\tfloat f = w - i; // factorial part of h\n",e+="\t\tfloat p = v * ( 1.0 - s );\n",e+="\t\tfloat q = v * ( 1.0 - s * f );\n",e+="\t\tfloat t = v * ( 1.0 - s * ( 1.0 - f ) );\n",e+="\n",e+="\t\tswitch (int (i) % 6)\n",e+="\t\t{\n",e+="\t\t\tcase 0: return vec3 (v, t, p);\n",e+="\t\t\tcase 1: return vec3 (q, v, p);\n",e+="\t\t\tcase 2: return vec3 (p, v, t);\n",e+="\t\t\tcase 3: return vec3 (p, q, v);\n",e+="\t\t\tcase 4: return vec3 (t, p, v);\n",e+="\t\t\tdefault: return vec3 (v, p, q);\n",e+="\t\t}\n",e+="\t}\n",e+="\n",e+="\treturn vec3 (0.0);\n",e+="}\n",e+="\n",e+="vec3\n",e+="mix_hsv_"+this.getId()+" (in vec3 a, in vec3 b, in float t)\n",e+="{\n",e+="\t// Linearely interpolate in HSV space between source color @a a and destination color @a b by an amount of @a t.\n",e+="\t// Source and destination color must be in HSV space.\n",e+="\n",e+="\tfloat ha = a [0];\n",e+="\tfloat sa = a [1];\n",e+="\tfloat va = a [2];\n",e+="\n",e+="\tfloat hb = b [0];\n",e+="\tfloat sb = b [1];\n",e+="\tfloat vb = b [2];\n",e+="\n",e+="\tif (sa == 0.0)\n",e+="\t\tha = hb;\n",e+="\n",e+="\tif (sb == 0.0)\n",e+="\t\thb = ha;\n",e+="\n",e+="\tfloat range = abs (hb - ha);\n",e+="\n",e+="\tif (range <= M_PI)\n",e+="\t{\n",e+="\t\tfloat h = ha + t * (hb - ha);\n",e+="\t\tfloat s = sa + t * (sb - sa);\n",e+="\t\tfloat v = va + t * (vb - va);\n",e+="\t\treturn vec3 (h, s, v);\n",e+="\t}\n",e+="\n",e+="\tfloat PI2 = M_PI * 2.0;\n",e+="\tfloat step = (PI2 - range) * t;\n",e+="\tfloat h = ha < hb ? ha - step : ha + step;\n",e+="\n",e+="\tif (h < 0.0)\n",e+="\t\th += PI2;\n",e+="\n",e+="\telse if (h > PI2)\n",e+="\t\th -= PI2;\n",e+="\n",e+="\tfloat s = sa + t * (sb - sa);\n",e+="\tfloat v = va + t * (vb - va);\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getCartoonStyle_"+this.getId()+" (in vec4 originalColor, vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 orthogonalColor = orthogonalColor_"+this.getId()+";\n",e+="\tvec4 parallelColor = parallelColor_"+this.getId()+";\n",e+="\tint colorSteps = colorSteps_"+this.getId()+";\n",e+="\n",e+="\tfloat steps = clamp (float (colorSteps), 1.0, 64.0);\n",e+="\tfloat step = M_PI / 2.0 / steps;\n",e+="\tfloat cosTheta = min (dot (surfaceNormal .xyz, normalize (vertex)), 1.0);\n",e+="\n",e+="\tif (cosTheta < 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tfloat t = cos (min (floor (acos (cosTheta) / step) * (steps > 1.0 ? steps / (steps - 1.0) : 1.0), steps) * step);\n",e+="\tvec3 orthogonalHSV = rgb2hsv_"+this.getId()+" (orthogonalColor .rgb);\n",e+="\tvec3 parallelHSV = rgb2hsv_"+this.getId()+" (parallelColor .rgb);\n",e+="\n",e+="\treturn vec4 (hsv2rgb_"+this.getId()+" (mix_hsv_"+this.getId()+" (orthogonalHSV, parallelHSV, t)), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// CartoonVolumeStyle\n",e+="\n",e+="\ttextureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/ComposedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ComposedVolumeStyle),this.renderStyleNodes=[]}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"renderStyle",new e.MFNode)]),getTypeName:function(){return"ComposedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e);for(var t=this.renderStyleNodes,n=0,i=t.length;n<i;++n){t[n].addVolumeData(e)}},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e);for(var t=0,n=renderStyleNodes.length;t<n;++t){renderStyleNodes[t].removeVolumeData(e)}},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){(o=e[t]).removeInterest("addNodeEvent",this),this.getVolumeData().forEach((function(e){o.removeVolumeData(e)}))}e.length=0;for(t=0,n=this._renderStyle.length;t<n;++t){(o=r(i.X3DComposableVolumeRenderStyleNode,this._renderStyle[t]))&&e.push(o)}for(t=0,n=e.length;t<n;++t){var o;(o=e[t]).addInterest("addNodeEvent",this),this.getVolumeData().forEach((function(e){o.addVolumeData(e)}))}},addShaderFields:function(e){if(this._enabled.getValue())for(var t=this.renderStyleNodes,n=0,o=t.length;n<o;++n)t[n].addShaderFields(e)},getUniformsText:function(){if(!this._enabled.getValue())return"";for(var e=this.renderStyleNodes,t="",n=0,o=e.length;n<o;++n)t+=e[n].getUniformsText();t+="\n",t+="vec4\n",t+="getComposedStyle_"+this.getId()+" (in vec4 textureColor, in vec3 texCoord)\n",t+="{\n";for(n=0,o=e.length;n<o;++n)t+=e[n].getFunctionsText();return t+="\n",t+="\treturn textureColor;\n",t+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ComposedVolumeStyle\n",e+="\n",e+="\ttextureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.EdgeEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"edgeColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"gradientThreshold",new e.SFFloat(.4)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"EdgeEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"edgeColor_"+this.getId(),this._edgeColor.copy()),t.addUserDefinedField(i.inputOutput,"gradientThreshold_"+this.getId(),this._gradientThreshold.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// EdgeEnhancementVolumeStyle\n",e+="\n",e+="uniform vec4 edgeColor_"+this.getId()+";\n",e+="uniform float gradientThreshold_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getEdgeEnhacementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 edgeColor = edgeColor_"+this.getId()+";\n",e+="\tfloat gradientThreshold = gradientThreshold_"+this.getId()+";\n",e+="\n",e+="\tfloat angle = abs (dot (surfaceNormal .xyz, normalize (vertex)));\n",e+="\n",e+="\tif (angle >= cos (gradientThreshold))\n",e+="\t\treturn originalColor;\n",e+="\telse\n",e+="\t\treturn vec4 (mix (edgeColor .rgb, originalColor.rgb, angle), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// EdgeEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/X3DVolumeDataNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Base/X3DConstants","x_ite/Browser/Core/TextureQuality","standard/Math/Numbers/Vector3"],(function(e,t,n,o,i,r){"use strict";function s(e){t.call(this,e),n.call(this,e),this.addType(o.X3DVolumeDataNode),this.proximitySensorNode=e.createNode("ProximitySensor",!1),this.transformNode=e.createNode("Transform",!1),this.shapeNode=e.createNode("Shape",!1),this.appearanceNode=e.createNode("Appearance",!1),this.textureTransformNode=e.createNode("TextureTransform3D",!1),this.geometryNode=e.createNode("QuadSet",!1),this.textureCoordinateNode=e.createNode("TextureCoordinate3D",!1),this.coordinateNode=e.createNode("Coordinate",!1),this.setCameraObject(!0)}return s.prototype=Object.assign(Object.create(t.prototype),n.prototype,{constructor:s,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this);var o=this.getBrowser(),i=o.getContext();o.getBrowserOptions()._TextureQuality.addInterest("set_dimensions__",this),i.getVersion()>=2&&(this._dimensions.addInterest("set_dimensions__",this),this.set_dimensions__()),this.appearanceNode.setPrivate(!0),this.proximitySensorNode._size=new e.SFVec3f(-1,-1,-1),this.transformNode._children=new e.MFNode(this.shapeNode),this.shapeNode._appearance=this.appearanceNode,this.shapeNode._geometry=this.geometryNode,this.appearanceNode._alphaMode="BLEND",this.appearanceNode._textureTransform=this.textureTransformNode,this.textureTransformNode._translation=new e.SFVec3f(.5,.5,.5),this.textureTransformNode._center=new e.SFVec3f(-.5,-.5,-.5),this.geometryNode._texCoord=this.textureCoordinateNode,this.geometryNode._coord=this.coordinateNode,this.coordinateNode.setup(),this.textureCoordinateNode.setup(),this.geometryNode.setup(),this.textureTransformNode.setup(),this.appearanceNode.setup(),this.shapeNode.setup(),this.transformNode.setup(),this.proximitySensorNode.setup(),this.proximitySensorNode._orientation_changed.addFieldInterest(this.transformNode._rotation),this.proximitySensorNode._orientation_changed.addFieldInterest(this.textureTransformNode._rotation),this.textureTransformNode.addInterest("set_textureTransform__",this)},getBBox:function(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),r.Zero):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getAppearance:function(){return this.appearanceNode},setShader:function(t){this.getAppearance()._shaders[0]=t,t.addUserDefinedField(o.inputOutput,"x3d_TextureNormalMatrix",new e.SFMatrix3f),t.setup(),this.set_textureTransform__()},getShader:function(){var e=this.appearanceNode._shaders[0];return e?e.getValue():null},getNumPlanes:function(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case i.LOW:return 200;case i.MEDIUM:return 400;case i.HIGH:return 600}return 200},set_dimensions__:function(){var t=this.getNumPlanes(),n=this._dimensions.getValue().abs(),o=n/2,i=[];this.coordinateNode._point.length=0;for(var r=0;r<t;++r){var s=r/(t-1)-.5;i.push(o,o,n*s,-o,o,n*s,-o,-o,n*s,o,-o,n*s)}this.coordinateNode._point=i,this.textureCoordinateNode._point=i,this.textureTransformNode._scale=new e.SFVec3f(1/this._dimensions.x,1/this._dimensions.y,1/this._dimensions.z)},set_textureTransform__:function(){var e=this.getShader();e&&e.getField("x3d_TextureNormalMatrix").setValue(this.textureTransformNode.getMatrix().submatrix.inverse().transpose())},traverse:function(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)}}),s})),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.vs",[],(function(){return"#version 300 es\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\nuniform mat4 x3d_TextureMatrix [1];\n\nin float x3d_FogDepth;\nin vec4 x3d_TexCoord0;\nin vec4 x3d_Vertex;\n\nout float fogDepth;\nout vec3 vertex;\nout vec4 texCoord;\n\nvoid\nmain ()\n{\n vec4 position = x3d_ModelViewMatrix * x3d_Vertex;\n\n fogDepth = x3d_FogDepth;\n vertex = position .xyz;\n texCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;\n\n gl_Position = x3d_ProjectionMatrix * position;\n}\n"})),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.fs",[],(function(){return"#version 300 es\n\nprecision highp float;\nprecision highp int;\nprecision highp sampler3D;\n\nuniform int x3d_NumLights;\nuniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];\n\nuniform int x3d_NumTextures;\nuniform sampler3D x3d_Texture3D [1];\nuniform vec3 x3d_TextureSize;\n\nuniform mat3 x3d_TextureNormalMatrix;\n\nconst float M_PI = 3.14159265359;\n\nin float fogDepth;\nin vec3 vertex;\nin vec4 texCoord;\n\n\nuniform x3d_FogParameters x3d_Fog;\n\nfloat\ngetFogInterpolant ()\n{\n // Returns 0.0 for fog color and 1.0 for material color.\n\n if (x3d_Fog .type == x3d_None)\n return 1.0;\n\n if (x3d_Fog .fogCoord)\n return clamp (1.0 - fogDepth, 0.0, 1.0);\n\n float visibilityRange = x3d_Fog .visibilityRange;\n\n if (visibilityRange <= 0.0)\n return 1.0;\n\n float dV = length (x3d_Fog .matrix * vertex);\n\n if (dV >= visibilityRange)\n return 0.0;\n\n switch (x3d_Fog .type)\n {\n case x3d_LinearFog:\n {\n return (visibilityRange - dV) / visibilityRange;\n }\n case x3d_ExponentialFog:\n {\n return exp (-dV / (visibilityRange - dV));\n }\n default:\n {\n return 1.0;\n }\n }\n}\n\nvec3\ngetFogColor (const in vec3 color)\n{\n return mix (x3d_Fog .color, color, getFogInterpolant ());\n}\n\n// VOLUME_STYLES_UNIFORMS\n\nout vec4 x3d_FragColor;\n\n\nuniform int x3d_NumClipPlanes;\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nvoid\nclip ()\n{\n for (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n {\n if (i == x3d_NumClipPlanes)\n break;\n\n if (dot (vertex, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n discard;\n }\n}\n\nvec4\ngetTextureColor (in vec3 texCoord)\n{\n if (x3d_NumTextures == 0)\n discard;\n\n if (texCoord .s < 0.0 || texCoord .s > 1.0)\n discard;\n\n if (texCoord .t < 0.0 || texCoord .t > 1.0)\n discard;\n\n if (texCoord .p < 0.0 || texCoord .p > 1.0)\n discard;\n\n vec4 textureColor = texture (x3d_Texture3D [0], texCoord);\n\n // Apply volume styles.\n\n// VOLUME_STYLES_FUNCTIONS\n\n return textureColor;\n}\n\nvoid\nmain ()\n{\n clip ();\n\n x3d_FragColor = getTextureColor (texCoord .stp / texCoord .q);\n}\n"})),e("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],(function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.IsoSurfaceVolumeData),this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"contourStepSize",new e.SFFloat(0)),new t(s.inputOutput,"surfaceValues",new e.MFFloat),new t(s.inputOutput,"surfaceTolerance",new e.SFFloat(0)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"gradients",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"IsoSurfaceVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._gradients.addInterest("set_gradients__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addFieldInterest(this.getAppearance()._texture),this._contourStepSize.addInterest("update",this),this._surfaceValues.addInterest("update",this),this._surfaceTolerance.addInterest("update",this),this._renderStyle.addInterest("update",this),this.getAppearance()._texture=this._voxels,this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},set_gradients__:function(){this.gradientsNode=a(s.X3DTexture3DNode,this._gradients)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){(o=e[t]).removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(t=0,n=this._renderStyle.length;t<n;++t){(o=a(s.X3DComposableVolumeRenderStyleNode,this._renderStyle[t]))&&e.push(o)}for(t=0,n=e.length;t<n;++t){var o;(o=e[t]).addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();a+="\n",a+="uniform float surfaceValues ["+this._surfaceValues.length+"];\n",a+="uniform float surfaceTolerance;\n";for(var l=0,u=this.renderStyleNodes.length;l<u;++l)a+=this.renderStyleNodes[l].getUniformsText();if(d+="\n",d+="\t// IsoSurfaceVolumeData\n",d+="\n",this.gradientsNode?(a+="\n",a+="uniform sampler3D gradients;\n",d+="\tif (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",d+="\t\tdiscard;\n"):(a+="\n",a+="vec4\n",a+="getNormal (in vec3 texCoord)\n",a+="{\n",a+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",a+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",a+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",a+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",a+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",a+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",a+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",a+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",a+="\n",a+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",a+="}\n",d+="\tif (getNormal (texCoord) .w < surfaceTolerance)\n",d+="\t\tdiscard;\n"),d+="\n",d+="\tfloat intensity = textureColor .r;\n",d+="\n",1===this._surfaceValues.length){var h=Math.abs(this._contourStepSize.getValue());if(0===h)d+="\tif (intensity > surfaceValues [0])\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(d+=this.renderStyleNodes[0].getFunctionsText()),d+="\t}\n",d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n";else{for(var c=[],g=this._surfaceValues[0]-h;g>0;g-=h)c.unshift(g);c.push(this._surfaceValues[0]);for(g=this._surfaceValues[0]+h;g<1;g+=h)c.push(g);d+="\tif (false)\n",d+="\t{ }\n";for(l=surfaceValues_.length-1;l>=0;--l)d+="\telse if (intensity > "+c[l]+")\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 ("+c[l]+"), 1.0);\n",this.renderStyleNodes.length&&(d+=this.renderStyleNodes[0].getFunctionsText()),d+="\t}\n";d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n"}}else{d+="\tif (false)\n",d+="\t{ }\n";for(l=this._surfaceValues.length-1;l>=0;--l){if(d+="\telse if (intensity > surfaceValues ["+l+"])\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 (surfaceValues ["+l+"]), 1.0);\n",this.renderStyleNodes.length){var f=Math.min(l,this.renderStyleNodes.length-1);d+=this.renderStyleNodes[f].getFunctionsText()}d+="\t}\n"}d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var p=new r(this.getExecutionContext());p.setName("VolumeDataVertexShader"),p._url.push("data:x-shader/x-vertex,"+t),p.setup();var m=new r(this.getExecutionContext());m.setName("VolumeDataFragmentShader"),m._type="FRAGMENT",m._url.push("data:x-shader/x-fragment,"+n),m.setup();var _=new i(this.getExecutionContext());if(_.setName("VolumeDataShader"),_._language="GLSL",_._parts.push(p),_._parts.push(m),_.addUserDefinedField(s.inputOutput,"surfaceValues",this._surfaceValues.copy()),_.addUserDefinedField(s.inputOutput,"surfaceTolerance",this._surfaceTolerance.copy()),this.gradientsNode&&_.addUserDefinedField(s.inputOutput,"grandients",new e.SFNode(this.gradientsNode)),this.voxelsNode){var x=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());_.addUserDefinedField(s.inputOutput,"x3d_TextureSize",x)}else _.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);o.addShaderFields(_);for(l=0,u=this.renderStyleNodes.length;l<u;++l)this.renderStyleNodes[l].addShaderFields(_);return _}}),h})),e("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Base/X3DConstants"],(function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.ProjectionVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"type",new e.SFString("MAX")),new t(i.inputOutput,"intensityThreshold",new e.SFFloat(0))]),getTypeName:function(){return"ProjectionVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this._enabled.getValue()&&e.addUserDefinedField(i.inputOutput,"intensityThreshold_"+this.getId(),this._intensityThreshold.copy())},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";switch(e+="\n",e+="// ProjectionVolumeStyle\n",e+="\n",e+="uniform float intensityThreshold_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getProjectionStyle_"+this.getId()+"(in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",this._type.getValue()){default:case"MAX":case"AVERAGE":e+="\tfloat projectionColor = 0.0;\n";break;case"MIN":e+="\tfloat projectionColor = 1.0;\n"}switch(e+="\tconst int samples = 32;\n",e+="\tvec3 step = normalize (x3d_TextureNormalMatrix * vec3 (0.0, 0.0, 1.0)) / float (samples);\n",e+="\tvec3 ray = texCoord - step * float (samples) * 0.5;\n",e+="\tbool first = false;\n",e+="\n",e+="\tfor (int i = 0; i < samples; ++ i, ray += step)\n",e+="\t{\n",e+="\t\tif (ray .s < 0.0 || ray .s > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .t < 0.0 || ray .t > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .p < 0.0 || ray .p > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tfloat intensity = texture (x3d_Texture3D [0], ray) .r;\n",e+="\n",this._type.getValue()){default:case"MAX":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity <= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"MIN":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity >= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"AVERAGE":e+="\t\tprojectionColor += intensity;\n"}return e+="\t}\n",e+="\n","AVERAGE"===this._type.getValue()&&(e+="\tprojectionColor /= float (samples);\n"),e+="\treturn vec4 (vec3 (projectionColor), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ProjectionVolumeStyle\n",e+="\n",e+="\ttextureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r})),e("x_ite/Components/VolumeRendering/SegmentedVolumeData",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],(function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"segmentEnabled",new e.MFBool),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"segmentIdentifiers",new e.SFNode),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"SegmentedVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._segmentIdentifiers.addInterest("set_segmentIdentifiers__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addFieldInterest(this.getAppearance()._texture),this._segmentEnabled.addInterest("update",this),this._segmentIdentifiers.addInterest("update",this),this._renderStyle.addInterest("update",this),this.getAppearance()._texture=this._voxels,this.set_segmentIdentifiers__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},getSegmentEnabled:function(e){return!(e<this._segmentEnabled.length)||this._segmentEnabled[e]},set_segmentIdentifiers__:function(){this.segmentIdentifiersNode=a(s.X3DTexture3DNode,this._segmentIdentifiers)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){(o=e[t]).removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(t=0,n=this._renderStyle.length;t<n;++t){(o=a(s.X3DComposableVolumeRenderStyleNode,this._renderStyle[t]))&&e.push(o)}for(t=0,n=e.length;t<n;++t){var o;(o=e[t]).addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();if(this.segmentIdentifiersNode?(a+="\n",a+="uniform sampler3D segmentIdentifiers;\n",d+="\n",d+="\n",d+="\tint segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):d+="\tint segment = 0;\n",this.renderStyleNodes.length){d+="\n",d+="\tswitch (segment)\n",d+="\t{\n";for(var l=0,u=this.renderStyleNodes.length;l<u;++l)d+="\t\tcase "+l+":\n",d+="\t\t{\n",this.getSegmentEnabled(l)?(a+=this.renderStyleNodes[l].getUniformsText(),d+=this.renderStyleNodes[l].getFunctionsText(),d+="\t\t\tbreak;\n"):d+="\t\t\tdiscard;\n",d+="\t\t}\n";d+="\t}\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var h=new r(this.getExecutionContext());h.setName("SegmentedVolumeDataVertexShader"),h._url.push("data:x-shader/x-vertex,"+t),h.setup();var c=new r(this.getExecutionContext());c.setName("SegmentedVolumeDataFragmentShader"),c._type="FRAGMENT",c._url.push("data:x-shader/x-fragment,"+n),c.setup();var g=new i(this.getExecutionContext());if(g.setName("SegmentedVolumeDataShader"),g._language="GLSL",g._parts.push(h),g._parts.push(c),this.voxelsNode){var f=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());g.addUserDefinedField(s.inputOutput,"x3d_TextureSize",f)}else g.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);this.segmentIdentifiersNode&&g.addUserDefinedField(s.inputOutput,"segmentIdentifiers",new e.SFNode(this.segmentIdentifiersNode)),o.addShaderFields(g);for(l=0,u=this.renderStyleNodes.length;l<u;++l)this.getSegmentEnabled(l)&&this.renderStyleNodes[l].addShaderFields(g);return g}}),h})),e("x_ite/Components/VolumeRendering/ShadedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ShadedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"lighting",new e.SFBool),new t(i.inputOutput,"shadows",new e.SFBool),new t(i.initializeOnly,"phaseFunction",new e.SFString("Henyey-Greenstein")),new t(i.inputOutput,"material",new e.SFNode),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ShadedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._material.addInterest("set_material__",this),this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_material__(),this.set_surfaceNormals__())},set_material__:function(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=r(i.X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(this.materialNode&&(t.addUserDefinedField(i.inputOutput,"ambientIntensity_"+this.getId(),this.materialNode._ambientIntensity.copy()),t.addUserDefinedField(i.inputOutput,"diffuseColor_"+this.getId(),this.materialNode._diffuseColor.copy()),t.addUserDefinedField(i.inputOutput,"specularColor_"+this.getId(),this.materialNode._specularColor.copy()),t.addUserDefinedField(i.inputOutput,"emissiveColor_"+this.getId(),this.materialNode._emissiveColor.copy()),t.addUserDefinedField(i.inputOutput,"shininess_"+this.getId(),this.materialNode._shininess.copy()),t.addUserDefinedField(i.inputOutput,"transparency_"+this.getId(),this.materialNode._transparency.copy())),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// ShadedVolumeStyle\n",e+="\n",e+="uniform float ambientIntensity_"+this.getId()+";\n",e+="uniform vec3 diffuseColor_"+this.getId()+";\n",e+="uniform vec3 specularColor_"+this.getId()+";\n",e+="uniform vec3 emissiveColor_"+this.getId()+";\n",e+="uniform float shininess_"+this.getId()+";\n",e+="uniform float transparency_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="float\n",e+="getSpotFactor_"+this.getId()+" (const in float cutOffAngle, const in float beamWidth, const in vec3 L, const in vec3 d)\n",e+="{\n",e+="\tfloat spotAngle = acos (clamp (dot (-L, d), -1.0, 1.0));\n",e+="\n",e+="\tif (spotAngle >= cutOffAngle)\n",e+="\t\treturn 0.0;\n",e+="\telse if (spotAngle <= beamWidth)\n",e+="\t\treturn 1.0;\n",e+="\n",e+="\treturn (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getShadedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 shadedColor = vec4 (0.0);\n",this._lighting.getValue()?(this.materialNode?(e+="\tvec3 diffuseFactor = diffuseColor_"+this.getId()+";\n",e+="\tvec3 ambientTerm = diffuseFactor * ambientIntensity_"+this.getId()+";\n",e+="\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):(e+="\tvec3 diffuseFactor = originalColor .rgb;\n",e+="\tvec3 ambientTerm = vec3 (0.0);\n",e+="\n",e+="\tshadedColor .a = originalColor .a;\n"),e+="\n",e+="\tvec3 N = surfaceNormal .xyz;\n",e+="\tvec3 V = normalize (-vertex); // normalized vector from point on geometry to viewer's position\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 vL = light .location - vertex; // Light to fragment\n",e+="\t\tfloat dL = length (light .matrix * vL);\n",e+="\t\tbool di = light .type == x3d_DirectionalLight;\n",e+="\n",e+="\t\tif (di || dL <= light .radius)\n",e+="\t\t{\n",e+="\t\t\tvec3 d = light .direction;\n",e+="\t\t\tvec3 c = light .attenuation;\n",e+="\t\t\tvec3 L = di ? -d : normalize (vL); // Normalized vector from point on geometry to light source i position.\n",e+="\t\t\tvec3 H = normalize (L + V); // Specular term\n",e+="\n",e+="\t\t\tfloat lightAngle = max (dot (N, L), 0.0); // Angle between normal and light ray.\n",e+="\t\t\tvec3 diffuseTerm = diffuseFactor * lightAngle;\n",e+="\t\t\tfloat specularFactor = shininess_"+this.getId()+" > 0.0 ? pow (max (dot (N, H), 0.0), shininess_"+this.getId()+" * 128.0) : 1.0;\n",e+="\t\t\tvec3 specularTerm = light .intensity * specularColor_"+this.getId()+" * specularFactor;\n",e+="\n",e+="\t\t\tfloat attenuationFactor = di ? 1.0 : 1.0 / max (c [0] + c [1] * dL + c [2] * (dL * dL), 1.0);\n",e+="\t\t\tfloat spotFactor = light .type == x3d_SpotLight ? getSpotFactor_"+this.getId()+" (light .cutOffAngle, light .beamWidth, L, d) : 1.0;\n",e+="\t\t\tfloat attenuationSpotFactor = attenuationFactor * spotFactor;\n",e+="\t\t\tvec3 ambientColor = light .ambientIntensity * ambientTerm;\n",e+="\t\t\tvec3 diffuseSpecularColor = light .intensity * (diffuseTerm + specularTerm);\n",e+="\n",e+="\t\t\tshadedColor .rgb += attenuationSpotFactor * light .color * (ambientColor + diffuseSpecularColor);\n",e+="\t\t}\n",e+="\n",e+="\t\tshadedColor .rgb += emissiveColor_"+this.getId()+";\n",e+="\t\tshadedColor .rgb = getFogColor (shadedColor .rgb);\n",e+="\t}\n"):this.materialNode?(e+="\tshadedColor .rgb = diffuseColor_"+this.getId()+";\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):e+="\tshadedColor = originalColor;\n",e+="\n",e+="\treturn shadedColor;\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ShadedVolumeStyle\n",e+="\n",e+="\ttextureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.SilhouetteEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"silhouetteRetainedOpacity",new e.SFFloat(1)),new t(i.inputOutput,"silhouetteBoundaryOpacity",new e.SFFloat(0)),new t(i.inputOutput,"silhouetteSharpness",new e.SFFloat(.5)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"SilhouetteEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this._silhouetteRetainedOpacity.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this._silhouetteBoundaryOpacity.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteSharpness_"+this.getId(),this._silhouetteSharpness.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="uniform float silhouetteRetainedOpacity_"+this.getId()+";\n",e+="uniform float silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="uniform float silhouetteSharpness_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getSilhouetteEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\t\n",e+="\tfloat silhouetteRetainedOpacity = silhouetteRetainedOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteBoundaryOpacity = silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteSharpness = silhouetteSharpness_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (silhouetteRetainedOpacity + silhouetteBoundaryOpacity * pow (1.0 - abs (dot (surfaceNormal .xyz, normalize (vertex))), silhouetteSharpness)));\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ToneMappedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"coolColor",new e.SFColorRGBA(0,0,1,0)),new t(i.inputOutput,"warmColor",new e.SFColorRGBA(1,1,0,0)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ToneMappedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"coolColor_"+this.getId(),this._coolColor.copy()),t.addUserDefinedField(i.inputOutput,"warmColor_"+this.getId(),this._warmColor.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// ToneMappedVolumeStyle\n",e+="\n",e+="uniform vec4 coolColor_"+this.getId()+";\n",e+="uniform vec4 warmColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getToneMappedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec3 toneColor = vec3 (0.0);\n",e+="\tvec3 coolColor = coolColor_"+this.getId()+" .rgb;\n",e+="\tvec3 warmColor = warmColor_"+this.getId()+" .rgb;\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 L = light .type == x3d_DirectionalLight ? -light .direction : normalize (light .location - vertex);\n",e+="\t\tfloat colorFactor = (1.0 + dot (L, surfaceNormal .xyz)) * 0.5;\n",e+="\n",e+="\t\ttoneColor += mix (warmColor .rgb, coolColor .rgb, colorFactor);\n",e+="\t}\n",e+="\n",e+="\treturn vec4 (toneColor, originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ToneMappedVolumeStyle\n",e+="\n",e+="\ttextureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/VolumeData",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],(function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.VolumeData),this.renderStyleNode=null}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"VolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addInterest("set_voxels__",this),this._voxels.addFieldInterest(this.getAppearance()._texture),this._renderStyle.addInterest("update",this),this.getAppearance()._texture=this._voxels,this.set_renderStyle__(),this.set_voxels__(),this.update())},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("update",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=a(s.X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("update",this),this.renderStyleNode.addVolumeData(this))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();this.renderStyleNode&&(a+=this.renderStyleNode.getUniformsText(),d+=this.renderStyleNode.getFunctionsText()),n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var l=new r(this.getExecutionContext());l.setName("VolumeDataVertexShader"),l._url.push("data:x-shader/x-vertex,"+t),l.setup();var u=new r(this.getExecutionContext());u.setName("VolumeDataFragmentShader"),u._type="FRAGMENT",u._url.push("data:x-shader/x-fragment,"+n),u.setup();var h=new i(this.getExecutionContext());if(h.setName("VolumeDataShader"),h._language="GLSL",h._parts.push(l),h._parts.push(u),this.voxelsNode){var c=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());h.addUserDefinedField(s.inputOutput,"x3d_TextureSize",c)}else h.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);return o.addShaderFields(h),this.renderStyleNode&&this.renderStyleNode.addShaderFields(h),h}}),h})),e(t.getComponentUrl("volume-rendering"),["x_ite/Components","x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext","x_ite/Components/VolumeRendering/BlendedVolumeStyle","x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle","x_ite/Components/VolumeRendering/CartoonVolumeStyle","x_ite/Components/VolumeRendering/ComposedVolumeStyle","x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle","x_ite/Components/VolumeRendering/IsoSurfaceVolumeData","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle","x_ite/Components/VolumeRendering/ProjectionVolumeStyle","x_ite/Components/VolumeRendering/SegmentedVolumeData","x_ite/Components/VolumeRendering/ShadedVolumeStyle","x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle","x_ite/Components/VolumeRendering/ToneMappedVolumeStyle","x_ite/Components/VolumeRendering/VolumeData","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",t.getComponentUrl("cad-geometry"),t.getComponentUrl("texturing-3d")],(function(e,t,n,o,i,r,s,a,d,l,u,h,c,g,f,p,m,_){"use strict";e.addComponent({name:"VolumeRendering",types:{BlendedVolumeStyle:n,BoundaryEnhancementVolumeStyle:o,CartoonVolumeStyle:i,ComposedVolumeStyle:r,EdgeEnhancementVolumeStyle:s,IsoSurfaceVolumeData:a,OpacityMapVolumeStyle:d,ProjectionVolumeStyle:l,SegmentedVolumeData:u,ShadedVolumeStyle:h,SilhouetteEnhancementVolumeStyle:c,ToneMappedVolumeStyle:g,VolumeData:f},abstractTypes:{X3DComposableVolumeRenderStyleNode:p,X3DVolumeDataNode:m,X3DVolumeRenderStyleNode:_},browser:t})}))}();
|
|
1
|
+
!function(){const e=window[Symbol.for("X_ITE.X3D-5.0.2")].define,t=window[Symbol.for("X_ITE.X3D-5.0.2")].require;e("x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",["x_ite/Components/Core/X3DNode","x_ite/Base/X3DConstants"],(function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DVolumeRenderStyleNode),this.volumeDataNodes=new Set}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,addShaderFields:function(e){},getUniformsText:function(){return""},getFunctionsText:function(){return""},getVolumeData:function(){return this.volumeDataNodes},addVolumeData:function(e){this.volumeDataNodes.add(e)},removeVolumeData:function(e){this.volumeDataNodes.delete(e)},getNormalText:function(e){var t="";return e?(t+="uniform sampler3D surfaceNormals_"+this.getId()+";\n",t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec3 n = texture (surfaceNormals_"+this.getId()+", texCoord) .xyz * 2.0 - 1.0;\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"):(t+="\n",t+="vec4\n",t+="getNormal_"+this.getId()+" (in vec3 texCoord)\n",t+="{\n",t+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",t+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",t+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",t+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",t+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",t+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",t+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",t+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",t+="\n",t+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",t+="}\n"),t}}),n})),e("x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode",["x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Base/X3DConstants"],(function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DComposableVolumeRenderStyleNode)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n}),n})),e("x_ite/Components/VolumeRendering/OpacityMapVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.OpacityMapVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"transferFunction",new e.SFNode)]),getTypeName:function(){return"OpacityMapVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._transferFunction.addInterest("set_transferFunction__",this),this.set_transferFunction__())},set_transferFunction__:function(){this.transferFunctionNode=r(i.X3DTexture2DNode,this._transferFunction),this.transferFunctionNode||(this.transferFunctionNode=r(i.X3DTexture3DNode,this._transferFunction)),this.transferFunctionNode||(this.transferFunctionNode=this.getBrowser().getDefaultTransferFunction())},addShaderFields:function(t){this._enabled.getValue()&&t.addUserDefinedField(i.inputOutput,"transferFunction_"+this.getId(),new e.SFNode(this.transferFunctionNode))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// OpacityMapVolumeStyle\n",e+="\n",-1!==this.transferFunctionNode.getType().indexOf(i.X3DTexture2DNode)?(e+="uniform sampler2D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rg);\n",e+="}\n"):(e+="uniform sampler3D transferFunction_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getOpacityMapStyle_"+this.getId()+" (in vec4 originalColor)\n",e+="{\n",e+="\treturn texture (transferFunction_"+this.getId()+", originalColor .rgb);\n",e+="}\n"),e},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// OpacityMapVolumeStyle\n",e+="\n",e+="\ttextureColor = getOpacityMapStyle_"+this.getId()+" (textureColor);\n"}}),s})),e("x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext",["x_ite/Components/Texturing/PixelTexture","x_ite/Components/Texturing/TextureProperties","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle"],(function(e,t,n){"use strict";const o=Symbol(),i=Symbol(),r=Symbol();function s(){}return s.prototype={getDefaultVolumeStyle:function(){return this[o]=new n(this.getPrivateScene()),this[o].setup(),this.getDefaultVolumeStyle=function(){return this[o]},Object.defineProperty(this,"getDefaultVolumeStyle",{enumerable:!1}),this[o]},getDefaultBlendedVolumeStyle:function(){return this[i]=new n(this.getPrivateScene()),this[i].setup(),this.getDefaultBlendedVolumeStyle=function(){return this[i]},Object.defineProperty(this,"getDefaultBlendedVolumeStyle",{enumerable:!1}),this[i]},getDefaultTransferFunction:function(){this[r]=new e(this.getPrivateScene());const n=new t(this.getPrivateScene());n._generateMipMaps=!0,n._boundaryModeS="CLAMP_TO_EDGE",n._boundaryModeT="REPEAT",this[r]._textureProperties=n,this[r]._image.width=256,this[r]._image.height=1,this[r]._image.comp=2;const o=this[r]._image.array;for(let e=0;e<256;++e)o[e]=e<<8|e;return n.setup(),this[r].setup(),this.getDefaultTransferFunction=function(){return this[r]},Object.defineProperty(this,"getDefaultTransferFunction",{enumerable:!1}),this[r]}},s})),e("x_ite/Components/VolumeRendering/BlendedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","x_ite/DEBUG"],(function(e,t,n,o,i,r,s){"use strict";function a(e){o.call(this,e),this.addType(i.BlendedVolumeStyle)}return a.prototype=Object.assign(Object.create(o.prototype),{constructor:a,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"weightConstant1",new e.SFFloat(.5)),new t(i.inputOutput,"weightConstant2",new e.SFFloat(.5)),new t(i.inputOutput,"weightFunction1",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightFunction2",new e.SFString("CONSTANT")),new t(i.inputOutput,"weightTransferFunction1",new e.SFNode),new t(i.inputOutput,"weightTransferFunction2",new e.SFNode),new t(i.inputOutput,"renderStyle",new e.SFNode),new t(i.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"BlendedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._weightTransferFunction1.addInterest("set_weightTransferFunction1__",this),this._weightTransferFunction2.addInterest("set_weightTransferFunction2__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addInterest("set_voxels__",this),this.set_weightTransferFunction1__(),this.set_weightTransferFunction2__(),this.set_renderStyle__(),this.set_voxels__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.addVolumeData(e)},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e),this.renderStyleNode&&this.renderStyleNode.removeVolumeData(e)},set_weightTransferFunction1__:function(){this.weightTransferFunction1Node=r(i.X3DTexture2DNode,this._weightTransferFunction1)},set_weightTransferFunction2__:function(){this.weightTransferFunction2Node=r(i.X3DTexture2DNode,this._weightTransferFunction2)},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.removeVolumeData(e)}.bind(this))),this.renderStyleNode=r(i.X3DComposableVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("addNodeEvent",this),this.getVolumeData().forEach(function(e){this.renderStyleNode.addVolumeData(e)}.bind(this)))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=r(i.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){this.getVolumeData().forEach(function(e){try{var t=e.getShader().getField("textureSize_"+this.getId());t.x=this.voxelsNode.getWidth(),t.y=this.voxelsNode.getHeight(),t.z=this.voxelsNode.getDepth()}catch(e){s&&console.error(e)}}.bind(this))},addShaderFields:function(t){if(this._enabled.getValue()){if(t.addUserDefinedField(i.inputOutput,"weightConstant1_"+this.getId(),this._weightConstant1.copy()),t.addUserDefinedField(i.inputOutput,"weightConstant2_"+this.getId(),this._weightConstant2.copy()),this.weightTransferFunction1Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction1_"+this.getId(),new e.SFNode(this.weightTransferFunction1Node)),this.weightTransferFunction2Node&&t.addUserDefinedField(i.inputOutput,"weightTransferFunction2_"+this.getId(),new e.SFNode(this.weightTransferFunction2Node)),this.voxelsNode){var n=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());t.addUserDefinedField(i.inputOutput,"voxels_"+this.getId(),new e.SFNode(this.voxelsNode)),t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),n)}else t.addUserDefinedField(i.inputOutput,"textureSize_"+this.getId(),new e.SFVec3f);this.getBrowser().getDefaultBlendedVolumeStyle().addShaderFields(t),this.renderStyleNode&&this.renderStyleNode.addShaderFields(t)}},getUniformsText:function(){if(!this._enabled.getValue())return"";if(!this.voxelsNode)return"";var e="";e+="\n",e+="// BlendedVolumeStyle\n",e+="\n",e+="uniform float weightConstant1_"+this.getId()+";\n",e+="uniform float weightConstant2_"+this.getId()+";\n",this.weightTransferFunction1Node&&(e+="uniform sampler2D weightTransferFunction1_"+this.getId()+";\n"),this.weightTransferFunction2Node&&(e+="uniform sampler2D weightTransferFunction2_"+this.getId()+";\n"),e+="uniform sampler3D voxels_"+this.getId()+";\n",e+="uniform vec3 textureSize_"+this.getId()+";\n";var t=this.getBrowser().getDefaultBlendedVolumeStyle().getUniformsText();this.renderStyleNode&&(t+=this.renderStyleNode.getUniformsText()),e+="\n",e+=t=(t=t.replace(/x3d_Texture3D \[0\]/g,"voxels_"+this.getId())).replace(/x3d_TextureSize/g,"textureSize_"+this.getId()),e+="\n",e+="vec4\n",e+="getBlendedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 blendColor_"+this.getId()+" = texture (voxels_"+this.getId()+", texCoord);";var n=this.getBrowser().getDefaultBlendedVolumeStyle().getFunctionsText();switch(this.renderStyleNode&&(n+=this.renderStyleNode.getFunctionsText()),e+="\n",e+=n=n.replace(/textureColor/g,"blendColor_"+this.getId()),this._weightFunction1.getValue()){default:e+="\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w1_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w1_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w1_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w1_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":this.weightTransferFunction1Node?e+="\tfloat w1_"+this.getId()+" = texture (weightTransferFunction1_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":e+="\tfloat w1_"+this.getId()+" = weightConstant1_"+this.getId()+";\n"}switch(this._weightFunction2.getValue()){default:e+="\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n";break;case"ALPHA0":e+="\tfloat w2_"+this.getId()+" = originalColor .a;\n";break;case"ALPHA1":e+="\tfloat w2_"+this.getId()+" = blendColor_ "+this.getId()+" .a;\n";break;case"ONE_MINUS_ALPHA0":e+="\tfloat w2_"+this.getId()+" = 1.0 - originalColor .a;\n";break;case"ONE_MINUS_ALPHA1":e+="\tfloat w2_"+this.getId()+" = 1.0 - blendColor_ "+this.getId()+" .a;\n";break;case"TABLE":this.weightTransferFunction2Node?e+="\tfloat w2_"+this.getId()+" = texture (weightTransferFunction2_"+this.getId()+", vec2 (originalColor .a, blendColor_"+this.getId()+" .a)) .r;\n":e+="\tfloat w2_"+this.getId()+" = weightConstant2_"+this.getId()+";\n"}return e+="\n",e+="\treturn clamp (originalColor * w1_"+this.getId()+" + blendColor_"+this.getId()+" * w2_"+this.getId()+", 0.0, 1.0);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";if(!this.voxelsNode)return"";var e="";return e+="\n",e+="\t// BlendedVolumeStyle\n",e+="\n",e+="\ttextureColor = getBlendedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),a})),e("x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants"],(function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.BoundaryEnhancementVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"retainedOpacity",new e.SFFloat(.2)),new t(i.inputOutput,"boundaryOpacity",new e.SFFloat(.9)),new t(i.inputOutput,"opacityFactor",new e.SFFloat(2))]),getTypeName:function(){return"BoundaryEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this._enabled.getValue()&&(e.addUserDefinedField(i.inputOutput,"retainedOpacity_"+this.getId(),this._retainedOpacity.copy()),e.addUserDefinedField(i.inputOutput,"boundaryOpacity_"+this.getId(),this._boundaryOpacity.copy()),e.addUserDefinedField(i.inputOutput,"opacityFactor_"+this.getId(),this._opacityFactor.copy()))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="uniform float retainedOpacity_"+this.getId()+";\n",e+="uniform float boundaryOpacity_"+this.getId()+";\n",e+="uniform float opacityFactor_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getBoundaryEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tfloat f0 = texture (x3d_Texture3D [0], texCoord) .r;\n",e+="\tfloat f1 = texture (x3d_Texture3D [0], texCoord + vec3 (0.0, 0.0, 1.0 / x3d_TextureSize .z)) .r;\n",e+="\tfloat f = abs (f0 - f1);\n",e+="\n",e+="\tfloat retainedOpacity = retainedOpacity_"+this.getId()+";\n",e+="\tfloat boundaryOpacity = boundaryOpacity_"+this.getId()+";\n",e+="\tfloat opacityFactor = opacityFactor_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (retainedOpacity + boundaryOpacity * pow (f, opacityFactor)));\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// BoundaryEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getBoundaryEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r})),e("x_ite/Components/VolumeRendering/CartoonVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.CartoonVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"colorSteps",new e.SFInt32(4)),new t(i.inputOutput,"orthogonalColor",new e.SFColorRGBA(1,1,1,1)),new t(i.inputOutput,"parallelColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"CartoonVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"colorSteps_"+this.getId(),this._colorSteps.copy()),t.addUserDefinedField(i.inputOutput,"orthogonalColor_"+this.getId(),this._orthogonalColor.copy()),t.addUserDefinedField(i.inputOutput,"parallelColor_"+this.getId(),this._parallelColor.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// CartoonVolumeStyle\n",e+="\n",e+="uniform int colorSteps_"+this.getId()+";\n",e+="uniform vec4 orthogonalColor_"+this.getId()+";\n",e+="uniform vec4 parallelColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec3\n",e+="rgb2hsv_"+this.getId()+" (in vec3 color)\n",e+="{\n",e+="\tfloat h = 0.0;\n",e+="\tfloat s = 0.0;\n",e+="\tfloat v = 0.0;\n",e+="\n",e+="\tfloat min = min (min (color .r, color .g), color .b);\n",e+="\tfloat max = max (max (color .r, color .g), color .b);\n",e+="\tv = max; // value\n",e+="\n",e+="\tfloat delta = max - min;\n",e+="\n",e+="\tif (max != 0.0 && delta != 0.0)\n",e+="\t{\n",e+="\t\ts = delta / max; // s\n",e+="\n",e+="\t\tif (color .r == max)\n",e+="\t\t\th = (color .g - color .b) / delta; // between yellow & magenta\n",e+="\t\telse if (color .g == max)\n",e+="\t\t\th = 2.0 + (color .b - color .r) / delta; // between cyan & yellow\n",e+="\t\telse\n",e+="\t\t\th = 4.0 + (color .r - color .g) / delta; // between magenta & cyan\n",e+="\n",e+="\t\th *= M_PI / 3.0; // radiants\n",e+="\t\tif (h < 0.0)\n",e+="\t\t\th += M_PI * 2.0;\n",e+="\t}\n",e+="\telse\n",e+="\t\ts = h = 0.0; // s = 0, h is undefined\n",e+="\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec3\n",e+="hsv2rgb_"+this.getId()+" (in vec3 hsv)\n",e+="{\n",e+="\tfloat h = hsv [0];\n",e+="\tfloat s = clamp (hsv [1], 0.0, 1.0);\n",e+="\tfloat v = clamp (hsv [2], 0.0, 1.0);\n",e+="\n",e+="\t// H is given on [0, 2 * Pi]. S and V are given on [0, 1].\n",e+="\t// RGB are each returned on [0, 1].\n",e+="\n",e+="\tif (s == 0.0)\n",e+="\t{\n",e+="\t\t// achromatic (grey)\n",e+="\t\treturn vec3 (v, v, v);\n",e+="\t}\n",e+="\telse\n",e+="\t{\n",e+="\t\tfloat w = (h * (180.0 / M_PI)) / 60.0; // sector 0 to 5\n",e+="\n",e+="\t\tfloat i = floor (w);\n",e+="\t\tfloat f = w - i; // factorial part of h\n",e+="\t\tfloat p = v * ( 1.0 - s );\n",e+="\t\tfloat q = v * ( 1.0 - s * f );\n",e+="\t\tfloat t = v * ( 1.0 - s * ( 1.0 - f ) );\n",e+="\n",e+="\t\tswitch (int (i) % 6)\n",e+="\t\t{\n",e+="\t\t\tcase 0: return vec3 (v, t, p);\n",e+="\t\t\tcase 1: return vec3 (q, v, p);\n",e+="\t\t\tcase 2: return vec3 (p, v, t);\n",e+="\t\t\tcase 3: return vec3 (p, q, v);\n",e+="\t\t\tcase 4: return vec3 (t, p, v);\n",e+="\t\t\tdefault: return vec3 (v, p, q);\n",e+="\t\t}\n",e+="\t}\n",e+="\n",e+="\treturn vec3 (0.0);\n",e+="}\n",e+="\n",e+="vec3\n",e+="mix_hsv_"+this.getId()+" (in vec3 a, in vec3 b, in float t)\n",e+="{\n",e+="\t// Linearely interpolate in HSV space between source color @a a and destination color @a b by an amount of @a t.\n",e+="\t// Source and destination color must be in HSV space.\n",e+="\n",e+="\tfloat ha = a [0];\n",e+="\tfloat sa = a [1];\n",e+="\tfloat va = a [2];\n",e+="\n",e+="\tfloat hb = b [0];\n",e+="\tfloat sb = b [1];\n",e+="\tfloat vb = b [2];\n",e+="\n",e+="\tif (sa == 0.0)\n",e+="\t\tha = hb;\n",e+="\n",e+="\tif (sb == 0.0)\n",e+="\t\thb = ha;\n",e+="\n",e+="\tfloat range = abs (hb - ha);\n",e+="\n",e+="\tif (range <= M_PI)\n",e+="\t{\n",e+="\t\tfloat h = ha + t * (hb - ha);\n",e+="\t\tfloat s = sa + t * (sb - sa);\n",e+="\t\tfloat v = va + t * (vb - va);\n",e+="\t\treturn vec3 (h, s, v);\n",e+="\t}\n",e+="\n",e+="\tfloat PI2 = M_PI * 2.0;\n",e+="\tfloat step = (PI2 - range) * t;\n",e+="\tfloat h = ha < hb ? ha - step : ha + step;\n",e+="\n",e+="\tif (h < 0.0)\n",e+="\t\th += PI2;\n",e+="\n",e+="\telse if (h > PI2)\n",e+="\t\th -= PI2;\n",e+="\n",e+="\tfloat s = sa + t * (sb - sa);\n",e+="\tfloat v = va + t * (vb - va);\n",e+="\treturn vec3 (h, s, v);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getCartoonStyle_"+this.getId()+" (in vec4 originalColor, vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 orthogonalColor = orthogonalColor_"+this.getId()+";\n",e+="\tvec4 parallelColor = parallelColor_"+this.getId()+";\n",e+="\tint colorSteps = colorSteps_"+this.getId()+";\n",e+="\n",e+="\tfloat steps = clamp (float (colorSteps), 1.0, 64.0);\n",e+="\tfloat step = M_PI / 2.0 / steps;\n",e+="\tfloat cosTheta = min (dot (surfaceNormal .xyz, normalize (vertex)), 1.0);\n",e+="\n",e+="\tif (cosTheta < 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tfloat t = cos (min (floor (acos (cosTheta) / step) * (steps > 1.0 ? steps / (steps - 1.0) : 1.0), steps) * step);\n",e+="\tvec3 orthogonalHSV = rgb2hsv_"+this.getId()+" (orthogonalColor .rgb);\n",e+="\tvec3 parallelHSV = rgb2hsv_"+this.getId()+" (parallelColor .rgb);\n",e+="\n",e+="\treturn vec4 (hsv2rgb_"+this.getId()+" (mix_hsv_"+this.getId()+" (orthogonalHSV, parallelHSV, t)), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// CartoonVolumeStyle\n",e+="\n",e+="\ttextureColor = getCartoonStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/ComposedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ComposedVolumeStyle),this.renderStyleNodes=[]}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"renderStyle",new e.MFNode)]),getTypeName:function(){return"ComposedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this.set_renderStyle__())},addVolumeData:function(e){o.prototype.addVolumeData.call(this,e);for(var t=this.renderStyleNodes,n=0,i=t.length;n<i;++n){t[n].addVolumeData(e)}},removeVolumeData:function(e){o.prototype.removeVolumeData.call(this,e);for(var t=0,n=renderStyleNodes.length;t<n;++t){renderStyleNodes[t].removeVolumeData(e)}},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){(o=e[t]).removeInterest("addNodeEvent",this),this.getVolumeData().forEach((function(e){o.removeVolumeData(e)}))}e.length=0;for(t=0,n=this._renderStyle.length;t<n;++t){(o=r(i.X3DComposableVolumeRenderStyleNode,this._renderStyle[t]))&&e.push(o)}for(t=0,n=e.length;t<n;++t){var o;(o=e[t]).addInterest("addNodeEvent",this),this.getVolumeData().forEach((function(e){o.addVolumeData(e)}))}},addShaderFields:function(e){if(this._enabled.getValue())for(var t=this.renderStyleNodes,n=0,o=t.length;n<o;++n)t[n].addShaderFields(e)},getUniformsText:function(){if(!this._enabled.getValue())return"";for(var e=this.renderStyleNodes,t="",n=0,o=e.length;n<o;++n)t+=e[n].getUniformsText();t+="\n",t+="vec4\n",t+="getComposedStyle_"+this.getId()+" (in vec4 textureColor, in vec3 texCoord)\n",t+="{\n";for(n=0,o=e.length;n<o;++n)t+=e[n].getFunctionsText();return t+="\n",t+="\treturn textureColor;\n",t+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ComposedVolumeStyle\n",e+="\n",e+="\ttextureColor = getComposedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.EdgeEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"edgeColor",new e.SFColorRGBA(0,0,0,1)),new t(i.inputOutput,"gradientThreshold",new e.SFFloat(.4)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"EdgeEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"edgeColor_"+this.getId(),this._edgeColor.copy()),t.addUserDefinedField(i.inputOutput,"gradientThreshold_"+this.getId(),this._gradientThreshold.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// EdgeEnhancementVolumeStyle\n",e+="\n",e+="uniform vec4 edgeColor_"+this.getId()+";\n",e+="uniform float gradientThreshold_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getEdgeEnhacementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 edgeColor = edgeColor_"+this.getId()+";\n",e+="\tfloat gradientThreshold = gradientThreshold_"+this.getId()+";\n",e+="\n",e+="\tfloat angle = abs (dot (surfaceNormal .xyz, normalize (vertex)));\n",e+="\n",e+="\tif (angle >= cos (gradientThreshold))\n",e+="\t\treturn originalColor;\n",e+="\telse\n",e+="\t\treturn vec4 (mix (edgeColor .rgb, originalColor.rgb, angle), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// EdgeEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getEdgeEnhacementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/X3DVolumeDataNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Base/X3DConstants","x_ite/Browser/Core/TextureQuality","standard/Math/Numbers/Vector3"],(function(e,t,n,o,i,r){"use strict";function s(e){t.call(this,e),n.call(this,e),this.addType(o.X3DVolumeDataNode),this.proximitySensorNode=e.createNode("ProximitySensor",!1),this.transformNode=e.createNode("Transform",!1),this.shapeNode=e.createNode("Shape",!1),this.appearanceNode=e.createNode("Appearance",!1),this.textureTransformNode=e.createNode("TextureTransform3D",!1),this.geometryNode=e.createNode("QuadSet",!1),this.textureCoordinateNode=e.createNode("TextureCoordinate3D",!1),this.coordinateNode=e.createNode("Coordinate",!1),this.setCameraObject(!0)}return s.prototype=Object.assign(Object.create(t.prototype),n.prototype,{constructor:s,initialize:function(){t.prototype.initialize.call(this),n.prototype.initialize.call(this);var o=this.getBrowser(),i=o.getContext();o.getBrowserOptions()._TextureQuality.addInterest("set_dimensions__",this),i.getVersion()>=2&&(this._dimensions.addInterest("set_dimensions__",this),this.set_dimensions__()),this.appearanceNode.setPrivate(!0),this.proximitySensorNode._size=new e.SFVec3f(-1,-1,-1),this.transformNode._children=new e.MFNode(this.shapeNode),this.shapeNode._appearance=this.appearanceNode,this.shapeNode._geometry=this.geometryNode,this.appearanceNode._alphaMode="BLEND",this.appearanceNode._textureTransform=this.textureTransformNode,this.textureTransformNode._translation=new e.SFVec3f(.5,.5,.5),this.textureTransformNode._center=new e.SFVec3f(-.5,-.5,-.5),this.geometryNode._texCoord=this.textureCoordinateNode,this.geometryNode._coord=this.coordinateNode,this.coordinateNode.setup(),this.textureCoordinateNode.setup(),this.geometryNode.setup(),this.textureTransformNode.setup(),this.appearanceNode.setup(),this.shapeNode.setup(),this.transformNode.setup(),this.proximitySensorNode.setup(),this.proximitySensorNode._orientation_changed.addFieldInterest(this.transformNode._rotation),this.proximitySensorNode._orientation_changed.addFieldInterest(this.textureTransformNode._rotation),this.textureTransformNode.addInterest("set_textureTransform__",this)},getBBox:function(e,t){return this._bboxSize.getValue().equals(this.getDefaultBBoxSize())?e.set(this._dimensions.getValue(),r.Zero):e.set(this._bboxSize.getValue(),this._bboxCenter.getValue())},getAppearance:function(){return this.appearanceNode},setShader:function(t){this.getAppearance()._shaders[0]=t,t.addUserDefinedField(o.inputOutput,"x3d_TextureNormalMatrix",new e.SFMatrix3f),t.setup(),this.set_textureTransform__()},getShader:function(){var e=this.appearanceNode._shaders[0];return e?e.getValue():null},getNumPlanes:function(){switch(this.getBrowser().getBrowserOptions().getTextureQuality()){case i.LOW:return 200;case i.MEDIUM:return 400;case i.HIGH:return 600}return 200},set_dimensions__:function(){var t=this.getNumPlanes(),n=this._dimensions.getValue().abs(),o=n/2,i=[];this.coordinateNode._point.length=0;for(var r=0;r<t;++r){var s=r/(t-1)-.5;i.push(o,o,n*s,-o,o,n*s,-o,-o,n*s,o,-o,n*s)}this.coordinateNode._point=i,this.textureCoordinateNode._point=i,this.textureTransformNode._scale=new e.SFVec3f(1/this._dimensions.x,1/this._dimensions.y,1/this._dimensions.z)},set_textureTransform__:function(){var e=this.getShader();e&&e.getField("x3d_TextureNormalMatrix").setValue(this.textureTransformNode.getMatrix().submatrix.inverse().transpose())},traverse:function(e,t){this.proximitySensorNode.traverse(e,t),this.transformNode.traverse(e,t)}}),s})),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.vs",[],(function(){return"#version 300 es\n\nprecision highp float;\nprecision highp int;\n\nuniform mat4 x3d_ProjectionMatrix;\nuniform mat4 x3d_ModelViewMatrix;\nuniform mat4 x3d_TextureMatrix [1];\n\nin float x3d_FogDepth;\nin vec4 x3d_TexCoord0;\nin vec4 x3d_Vertex;\n\nout float fogDepth;\nout vec3 vertex;\nout vec4 texCoord;\n\nvoid\nmain ()\n{\n vec4 position = x3d_ModelViewMatrix * x3d_Vertex;\n\n fogDepth = x3d_FogDepth;\n vertex = position .xyz;\n texCoord = x3d_TextureMatrix [0] * x3d_TexCoord0;\n\n gl_Position = x3d_ProjectionMatrix * position;\n}\n"})),e("text!x_ite/Browser/VolumeRendering/VolumeStyle.fs",[],(function(){return"#version 300 es\n\nprecision highp float;\nprecision highp int;\nprecision highp sampler3D;\n\nuniform int x3d_NumLights;\nuniform x3d_LightSourceParameters x3d_LightSource [x3d_MaxLights];\n\nuniform int x3d_NumTextures;\nuniform sampler3D x3d_Texture3D [1];\nuniform vec3 x3d_TextureSize;\n\nuniform mat3 x3d_TextureNormalMatrix;\n\nconst float M_PI = 3.14159265359;\n\nin float fogDepth;\nin vec3 vertex;\nin vec4 texCoord;\n\n\nuniform x3d_FogParameters x3d_Fog;\n\nfloat\ngetFogInterpolant ()\n{\n // Returns 0.0 for fog color and 1.0 for material color.\n\n if (x3d_Fog .type == x3d_None)\n return 1.0;\n\n if (x3d_Fog .fogCoord)\n return clamp (1.0 - fogDepth, 0.0, 1.0);\n\n float visibilityRange = x3d_Fog .visibilityRange;\n\n if (visibilityRange <= 0.0)\n return 1.0;\n\n float dV = length (x3d_Fog .matrix * vertex);\n\n if (dV >= visibilityRange)\n return 0.0;\n\n switch (x3d_Fog .type)\n {\n case x3d_LinearFog:\n {\n return (visibilityRange - dV) / visibilityRange;\n }\n case x3d_ExponentialFog:\n {\n return exp (-dV / (visibilityRange - dV));\n }\n default:\n {\n return 1.0;\n }\n }\n}\n\nvec3\ngetFogColor (const in vec3 color)\n{\n return mix (x3d_Fog .color, color, getFogInterpolant ());\n}\n\n// VOLUME_STYLES_UNIFORMS\n\nout vec4 x3d_FragColor;\n\n\nuniform int x3d_NumClipPlanes;\nuniform vec4 x3d_ClipPlane [x3d_MaxClipPlanes];\n\nvoid\nclip ()\n{\n for (int i = 0; i < x3d_MaxClipPlanes; ++ i)\n {\n if (i == x3d_NumClipPlanes)\n break;\n\n if (dot (vertex, x3d_ClipPlane [i] .xyz) - x3d_ClipPlane [i] .w < 0.0)\n discard;\n }\n}\n\nvec4\ngetTextureColor (in vec3 texCoord)\n{\n if (x3d_NumTextures == 0)\n discard;\n\n if (texCoord .s < 0.0 || texCoord .s > 1.0)\n discard;\n\n if (texCoord .t < 0.0 || texCoord .t > 1.0)\n discard;\n\n if (texCoord .p < 0.0 || texCoord .p > 1.0)\n discard;\n\n vec4 textureColor = texture (x3d_Texture3D [0], texCoord);\n\n // Apply volume styles.\n\n// VOLUME_STYLES_FUNCTIONS\n\n return textureColor;\n}\n\nvoid\nmain ()\n{\n clip ();\n\n x3d_FragColor = getTextureColor (texCoord .stp / texCoord .q);\n}\n"})),e("x_ite/Components/VolumeRendering/IsoSurfaceVolumeData",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],(function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.IsoSurfaceVolumeData),this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"contourStepSize",new e.SFFloat(0)),new t(s.inputOutput,"surfaceValues",new e.MFFloat),new t(s.inputOutput,"surfaceTolerance",new e.SFFloat(0)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"gradients",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"IsoSurfaceVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._gradients.addInterest("set_gradients__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addFieldInterest(this.getAppearance()._texture),this._contourStepSize.addInterest("update",this),this._surfaceValues.addInterest("update",this),this._surfaceTolerance.addInterest("update",this),this._renderStyle.addInterest("update",this),this.getAppearance()._texture=this._voxels,this.set_gradients__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},set_gradients__:function(){this.gradientsNode=a(s.X3DTexture3DNode,this._gradients)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){(o=e[t]).removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(t=0,n=this._renderStyle.length;t<n;++t){(o=a(s.X3DComposableVolumeRenderStyleNode,this._renderStyle[t]))&&e.push(o)}for(t=0,n=e.length;t<n;++t){var o;(o=e[t]).addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();a+="\n",a+="uniform float surfaceValues ["+this._surfaceValues.length+"];\n",a+="uniform float surfaceTolerance;\n";for(var l=0,u=this.renderStyleNodes.length;l<u;++l)a+=this.renderStyleNodes[l].getUniformsText();if(d+="\n",d+="\t// IsoSurfaceVolumeData\n",d+="\n",this.gradientsNode?(a+="\n",a+="uniform sampler3D gradients;\n",d+="\tif (length (texture (gradients, texCoord) .xyz * 2.0 - 1.0) < surfaceTolerance)\n",d+="\t\tdiscard;\n"):(a+="\n",a+="vec4\n",a+="getNormal (in vec3 texCoord)\n",a+="{\n",a+="\tvec4 offset = vec4 (1.0 / x3d_TextureSize, 0.0);\n",a+="\tfloat i0 = texture (x3d_Texture3D [0], texCoord + offset .xww) .r;\n",a+="\tfloat i1 = texture (x3d_Texture3D [0], texCoord - offset .xww) .r;\n",a+="\tfloat i2 = texture (x3d_Texture3D [0], texCoord + offset .wyw) .r;\n",a+="\tfloat i3 = texture (x3d_Texture3D [0], texCoord - offset .wyw) .r;\n",a+="\tfloat i4 = texture (x3d_Texture3D [0], texCoord + offset .wwz) .r;\n",a+="\tfloat i5 = texture (x3d_Texture3D [0], texCoord - offset .wwz) .r;\n",a+="\tvec3 n = vec3 (i1 - i0, i3 - i2, i5 - i4);\n",a+="\n",a+="\treturn vec4 (normalize (x3d_TextureNormalMatrix * n), length (n));\n",a+="}\n",d+="\tif (getNormal (texCoord) .w < surfaceTolerance)\n",d+="\t\tdiscard;\n"),d+="\n",d+="\tfloat intensity = textureColor .r;\n",d+="\n",1===this._surfaceValues.length){var h=Math.abs(this._contourStepSize.getValue());if(0===h)d+="\tif (intensity > surfaceValues [0])\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 (surfaceValues [0]), 1.0);\n",this.renderStyleNodes.length&&(d+=this.renderStyleNodes[0].getFunctionsText()),d+="\t}\n",d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n";else{for(var c=[],g=this._surfaceValues[0]-h;g>0;g-=h)c.unshift(g);c.push(this._surfaceValues[0]);for(g=this._surfaceValues[0]+h;g<1;g+=h)c.push(g);d+="\tif (false)\n",d+="\t{ }\n";for(l=surfaceValues_.length-1;l>=0;--l)d+="\telse if (intensity > "+c[l]+")\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 ("+c[l]+"), 1.0);\n",this.renderStyleNodes.length&&(d+=this.renderStyleNodes[0].getFunctionsText()),d+="\t}\n";d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n"}}else{d+="\tif (false)\n",d+="\t{ }\n";for(l=this._surfaceValues.length-1;l>=0;--l){if(d+="\telse if (intensity > surfaceValues ["+l+"])\n",d+="\t{\n",d+="\t\ttextureColor = vec4 (vec3 (surfaceValues ["+l+"]), 1.0);\n",this.renderStyleNodes.length){var f=Math.min(l,this.renderStyleNodes.length-1);d+=this.renderStyleNodes[f].getFunctionsText()}d+="\t}\n"}d+="\telse\n",d+="\t{\n",d+="\t\tdiscard;\n",d+="\t}\n",d+="\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var p=new r(this.getExecutionContext());p.setName("VolumeDataVertexShader"),p._url.push("data:x-shader/x-vertex,"+t),p.setup();var m=new r(this.getExecutionContext());m.setName("VolumeDataFragmentShader"),m._type="FRAGMENT",m._url.push("data:x-shader/x-fragment,"+n),m.setup();var _=new i(this.getExecutionContext());if(_.setName("VolumeDataShader"),_._language="GLSL",_._parts.push(p),_._parts.push(m),_.addUserDefinedField(s.inputOutput,"surfaceValues",this._surfaceValues.copy()),_.addUserDefinedField(s.inputOutput,"surfaceTolerance",this._surfaceTolerance.copy()),this.gradientsNode&&_.addUserDefinedField(s.inputOutput,"grandients",new e.SFNode(this.gradientsNode)),this.voxelsNode){var x=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());_.addUserDefinedField(s.inputOutput,"x3d_TextureSize",x)}else _.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);o.addShaderFields(_);for(l=0,u=this.renderStyleNodes.length;l<u;++l)this.renderStyleNodes[l].addShaderFields(_);return _}}),h})),e("x_ite/Components/VolumeRendering/ProjectionVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode","x_ite/Base/X3DConstants"],(function(e,t,n,o,i){"use strict";function r(e){o.call(this,e),this.addType(i.ProjectionVolumeStyle)}return r.prototype=Object.assign(Object.create(o.prototype),{constructor:r,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"type",new e.SFString("MAX")),new t(i.inputOutput,"intensityThreshold",new e.SFFloat(0))]),getTypeName:function(){return"ProjectionVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},addShaderFields:function(e){this._enabled.getValue()&&e.addUserDefinedField(i.inputOutput,"intensityThreshold_"+this.getId(),this._intensityThreshold.copy())},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";switch(e+="\n",e+="// ProjectionVolumeStyle\n",e+="\n",e+="uniform float intensityThreshold_"+this.getId()+";\n",e+="\n",e+="vec4\n",e+="getProjectionStyle_"+this.getId()+"(in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",this._type.getValue()){default:case"MAX":case"AVERAGE":e+="\tfloat projectionColor = 0.0;\n";break;case"MIN":e+="\tfloat projectionColor = 1.0;\n"}switch(e+="\tconst int samples = 32;\n",e+="\tvec3 step = normalize (x3d_TextureNormalMatrix * vec3 (0.0, 0.0, 1.0)) / float (samples);\n",e+="\tvec3 ray = texCoord - step * float (samples) * 0.5;\n",e+="\tbool first = false;\n",e+="\n",e+="\tfor (int i = 0; i < samples; ++ i, ray += step)\n",e+="\t{\n",e+="\t\tif (ray .s < 0.0 || ray .s > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .t < 0.0 || ray .t > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (ray .p < 0.0 || ray .p > 1.0)\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tfloat intensity = texture (x3d_Texture3D [0], ray) .r;\n",e+="\n",this._type.getValue()){default:case"MAX":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity <= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"MIN":e+="\t\tif (intensity < intensityThreshold_"+this.getId()+")\n",e+="\t\t\tcontinue;\n",e+="\n",e+="\t\tif (intensityThreshold_"+this.getId()+" > 0.0 && first)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tif (intensity >= projectionColor)\n",e+="\t\t{\n",e+="\t\t\tfirst = true;\n",e+="\t\t\tcontinue;\n",e+="\t\t}\n",e+="\n",e+="\t\tprojectionColor = intensity;\n";break;case"AVERAGE":e+="\t\tprojectionColor += intensity;\n"}return e+="\t}\n",e+="\n","AVERAGE"===this._type.getValue()&&(e+="\tprojectionColor /= float (samples);\n"),e+="\treturn vec4 (vec3 (projectionColor), originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ProjectionVolumeStyle\n",e+="\n",e+="\ttextureColor = getProjectionStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),r})),e("x_ite/Components/VolumeRendering/SegmentedVolumeData",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],(function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.SegmentedVolumeData),this.segmentIdentifiersNode=null,this.renderStyleNodes=[]}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"segmentEnabled",new e.MFBool),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"segmentIdentifiers",new e.SFNode),new t(s.inputOutput,"renderStyle",new e.MFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"SegmentedVolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._segmentIdentifiers.addInterest("set_segmentIdentifiers__",this),this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addFieldInterest(this.getAppearance()._texture),this._segmentEnabled.addInterest("update",this),this._segmentIdentifiers.addInterest("update",this),this._renderStyle.addInterest("update",this),this.getAppearance()._texture=this._voxels,this.set_segmentIdentifiers__(),this.set_renderStyle__(),this.set_voxels__(),this.update())},getSegmentEnabled:function(e){return!(e<this._segmentEnabled.length)||this._segmentEnabled[e]},set_segmentIdentifiers__:function(){this.segmentIdentifiersNode=a(s.X3DTexture3DNode,this._segmentIdentifiers)},set_renderStyle__:function(){for(var e=this.renderStyleNodes,t=0,n=e.length;t<n;++t){(o=e[t]).removeInterest("update",this),o.removeVolumeData(this)}e.length=0;for(t=0,n=this._renderStyle.length;t<n;++t){(o=a(s.X3DComposableVolumeRenderStyleNode,this._renderStyle[t]))&&e.push(o)}for(t=0,n=e.length;t<n;++t){var o;(o=e[t]).addInterest("update",this),o.addVolumeData(this)}},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();if(this.segmentIdentifiersNode?(a+="\n",a+="uniform sampler3D segmentIdentifiers;\n",d+="\n",d+="\n",d+="\tint segment = int (texture (segmentIdentifiers, texCoord) .r * 255.0);\n"):d+="\tint segment = 0;\n",this.renderStyleNodes.length){d+="\n",d+="\tswitch (segment)\n",d+="\t{\n";for(var l=0,u=this.renderStyleNodes.length;l<u;++l)d+="\t\tcase "+l+":\n",d+="\t\t{\n",this.getSegmentEnabled(l)?(a+=this.renderStyleNodes[l].getUniformsText(),d+=this.renderStyleNodes[l].getFunctionsText(),d+="\t\t\tbreak;\n"):d+="\t\t\tdiscard;\n",d+="\t\t}\n";d+="\t}\n"}n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var h=new r(this.getExecutionContext());h.setName("SegmentedVolumeDataVertexShader"),h._url.push("data:x-shader/x-vertex,"+t),h.setup();var c=new r(this.getExecutionContext());c.setName("SegmentedVolumeDataFragmentShader"),c._type="FRAGMENT",c._url.push("data:x-shader/x-fragment,"+n),c.setup();var g=new i(this.getExecutionContext());if(g.setName("SegmentedVolumeDataShader"),g._language="GLSL",g._parts.push(h),g._parts.push(c),this.voxelsNode){var f=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());g.addUserDefinedField(s.inputOutput,"x3d_TextureSize",f)}else g.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);this.segmentIdentifiersNode&&g.addUserDefinedField(s.inputOutput,"segmentIdentifiers",new e.SFNode(this.segmentIdentifiersNode)),o.addShaderFields(g);for(l=0,u=this.renderStyleNodes.length;l<u;++l)this.getSegmentEnabled(l)&&this.renderStyleNodes[l].addShaderFields(g);return g}}),h})),e("x_ite/Components/VolumeRendering/ShadedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ShadedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"lighting",new e.SFBool),new t(i.inputOutput,"shadows",new e.SFBool),new t(i.initializeOnly,"phaseFunction",new e.SFString("Henyey-Greenstein")),new t(i.inputOutput,"material",new e.SFNode),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ShadedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._material.addInterest("set_material__",this),this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_material__(),this.set_surfaceNormals__())},set_material__:function(){this.materialNode&&this.materialNode.removeInterest("addNodeEvent",this),this.materialNode=r(i.X3DMaterialNode,this._material),this.materialNode&&this.materialNode.addInterest("addNodeEvent",this)},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(this.materialNode&&(t.addUserDefinedField(i.inputOutput,"ambientIntensity_"+this.getId(),this.materialNode._ambientIntensity.copy()),t.addUserDefinedField(i.inputOutput,"diffuseColor_"+this.getId(),this.materialNode._diffuseColor.copy()),t.addUserDefinedField(i.inputOutput,"specularColor_"+this.getId(),this.materialNode._specularColor.copy()),t.addUserDefinedField(i.inputOutput,"emissiveColor_"+this.getId(),this.materialNode._emissiveColor.copy()),t.addUserDefinedField(i.inputOutput,"shininess_"+this.getId(),this.materialNode._shininess.copy()),t.addUserDefinedField(i.inputOutput,"transparency_"+this.getId(),this.materialNode._transparency.copy())),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// ShadedVolumeStyle\n",e+="\n",e+="uniform float ambientIntensity_"+this.getId()+";\n",e+="uniform vec3 diffuseColor_"+this.getId()+";\n",e+="uniform vec3 specularColor_"+this.getId()+";\n",e+="uniform vec3 emissiveColor_"+this.getId()+";\n",e+="uniform float shininess_"+this.getId()+";\n",e+="uniform float transparency_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="float\n",e+="getSpotFactor_"+this.getId()+" (const in float cutOffAngle, const in float beamWidth, const in vec3 L, const in vec3 d)\n",e+="{\n",e+="\tfloat spotAngle = acos (clamp (dot (-L, d), -1.0, 1.0));\n",e+="\n",e+="\tif (spotAngle >= cutOffAngle)\n",e+="\t\treturn 0.0;\n",e+="\telse if (spotAngle <= beamWidth)\n",e+="\t\treturn 1.0;\n",e+="\n",e+="\treturn (spotAngle - cutOffAngle) / (beamWidth - cutOffAngle);\n",e+="}\n",e+="\n",e+="vec4\n",e+="getShadedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec4 shadedColor = vec4 (0.0);\n",this._lighting.getValue()?(this.materialNode?(e+="\tvec3 diffuseFactor = diffuseColor_"+this.getId()+";\n",e+="\tvec3 ambientTerm = diffuseFactor * ambientIntensity_"+this.getId()+";\n",e+="\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):(e+="\tvec3 diffuseFactor = originalColor .rgb;\n",e+="\tvec3 ambientTerm = vec3 (0.0);\n",e+="\n",e+="\tshadedColor .a = originalColor .a;\n"),e+="\n",e+="\tvec3 N = surfaceNormal .xyz;\n",e+="\tvec3 V = normalize (-vertex); // normalized vector from point on geometry to viewer's position\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 vL = light .location - vertex; // Light to fragment\n",e+="\t\tfloat dL = length (light .matrix * vL);\n",e+="\t\tbool di = light .type == x3d_DirectionalLight;\n",e+="\n",e+="\t\tif (di || dL <= light .radius)\n",e+="\t\t{\n",e+="\t\t\tvec3 d = light .direction;\n",e+="\t\t\tvec3 c = light .attenuation;\n",e+="\t\t\tvec3 L = di ? -d : normalize (vL); // Normalized vector from point on geometry to light source i position.\n",e+="\t\t\tvec3 H = normalize (L + V); // Specular term\n",e+="\n",e+="\t\t\tfloat lightAngle = max (dot (N, L), 0.0); // Angle between normal and light ray.\n",e+="\t\t\tvec3 diffuseTerm = diffuseFactor * lightAngle;\n",e+="\t\t\tfloat specularFactor = shininess_"+this.getId()+" > 0.0 ? pow (max (dot (N, H), 0.0), shininess_"+this.getId()+" * 128.0) : 1.0;\n",e+="\t\t\tvec3 specularTerm = light .intensity * specularColor_"+this.getId()+" * specularFactor;\n",e+="\n",e+="\t\t\tfloat attenuationFactor = di ? 1.0 : 1.0 / max (c [0] + c [1] * dL + c [2] * (dL * dL), 1.0);\n",e+="\t\t\tfloat spotFactor = light .type == x3d_SpotLight ? getSpotFactor_"+this.getId()+" (light .cutOffAngle, light .beamWidth, L, d) : 1.0;\n",e+="\t\t\tfloat attenuationSpotFactor = attenuationFactor * spotFactor;\n",e+="\t\t\tvec3 ambientColor = light .ambientIntensity * ambientTerm;\n",e+="\t\t\tvec3 diffuseSpecularColor = light .intensity * (diffuseTerm + specularTerm);\n",e+="\n",e+="\t\t\tshadedColor .rgb += attenuationSpotFactor * light .color * (ambientColor + diffuseSpecularColor);\n",e+="\t\t}\n",e+="\n",e+="\t\tshadedColor .rgb += emissiveColor_"+this.getId()+";\n",e+="\t\tshadedColor .rgb = getFogColor (shadedColor .rgb);\n",e+="\t}\n"):this.materialNode?(e+="\tshadedColor .rgb = diffuseColor_"+this.getId()+";\n",e+="\tshadedColor .a = originalColor .a * (1.0 - transparency_"+this.getId()+");\n"):e+="\tshadedColor = originalColor;\n",e+="\n",e+="\treturn shadedColor;\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ShadedVolumeStyle\n",e+="\n",e+="\ttextureColor = getShadedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.SilhouetteEnhancementVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"silhouetteRetainedOpacity",new e.SFFloat(1)),new t(i.inputOutput,"silhouetteBoundaryOpacity",new e.SFFloat(0)),new t(i.inputOutput,"silhouetteSharpness",new e.SFFloat(.5)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"SilhouetteEnhancementVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"silhouetteRetainedOpacity_"+this.getId(),this._silhouetteRetainedOpacity.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteBoundaryOpacity_"+this.getId(),this._silhouetteBoundaryOpacity.copy()),t.addUserDefinedField(i.inputOutput,"silhouetteSharpness_"+this.getId(),this._silhouetteSharpness.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="uniform float silhouetteRetainedOpacity_"+this.getId()+";\n",e+="uniform float silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="uniform float silhouetteSharpness_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getSilhouetteEnhancementStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\t\n",e+="\tfloat silhouetteRetainedOpacity = silhouetteRetainedOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteBoundaryOpacity = silhouetteBoundaryOpacity_"+this.getId()+";\n",e+="\tfloat silhouetteSharpness = silhouetteSharpness_"+this.getId()+";\n",e+="\n",e+="\treturn vec4 (originalColor .rgb, originalColor .a * (silhouetteRetainedOpacity + silhouetteBoundaryOpacity * pow (1.0 - abs (dot (surfaceNormal .xyz, normalize (vertex))), silhouetteSharpness)));\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// SilhouetteEnhancementVolumeStyle\n",e+="\n",e+="\ttextureColor = getSilhouetteEnhancementStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/ToneMappedVolumeStyle",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Base/X3DConstants","x_ite/Base/X3DCast"],(function(e,t,n,o,i,r){"use strict";function s(e){o.call(this,e),this.addType(i.ToneMappedVolumeStyle)}return s.prototype=Object.assign(Object.create(o.prototype),{constructor:s,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(i.inputOutput,"metadata",new e.SFNode),new t(i.inputOutput,"enabled",new e.SFBool(!0)),new t(i.inputOutput,"coolColor",new e.SFColorRGBA(0,0,1,0)),new t(i.inputOutput,"warmColor",new e.SFColorRGBA(1,1,0,0)),new t(i.inputOutput,"surfaceNormals",new e.SFNode)]),getTypeName:function(){return"ToneMappedVolumeStyle"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"renderStyle"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._surfaceNormals.addInterest("set_surfaceNormals__",this),this.set_surfaceNormals__())},set_surfaceNormals__:function(){this.surfaceNormalsNode=r(i.X3DTexture3DNode,this._surfaceNormals)},addShaderFields:function(t){this._enabled.getValue()&&(t.addUserDefinedField(i.inputOutput,"coolColor_"+this.getId(),this._coolColor.copy()),t.addUserDefinedField(i.inputOutput,"warmColor_"+this.getId(),this._warmColor.copy()),this.surfaceNormalsNode&&t.addUserDefinedField(i.inputOutput,"surfaceNormals_"+this.getId(),new e.SFNode(this.surfaceNormalsNode)))},getUniformsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="// ToneMappedVolumeStyle\n",e+="\n",e+="uniform vec4 coolColor_"+this.getId()+";\n",e+="uniform vec4 warmColor_"+this.getId()+";\n",e+=this.getNormalText(this.surfaceNormalsNode),e+="\n",e+="vec4\n",e+="getToneMappedStyle_"+this.getId()+" (in vec4 originalColor, in vec3 texCoord)\n",e+="{\n",e+="\tvec4 surfaceNormal = getNormal_"+this.getId()+" (texCoord);\n",e+="\n",e+="\tif (surfaceNormal .w == 0.0)\n",e+="\t\treturn vec4 (0.0);\n",e+="\n",e+="\tvec3 toneColor = vec3 (0.0);\n",e+="\tvec3 coolColor = coolColor_"+this.getId()+" .rgb;\n",e+="\tvec3 warmColor = warmColor_"+this.getId()+" .rgb;\n",e+="\n",e+="\tfor (int i = 0; i < x3d_MaxLights; ++ i)\n",e+="\t{\n",e+="\t\tif (i == x3d_NumLights)\n",e+="\t\t\tbreak;\n",e+="\n",e+="\t\tx3d_LightSourceParameters light = x3d_LightSource [i];\n",e+="\n",e+="\t\tvec3 L = light .type == x3d_DirectionalLight ? -light .direction : normalize (light .location - vertex);\n",e+="\t\tfloat colorFactor = (1.0 + dot (L, surfaceNormal .xyz)) * 0.5;\n",e+="\n",e+="\t\ttoneColor += mix (warmColor .rgb, coolColor .rgb, colorFactor);\n",e+="\t}\n",e+="\n",e+="\treturn vec4 (toneColor, originalColor .a);\n",e+="}\n"},getFunctionsText:function(){if(!this._enabled.getValue())return"";var e="";return e+="\n",e+="\t// ToneMappedVolumeStyle\n",e+="\n",e+="\ttextureColor = getToneMappedStyle_"+this.getId()+" (textureColor, texCoord);\n"}}),s})),e("x_ite/Components/VolumeRendering/VolumeData",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Base/X3DConstants","x_ite/Base/X3DCast","text!x_ite/Browser/VolumeRendering/VolumeStyle.vs","text!x_ite/Browser/VolumeRendering/VolumeStyle.fs","x_ite/DEBUG"],(function(e,t,n,o,i,r,s,a,d,l,u){"use strict";function h(e){o.call(this,e),this.addType(s.VolumeData),this.renderStyleNode=null}return h.prototype=Object.assign(Object.create(o.prototype),{constructor:h,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new n([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"dimensions",new e.SFVec3f(1,1,1)),new t(s.inputOutput,"visible",new e.SFBool(!0)),new t(s.inputOutput,"bboxDisplay",new e.SFBool),new t(s.initializeOnly,"bboxCenter",new e.SFVec3f(0,0,0)),new t(s.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(s.inputOutput,"renderStyle",new e.SFNode),new t(s.inputOutput,"voxels",new e.SFNode)]),getTypeName:function(){return"VolumeData"},getComponentName:function(){return"VolumeRendering"},getContainerField:function(){return"children"},initialize:function(){o.prototype.initialize.call(this),this.getBrowser().getContext().getVersion()<2||(this._renderStyle.addInterest("set_renderStyle__",this),this._voxels.addInterest("set_voxels__",this),this._voxels.addFieldInterest(this.getAppearance()._texture),this._renderStyle.addInterest("update",this),this.getAppearance()._texture=this._voxels,this.set_renderStyle__(),this.set_voxels__(),this.update())},set_renderStyle__:function(){this.renderStyleNode&&(this.renderStyleNode.removeInterest("update",this),this.renderStyleNode.removeVolumeData(this)),this.renderStyleNode=a(s.X3DVolumeRenderStyleNode,this._renderStyle),this.renderStyleNode&&(this.renderStyleNode.addInterest("update",this),this.renderStyleNode.addVolumeData(this))},set_voxels__:function(){this.voxelsNode&&this.voxelsNode.removeInterest("set_textureSize__",this),this.voxelsNode=a(s.X3DTexture3DNode,this._voxels),this.voxelsNode&&(this.voxelsNode.addInterest("set_textureSize__",this),this.set_textureSize__())},set_textureSize__:function(){try{var e=this.getShader().getField("x3d_TextureSize");e.x=this.voxelsNode.getWidth(),e.y=this.voxelsNode.getHeight(),e.z=this.voxelsNode.getDepth()}catch(e){u&&console.log(e.message)}},update:function(){this.setShader(this.createShader(d,l))},createShader:function(t,n){var o=this.getBrowser().getDefaultVolumeStyle(),a=o.getUniformsText(),d=o.getFunctionsText();this.renderStyleNode&&(a+=this.renderStyleNode.getUniformsText(),d+=this.renderStyleNode.getFunctionsText()),n=(n=n.replace(/\/\/ VOLUME_STYLES_UNIFORMS\n/,a)).replace(/\/\/ VOLUME_STYLES_FUNCTIONS\n/,d);var l=new r(this.getExecutionContext());l.setName("VolumeDataVertexShader"),l._url.push("data:x-shader/x-vertex,"+t),l.setup();var u=new r(this.getExecutionContext());u.setName("VolumeDataFragmentShader"),u._type="FRAGMENT",u._url.push("data:x-shader/x-fragment,"+n),u.setup();var h=new i(this.getExecutionContext());if(h.setName("VolumeDataShader"),h._language="GLSL",h._parts.push(l),h._parts.push(u),this.voxelsNode){var c=new e.SFVec3f(this.voxelsNode.getWidth(),this.voxelsNode.getHeight(),this.voxelsNode.getDepth());h.addUserDefinedField(s.inputOutput,"x3d_TextureSize",c)}else h.addUserDefinedField(s.inputOutput,"x3d_TextureSize",new e.SFVec3f);return o.addShaderFields(h),this.renderStyleNode&&this.renderStyleNode.addShaderFields(h),h}}),h})),e(t.getComponentUrl("volume-rendering"),["x_ite/Components","x_ite/Browser/VolumeRendering/X3DVolumeRenderingContext","x_ite/Components/VolumeRendering/BlendedVolumeStyle","x_ite/Components/VolumeRendering/BoundaryEnhancementVolumeStyle","x_ite/Components/VolumeRendering/CartoonVolumeStyle","x_ite/Components/VolumeRendering/ComposedVolumeStyle","x_ite/Components/VolumeRendering/EdgeEnhancementVolumeStyle","x_ite/Components/VolumeRendering/IsoSurfaceVolumeData","x_ite/Components/VolumeRendering/OpacityMapVolumeStyle","x_ite/Components/VolumeRendering/ProjectionVolumeStyle","x_ite/Components/VolumeRendering/SegmentedVolumeData","x_ite/Components/VolumeRendering/ShadedVolumeStyle","x_ite/Components/VolumeRendering/SilhouetteEnhancementVolumeStyle","x_ite/Components/VolumeRendering/ToneMappedVolumeStyle","x_ite/Components/VolumeRendering/VolumeData","x_ite/Components/VolumeRendering/X3DComposableVolumeRenderStyleNode","x_ite/Components/VolumeRendering/X3DVolumeDataNode","x_ite/Components/VolumeRendering/X3DVolumeRenderStyleNode",t.getComponentUrl("cad-geometry"),t.getComponentUrl("texturing-3d")],(function(e,t,n,o,i,r,s,a,d,l,u,h,c,g,f,p,m,_){"use strict";e.addComponent({name:"VolumeRendering",types:{BlendedVolumeStyle:n,BoundaryEnhancementVolumeStyle:o,CartoonVolumeStyle:i,ComposedVolumeStyle:r,EdgeEnhancementVolumeStyle:s,IsoSurfaceVolumeData:a,OpacityMapVolumeStyle:d,ProjectionVolumeStyle:l,SegmentedVolumeData:u,ShadedVolumeStyle:h,SilhouetteEnhancementVolumeStyle:c,ToneMappedVolumeStyle:g,VolumeData:f},abstractTypes:{X3DComposableVolumeRenderStyleNode:p,X3DVolumeDataNode:m,X3DVolumeRenderStyleNode:_},browser:t})}))}();
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var module = { }, exports, process;
|
|
5
5
|
|
|
6
6
|
const
|
|
7
|
-
define = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
8
|
-
require = window [Symbol .for ("X_ITE.X3D-5.0.
|
|
7
|
+
define = window [Symbol .for ("X_ITE.X3D-5.0.2")] .define,
|
|
8
|
+
require = window [Symbol .for ("X_ITE.X3D-5.0.2")] .require;
|
|
9
9
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
10
10
|
*******************************************************************************
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){const t=window[Symbol.for("X_ITE.X3D-5.0.
|
|
1
|
+
!function(){const t=window[Symbol.for("X_ITE.X3D-5.0.2")].define,e=window[Symbol.for("X_ITE.X3D-5.0.2")].require;t("x_ite/Components/X_ITE/BlendMode",["x_ite/Fields","x_ite/Base/X3DFieldDefinition","x_ite/Base/FieldDefinitionArray","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Rendering/TraverseType","x_ite/Base/X3DConstants"],(function(t,e,o,i,s,a){"use strict";function n(t){i.call(this,t),this.addType(a.BlendMode),this.factorTypes=new Map,this.equationTypes=new Map}return n.prototype=Object.assign(Object.create(i.prototype),{constructor:n,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new o([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.inputOutput,"blendColor",new t.SFColorRGBA),new e(a.inputOutput,"sourceColorFactor",new t.SFString("SRC_ALPHA")),new e(a.inputOutput,"sourceAlphaFactor",new t.SFString("ONE")),new e(a.inputOutput,"destinationColorFactor",new t.SFString("ONE_MINUS_SRC_ALPHA")),new e(a.inputOutput,"destinationAlphaFactor",new t.SFString("ONE_MINUS_SRC_ALPHA")),new e(a.inputOutput,"colorEquation",new t.SFString("FUNC_ADD")),new e(a.inputOutput,"alphaEquation",new t.SFString("FUNC_ADD"))]),getTypeName:function(){return"BlendMode"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"blendMode"},initialize:function(){i.prototype.initialize.call(this);const t=this.getBrowser().getContext(),e=t.getExtension("EXT_blend_minmax");this.factorTypes.set("ZERO",t.ZERO),this.factorTypes.set("ONE",t.ONE),this.factorTypes.set("SRC_COLOR",t.SRC_COLOR),this.factorTypes.set("ONE_MINUS_SRC_COLOR",t.ONE_MINUS_SRC_COLOR),this.factorTypes.set("DST_COLOR",t.DST_COLOR),this.factorTypes.set("ONE_MINUS_DST_COLOR",t.ONE_MINUS_DST_COLOR),this.factorTypes.set("SRC_ALPHA",t.SRC_ALPHA),this.factorTypes.set("ONE_MINUS_SRC_ALPHA",t.ONE_MINUS_SRC_ALPHA),this.factorTypes.set("DST_ALPHA",t.DST_ALPHA),this.factorTypes.set("ONE_MINUS_DST_ALPHA",t.ONE_MINUS_DST_ALPHA),this.factorTypes.set("SRC_ALPHA_SATURATE",t.SRC_ALPHA_SATURATE),this.factorTypes.set("CONSTANT_COLOR",t.CONSTANT_COLOR),this.factorTypes.set("ONE_MINUS_CONSTANT_COLOR",t.ONE_MINUS_CONSTANT_COLOR),this.factorTypes.set("CONSTANT_ALPHA",t.CONSTANT_ALPHA),this.factorTypes.set("ONE_MINUS_CONSTANT_ALPHA",t.ONE_MINUS_CONSTANT_ALPHA),this.equationTypes.set("FUNC_ADD",t.FUNC_ADD),this.equationTypes.set("FUNC_SUBTRACT",t.FUNC_SUBTRACT),this.equationTypes.set("FUNC_REVERSE_SUBTRACT",t.FUNC_REVERSE_SUBTRACT),this.equationTypes.set("MIN",t.MIN||e&&e.MIN_EXT),this.equationTypes.set("MAX",t.MAX||e&&e.MAX_EXT),this._sourceColorFactor.addInterest("set_sourceColorFactor__",this),this._sourceAlphaFactor.addInterest("set_sourceAlphaFactor__",this),this._destinationColorFactor.addInterest("set_destinationColorFactor__",this),this._destinationAlphaFactor.addInterest("set_destinationAlphaFactor__",this),this._colorEquation.addInterest("set_colorEquation__",this),this._alphaEquation.addInterest("set_alphaEquation__",this),this.set_sourceColorFactor__(),this.set_sourceAlphaFactor__(),this.set_destinationColorFactor__(),this.set_destinationAlphaFactor__(),this.set_colorEquation__(),this.set_alphaEquation__()},set_sourceColorFactor__:function(){this.sourceColorFactorType=this.factorTypes.get(this._sourceColorFactor.getValue()),void 0===this.sourceColorFactorType&&(this.sourceColorFactorType=this.factorTypes.get("SRC_ALPHA"))},set_sourceAlphaFactor__:function(){this.sourceAlphaFactorType=this.factorTypes.get(this._sourceAlphaFactor.getValue()),void 0===this.sourceAlphaFactorType&&(this.sourceAlphaFactorType=this.factorTypes.get("ONE"))},set_destinationColorFactor__:function(){this.destinationColorFactorType=this.factorTypes.get(this._destinationColorFactor.getValue()),void 0===this.destinationColorFactorType&&(this.destinationColorFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_destinationAlphaFactor__:function(){this.destinationAlphaFactorType=this.factorTypes.get(this._destinationAlphaFactor.getValue()),void 0===this.destinationAlphaFactorType&&(this.destinationAlphaFactorType=this.factorTypes.get("ONE_MINUS_SRC_ALPHA"))},set_colorEquation__:function(){this.colorEquationType=this.equationTypes.get(this._colorEquation.getValue()),void 0===this.colorEquationType&&(this.colorEquationType=this.equationTypes.get("FUNC_ADD"))},set_alphaEquation__:function(){this.alphaEquationType=this.equationTypes.get(this._alphaEquation.getValue()),void 0===this.alphaEquationType&&(this.alphaEquationType=this.equationTypes.get("FUNC_ADD"))},enable:function(t){const e=this._blendColor.getValue();t.blendColor(e.r,e.g,e.b,e.a),t.blendFuncSeparate(this.sourceColorFactorType,this.destinationColorFactorType,this.sourceAlphaFactorType,this.destinationAlphaFactorType),t.blendEquationSeparate(this.colorEquationType,this.alphaEquationType)},disable:function(t){t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD)}}),n})),t(e.getComponentUrl("x_ite"),["x_ite/Components","x_ite/Components/X_ITE/BlendMode"],(function(t,e){"use strict";t.addComponent({name:"X_ITE",types:{BlendMode:e},abstractTypes:{}})}))}();
|