UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

36 lines (35 loc) 1.31 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { DeleteNonManifoldSopOperation } from "../../operations/sop/DeleteNonManifold"; import { NodeParamsConfig, ParamConfig } from "../utils/params/ParamsConfig"; import { SopType } from "../../poly/registers/nodes/types/Sop"; const DEFAULT = DeleteNonManifoldSopOperation.DEFAULT_PARAMS; class DeleteNonManifoldSopParamConfig extends NodeParamsConfig { constructor() { super(...arguments); /** @param group to assign the material to */ this.group = ParamConfig.STRING(DEFAULT.group, { objectMask: true }); this.invert = ParamConfig.BOOLEAN(DEFAULT.invert); } } const ParamsConfig = new DeleteNonManifoldSopParamConfig(); export class DeleteNonManifoldSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return SopType.DELETE_NON_MANIFOLD; } initializeNode() { this.io.inputs.setCount(1); this.io.inputs.initInputsClonedState(DeleteNonManifoldSopOperation.INPUT_CLONED_STATE); } cook(inputCoreGroups) { this._operation = this._operation || new DeleteNonManifoldSopOperation(this.scene(), this.states, this); const coreGroup = this._operation.cook(inputCoreGroups, this.pv); this.setCoreGroup(coreGroup); } }