283836a6840936e33c62c888e319d7803e7fc16bc5f23d69b8f3b9f5f2617098.json 9.1 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\n/**\n * Block used as a base for InstantiateXXX blocks\n */\nexport class InstantiateBaseBlock extends NodeGeometryBlock {\n /**\n * Create a new InstantiateBaseBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n /**\n * Gets or sets a boolean indicating that this block can evaluate context\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\n */\n this.evaluateContext = true;\n this.registerInput(\"instance\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\n this.registerInput(\"count\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\n }\n /**\n * Gets the current instance index in the current flow\n * @returns the current index\n */\n getInstanceIndex() {\n return this._currentIndex;\n }\n /**\n * Gets the current index in the current flow\n * @returns the current index\n */\n getExecutionIndex() {\n return this._currentIndex;\n }\n /**\n * Gets the current loop index in the current flow\n * @returns the current loop index\n */\n getExecutionLoopIndex() {\n return this._currentIndex;\n }\n /**\n * Gets the current face index in the current flow\n * @returns the current face index\n */\n getExecutionFaceIndex() {\n return 0;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"InstantiateBaseBlock\";\n }\n /**\n * Gets the instance input component\n */\n get instance() {\n return this._inputs[0];\n }\n /**\n * Gets the count input component\n */\n get count() {\n return this._inputs[1];\n }\n /**\n * Gets the geometry output component\n */\n get output() {\n return this._outputs[0];\n }\n _dumpPropertiesCode() {\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\n return codeString;\n }\n /**\n * Serializes this block in a JSON representation\n * @returns the serialized block object\n */\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.evaluateContext = this.evaluateContext;\n return serializationObject;\n }\n _deserialize(serializationObject) {\n super._deserialize(serializationObject);\n if (serializationObject.evaluateContext !== undefined) {\n this.evaluateContext = serializationObject.evaluateContext;\n }\n }\n}\n__decorate([editableInPropertyPage(\"Evaluate context\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", {\n embedded: true,\n notifiers: {\n rebuild: true\n }\n})], InstantiateBaseBlock.prototype, \"evaluateContext\", void 0);","map":{"version":3,"names":["__decorate","NodeGeometryBlock","NodeGeometryBlockConnectionPointTypes","editableInPropertyPage","InstantiateBaseBlock","constructor","name","evaluateContext","registerInput","Geometry","Int","registerOutput","getInstanceIndex","_currentIndex","getExecutionIndex","getExecutionLoopIndex","getExecutionFaceIndex","getClassName","instance","_inputs","count","output","_outputs","_dumpPropertiesCode","codeString","_codeVariableName","serialize","serializationObject","_deserialize","undefined","embedded","notifiers","rebuild","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js"],"sourcesContent":["import { __decorate } from \"../../../../tslib.es6.js\";\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock.js\";\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes.js\";\nimport { editableInPropertyPage } from \"../../../../Decorators/nodeDecorator.js\";\n/**\n * Block used as a base for InstantiateXXX blocks\n */\nexport class InstantiateBaseBlock extends NodeGeometryBlock {\n /**\n * Create a new InstantiateBaseBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name);\n /**\n * Gets or sets a boolean indicating that this block can evaluate context\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\n */\n this.evaluateContext = true;\n this.registerInput(\"instance\", NodeGeometryBlockConnectionPointTypes.Geometry, true);\n this.registerInput(\"count\", NodeGeometryBlockConnectionPointTypes.Int, true, 1);\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\n }\n /**\n * Gets the current instance index in the current flow\n * @returns the current index\n */\n getInstanceIndex() {\n return this._currentIndex;\n }\n /**\n * Gets the current index in the current flow\n * @returns the current index\n */\n getExecutionIndex() {\n return this._currentIndex;\n }\n /**\n * Gets the current loop index in the current flow\n * @returns the current loop index\n */\n getExecutionLoopIndex() {\n return this._currentIndex;\n }\n /**\n * Gets the current face index in the current flow\n * @returns the current face index\n */\n getExecutionFaceIndex() {\n return 0;\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"InstantiateBaseBlock\";\n }\n /**\n * Gets the instance input component\n */\n get instance() {\n return this._inputs[0];\n }\n /**\n * Gets the count input component\n */\n get count() {\n return this._inputs[1];\n }\n /**\n * Gets the geometry output component\n */\n get output() {\n return this._outputs[0];\n }\n _dumpPropertiesCode() {\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\n return codeString;\n }\n /**\n * Serializes this block in a JSON representation\n * @returns the serialized block object\n */\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.evaluateContext = this.evaluateContext;\n return serializationObject;\n }\n _deserialize(serializationObject) {\n super._deserialize(serializationObject);\n if (serializationObject.evaluateContext !== undefined) {\n this.evaluateContext = serializationObject.evaluateContext;\n }\n }\n}\n__decorate([\n editableInPropertyPage(\"Evaluate context\", 0 /* PropertyTypeForEdition.Boolean */, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\n], InstantiateBaseBlock.prototype, \"evaluateContext\", void 0);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD,SAASC,iBAAiB,QAAQ,4BAA4B;AAC9D,SAASC,qCAAqC,QAAQ,iDAAiD;AACvG,SAASC,sBAAsB,QAAQ,yCAAyC;AAChF;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB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