125768512b392423650bdb95e0fa9dc60b3fd52fd2e5ea4851313944e32af754.json 11 KB

1
  1. {"ast":null,"code":"import { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\n/**\n * Block used to get information about a geometry\n */\nexport class GeometryInfoBlock extends NodeGeometryBlock {\n /**\n * Create a new GeometryInfoBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\n this.registerOutput(\"id\", NodeGeometryBlockConnectionPointTypes.Int);\n this.registerOutput(\"collectionId\", NodeGeometryBlockConnectionPointTypes.Int);\n this.registerOutput(\"verticesCount\", NodeGeometryBlockConnectionPointTypes.Int);\n this.registerOutput(\"facesCount\", NodeGeometryBlockConnectionPointTypes.Int);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryInfoBlock\";\n }\n /**\n * Gets the geometry input component\n */\n get geometry() {\n return this._inputs[0];\n }\n /**\n * Gets the geometry output component\n */\n get output() {\n return this._outputs[0];\n }\n /**\n * Gets the id output component\n */\n get id() {\n return this._outputs[1];\n }\n /**\n * Gets the collectionId output component\n */\n get collectionId() {\n return this._outputs[2];\n }\n /**\n * Gets the verticesCount output component\n */\n get verticesCount() {\n return this._outputs[3];\n }\n /**\n * Gets the facesCount output component\n */\n get facesCount() {\n return this._outputs[4];\n }\n _buildBlock() {\n if (!this.geometry.isConnected) {\n this.id._storedValue = 0;\n this.collectionId._storedValue = 0;\n this.verticesCount._storedValue = 0;\n this.facesCount._storedValue = 0;\n this.output._storedValue = 0;\n this.id._storedFunction = null;\n this.collectionId._storedFunction = null;\n this.verticesCount._storedFunction = null;\n this.facesCount._storedFunction = null;\n this.output._storedFunction = null;\n return;\n }\n this.output._storedFunction = state => {\n this._currentVertexData = this.geometry.getConnectedValue(state);\n return this._currentVertexData;\n };\n this.id._storedFunction = state => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.uniqueId;\n };\n this.collectionId._storedFunction = state => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.metadata ? this._currentVertexData.metadata.collectionId : 0;\n };\n this.verticesCount._storedFunction = state => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.positions ? this._currentVertexData.positions.length / 3 : 0;\n };\n this.facesCount._storedFunction = state => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.indices ? this._currentVertexData.indices.length / 3 : 0;\n };\n }\n}\nRegisterClass(\"BABYLON.GeometryInfoBlock\", GeometryInfoBlock);","map":{"version":3,"names":["NodeGeometryBlock","RegisterClass","NodeGeometryBlockConnectionPointTypes","GeometryInfoBlock","constructor","name","registerInput","Geometry","registerOutput","Int","getClassName","geometry","_inputs","output","_outputs","id","collectionId","verticesCount","facesCount","_buildBlock","isConnected","_storedValue","_storedFunction","state","_currentVertexData","getConnectedValue","uniqueId","metadata","positions","length","indices"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/geometryInfoBlock.js"],"sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes.js\";\n/**\n * Block used to get information about a geometry\n */\nexport class GeometryInfoBlock extends NodeGeometryBlock {\n /**\n * Create a new GeometryInfoBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\n this.registerOutput(\"id\", NodeGeometryBlockConnectionPointTypes.Int);\n this.registerOutput(\"collectionId\", NodeGeometryBlockConnectionPointTypes.Int);\n this.registerOutput(\"verticesCount\", NodeGeometryBlockConnectionPointTypes.Int);\n this.registerOutput(\"facesCount\", NodeGeometryBlockConnectionPointTypes.Int);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"GeometryInfoBlock\";\n }\n /**\n * Gets the geometry input component\n */\n get geometry() {\n return this._inputs[0];\n }\n /**\n * Gets the geometry output component\n */\n get output() {\n return this._outputs[0];\n }\n /**\n * Gets the id output component\n */\n get id() {\n return this._outputs[1];\n }\n /**\n * Gets the collectionId output component\n */\n get collectionId() {\n return this._outputs[2];\n }\n /**\n * Gets the verticesCount output component\n */\n get verticesCount() {\n return this._outputs[3];\n }\n /**\n * Gets the facesCount output component\n */\n get facesCount() {\n return this._outputs[4];\n }\n _buildBlock() {\n if (!this.geometry.isConnected) {\n this.id._storedValue = 0;\n this.collectionId._storedValue = 0;\n this.verticesCount._storedValue = 0;\n this.facesCount._storedValue = 0;\n this.output._storedValue = 0;\n this.id._storedFunction = null;\n this.collectionId._storedFunction = null;\n this.verticesCount._storedFunction = null;\n this.facesCount._storedFunction = null;\n this.output._storedFunction = null;\n return;\n }\n this.output._storedFunction = (state) => {\n this._currentVertexData = this.geometry.getConnectedValue(state);\n return this._currentVertexData;\n };\n this.id._storedFunction = (state) => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.uniqueId;\n };\n this.collectionId._storedFunction = (state) => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.metadata ? this._currentVertexData.metadata.collectionId : 0;\n };\n this.verticesCount._storedFunction = (state) => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.positions ? this._currentVertexData.positions.length / 3 : 0;\n };\n this.facesCount._storedFunction = (state) => {\n this._currentVertexData = this._currentVertexData || this.geometry.getConnectedValue(state);\n return this._currentVertexData.indices ? this._currentVertexData.indices.length / 3 : 0;\n };\n }\n}\nRegisterClass(\"BABYLON.GeometryInfoBlock\", GeometryInfoBlock);\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,qCAAqC,QAAQ,8CAA8C;AACpG;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,SAASH,iBAAiB,CAAC;EACrD;AACJ;AACA;AACA;EACII,WAAWA,CAACC,IAAI,EAAE;IACd,KAAK,CAACA,IAAI,CAAC;IACX,IAAI,CAACC,aAAa,CAAC,UAAU,EAAEJ,qCAAqC,CAACK,QAAQ,CAAC;IAC9E,IAAI,CAACC,cAAc,CAAC,QAAQ,EAAEN,qCAAqC,CAACK,QAAQ,CAAC;IAC7E,IAAI,CAACC,cAAc,CAAC,IAAI,EAAEN,qCAAqC,CAACO,GAAG,CAAC;IACpE,IAAI,CAACD,cAAc,CAAC,cAAc,EAAEN,qCAAqC,CAACO,GAAG,CAAC;IAC9E,IAAI,CAACD,cAAc,CAAC,eAAe,EAAEN,qCAAqC,CAACO,GAAG,CAAC;IAC/E,IAAI,CAACD,cAAc,CAAC,YAAY,EAAEN,qCAAqC,CAACO,GAAG,CAAC;EAChF;EACA;AACJ;AACA;AACA;EACIC,YAAYA,CAAA,EAAG;IACX,OAAO,mBAAmB;EAC9B;EACA;AACJ;AACA;EACI,IAAIC,QAAQA,CAAA,EAAG;IACX,OAAO,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC;EAC1B;EACA;AACJ;AACA;EACI,IAAIC,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,QAAQ,CAAC,CAAC,CAAC;EAC3B;EACA;AACJ;AACA;EACI,IAAIC,EAAEA,CAAA,EAAG;IACL,OAAO,IAAI,CAACD,QAAQ,CAAC,CAAC,CAAC;EAC3B;EACA;AACJ;AACA;EACI,IAAIE,YAAYA,CAAA,EAAG;I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