ccbc2d3829fd403119cfef60f9f2e59dba0797115b487c4bf134d5ffe2e02dac.json 11 KB

1
  1. {"ast":null,"code":"import { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes.js\";\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock.js\";\n/**\n * Defines a block used to teleport a value to an endpoint\n */\nexport class NodeRenderGraphTeleportInBlock extends NodeRenderGraphBlock {\n /** Gets the list of attached endpoints */\n get endpoints() {\n return this._endpoints;\n }\n /**\n * Create a new NodeRenderGraphTeleportInBlock\n * @param name defines the block name\n * @param frameGraph defines the hosting frame graph\n * @param scene defines the hosting scene\n */\n constructor(name, frameGraph, scene) {\n super(name, frameGraph, scene);\n this._endpoints = [];\n this._isTeleportIn = true;\n this.registerInput(\"input\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphTeleportInBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\n }\n _dumpCode(uniqueNames, alreadyDumped) {\n let codeString = super._dumpCode(uniqueNames, alreadyDumped);\n for (const endpoint of this.endpoints) {\n if (alreadyDumped.indexOf(endpoint) === -1) {\n codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n return codeString;\n }\n /**\n * Checks if the current block is an ancestor of a given type\n * @param type defines the potential type to check\n * @returns true if block is a descendant\n */\n isAnAncestorOfType(type) {\n if (this.getClassName() === type) {\n return true;\n }\n for (const endpoint of this.endpoints) {\n if (endpoint.isAnAncestorOfType(type)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Checks if the current block is an ancestor of a given block\n * @param block defines the potential descendant block to check\n * @returns true if block is a descendant\n */\n isAnAncestorOf(block) {\n for (const endpoint of this.endpoints) {\n if (endpoint === block) {\n return true;\n }\n if (endpoint.isAnAncestorOf(block)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Get the first descendant using a predicate\n * @param predicate defines the predicate to check\n * @returns descendant or null if none found\n */\n getDescendantOfPredicate(predicate) {\n if (predicate(this)) {\n return this;\n }\n for (const endpoint of this.endpoints) {\n const descendant = endpoint.getDescendantOfPredicate(predicate);\n if (descendant) {\n return descendant;\n }\n }\n return null;\n }\n /**\n * Add an enpoint to this block\n * @param endpoint define the endpoint to attach to\n */\n attachToEndpoint(endpoint) {\n endpoint.detach();\n this._endpoints.push(endpoint);\n endpoint._entryPoint = this;\n endpoint._outputs[0]._typeConnectionSource = this._inputs[0];\n endpoint._tempEntryPointUniqueId = null;\n endpoint.name = \"> \" + this.name;\n }\n /**\n * Remove enpoint from this block\n * @param endpoint define the endpoint to remove\n */\n detachFromEndpoint(endpoint) {\n const index = this._endpoints.indexOf(endpoint);\n if (index !== -1) {\n this._endpoints.splice(index, 1);\n endpoint._outputs[0]._typeConnectionSource = null;\n endpoint._entryPoint = null;\n }\n }\n /**\n * Release resources\n */\n dispose() {\n super.dispose();\n for (const endpoint of this._endpoints) {\n this.detachFromEndpoint(endpoint);\n }\n this._endpoints = [];\n }\n}\nRegisterClass(\"BABYLON.NodeRenderGraphTeleportInBlock\", NodeRenderGraphTeleportInBlock);","map":{"version":3,"names":["RegisterClass","NodeRenderGraphBlockConnectionPointTypes","NodeRenderGraphBlock","NodeRenderGraphTeleportInBlock","endpoints","_endpoints","constructor","name","frameGraph","scene","_isTeleportIn","registerInput","AutoDetect","getClassName","input","_inputs","_dumpCode","uniqueNames","alreadyDumped","codeString","endpoint","indexOf","isAnAncestorOfType","type","isAnAncestorOf","block","getDescendantOfPredicate","predicate","descendant","attachToEndpoint","detach","push","_entryPoint","_outputs","_typeConnectionSource","_tempEntryPointUniqueId","detachFromEndpoint","index","splice","dispose"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/FrameGraph/Node/Blocks/Teleport/teleportInBlock.js"],"sourcesContent":["import { RegisterClass } from \"../../../../Misc/typeStore.js\";\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes.js\";\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock.js\";\n/**\n * Defines a block used to teleport a value to an endpoint\n */\nexport class NodeRenderGraphTeleportInBlock extends NodeRenderGraphBlock {\n /** Gets the list of attached endpoints */\n get endpoints() {\n return this._endpoints;\n }\n /**\n * Create a new NodeRenderGraphTeleportInBlock\n * @param name defines the block name\n * @param frameGraph defines the hosting frame graph\n * @param scene defines the hosting scene\n */\n constructor(name, frameGraph, scene) {\n super(name, frameGraph, scene);\n this._endpoints = [];\n this._isTeleportIn = true;\n this.registerInput(\"input\", NodeRenderGraphBlockConnectionPointTypes.AutoDetect);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"NodeRenderGraphTeleportInBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\n }\n _dumpCode(uniqueNames, alreadyDumped) {\n let codeString = super._dumpCode(uniqueNames, alreadyDumped);\n for (const endpoint of this.endpoints) {\n if (alreadyDumped.indexOf(endpoint) === -1) {\n codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);\n }\n }\n return codeString;\n }\n /**\n * Checks if the current block is an ancestor of a given type\n * @param type defines the potential type to check\n * @returns true if block is a descendant\n */\n isAnAncestorOfType(type) {\n if (this.getClassName() === type) {\n return true;\n }\n for (const endpoint of this.endpoints) {\n if (endpoint.isAnAncestorOfType(type)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Checks if the current block is an ancestor of a given block\n * @param block defines the potential descendant block to check\n * @returns true if block is a descendant\n */\n isAnAncestorOf(block) {\n for (const endpoint of this.endpoints) {\n if (endpoint === block) {\n return true;\n }\n if (endpoint.isAnAncestorOf(block)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Get the first descendant using a predicate\n * @param predicate defines the predicate to check\n * @returns descendant or null if none found\n */\n getDescendantOfPredicate(predicate) {\n if (predicate(this)) {\n return this;\n }\n for (const endpoint of this.endpoints) {\n const descendant = endpoint.getDescendantOfPredicate(predicate);\n if (descendant) {\n return descendant;\n }\n }\n return null;\n }\n /**\n * Add an enpoint to this block\n * @param endpoint define the endpoint to attach to\n */\n attachToEndpoint(endpoint) {\n endpoint.detach();\n this._endpoints.push(endpoint);\n endpoint._entryPoint = this;\n endpoint._outputs[0]._typeConnectionSource = this._inputs[0];\n endpoint._tempEntryPointUniqueId = null;\n endpoint.name = \"> \" + this.name;\n }\n /**\n * Remove enpoint from this block\n * @param endpoint define the endpoint to remove\n */\n detachFromEndpoint(endpoint) {\n const index = this._endpoints.indexOf(endpoint);\n if (index !== -1) {\n this._endpoints.splice(index, 1);\n endpoint._outputs[0]._typeConnectionSource = null;\n endpoint._entryPoint = null;\n }\n }\n /**\n * Release resources\n */\n dispose() {\n super.dispose();\n for (const endpoint of this._endpoints) {\n this.detachFromEndpoint(endpoint);\n }\n this._endpoints = [];\n }\n}\nRegisterClass(\"BABYLON.NodeRenderGraphTeleportInBlock\", NodeRenderGraphTeleportInBlock);\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA+B;AAC7D,SAASC,wCAAwC,QAAQ,qCAAqC;AAC9F,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE;AACA;AACA;AACA,OAAO,MAAMC,8BAA8B,SAASD,oBAAoB,CAAC;EACrE;EACA,IAAIE,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,UAAU;EAC1B;EACA;AACJ;AACA;AACA;AACA;AACA;EACIC,WAAWA,CAACC,IAAI,EAAEC,UAAU,EAAEC,KAAK,EAAE;IACjC,KAAK,CAACF,IAAI,EAAEC,UAAU,EAAEC,KAAK,CAAC;IAC9B,IAAI,CAACJ,UAAU,GAAG,EAAE;IACpB,IAAI,CAACK,aAAa,GAAG,IAAI;IACzB,IAAI,CAACC,aAAa,CAAC,OAAO,EAAEV,wCAAwC,CAACW,UAAU,CAAC;EACpF;EACA;AACJ;AACA;AACA;EACIC,YAAYA,CAAA,E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