{"ast":null,"code":"import { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Block used to replace a color by another one\n */\nexport class GeometryReplaceColorBlock extends NodeGeometryBlock {\n /**\n * Creates a new GeometryReplaceColorBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"reference\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"distance\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\n this.registerInput(\"replacement\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._linkConnectionTypes(0, 1);\n this._linkConnectionTypes(0, 3);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryReplaceColorBlock\";\n }\n /**\n * Gets the value input component\n */\n get value() {\n return this._inputs[0];\n }\n /**\n * Gets the reference input component\n */\n get reference() {\n return this._inputs[1];\n }\n /**\n * Gets the distance input component\n */\n get distance() {\n return this._inputs[2];\n }\n /**\n * Gets the replacement input component\n */\n get replacement() {\n return this._inputs[3];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock() {\n if (!this.value.isConnected || !this.reference.isConnected || !this.replacement.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = state => {\n const value = this.value.getConnectedValue(state);\n const reference = this.reference.getConnectedValue(state);\n const distance = this.distance.getConnectedValue(state);\n const replacement = this.replacement.getConnectedValue(state);\n if (value.subtract(reference).length() < distance) {\n return replacement;\n } else {\n return value;\n }\n };\n return this;\n }\n}\nRegisterClass(\"BABYLON.GeometryReplaceColorBlock\", GeometryReplaceColorBlock);","map":{"version":3,"names":["RegisterClass","NodeGeometryBlockConnectionPointTypes","NodeGeometryBlock","GeometryReplaceColorBlock","constructor","name","registerInput","AutoDetect","Float","registerOutput","BasedOnInput","_outputs","_typeConnectionSource","_inputs","_linkConnectionTypes","excludedConnectionPointTypes","push","Matrix","getClassName","value","reference","distance","replacement","output","_buildBlock","isConnected","_storedFunction","_storedValue","state","getConnectedValue","subtract","length"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryReplaceColorBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\n/**\n * Block used to replace a color by another one\n */\nexport class GeometryReplaceColorBlock extends NodeGeometryBlock {\n /**\n * Creates a new GeometryReplaceColorBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"reference\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerInput(\"distance\", NodeGeometryBlockConnectionPointTypes.Float, true, 0);\n this.registerInput(\"replacement\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._linkConnectionTypes(0, 1);\n this._linkConnectionTypes(0, 3);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\n this._inputs[3].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryReplaceColorBlock\";\n }\n /**\n * Gets the value input component\n */\n get value() {\n return this._inputs[0];\n }\n /**\n * Gets the reference input component\n */\n get reference() {\n return this._inputs[1];\n }\n /**\n * Gets the distance input component\n */\n get distance() {\n return this._inputs[2];\n }\n /**\n * Gets the replacement input component\n */\n get replacement() {\n return this._inputs[3];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock() {\n if (!this.value.isConnected || !this.reference.isConnected || !this.replacement.isConnected) {\n this.output._storedFunction = null;\n this.output._storedValue = null;\n return;\n }\n this.output._storedFunction = (state) => {\n const value = this.value.getConnectedValue(state);\n const reference = this.reference.getConnectedValue(state);\n const distance = this.distance.getConnectedValue(state);\n const replacement = this.replacement.getConnectedValue(state);\n if (value.subtract(reference).length() < distance) {\n return replacement;\n }\n else {\n return value;\n }\n };\n return this;\n }\n}\nRegisterClass(\"BABYLON.GeometryReplaceColorBlock\", GeometryReplaceColorBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,qCAAqC,QAAQ,8CAA8C;AACpG,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D;AACA;AACA;AACA,O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