@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
31 lines (30 loc) • 1.25 kB
JavaScript
;
import { SubnetSopNodeLike } from "../subnet/SopSubnetChildrenDisplayController";
import { PolyNodeParamsConfig } from "../../../utils/poly/PolyNodeParamsConfig";
import { PolyNodeController } from "../../../utils/poly/PolyNodeController";
import { ModuleName } from "../../../../poly/registers/modules/Common";
import { NodeContext } from "../../../../poly/NodeContext";
export function createPolySopNode(nodeType, definition, polyNodeControllerClass) {
const ParamsConfig = PolyNodeParamsConfig.ParamsConfig(definition);
class BasePolySopNode extends SubnetSopNodeLike {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
this.polyNodeController = new polyNodeControllerClass(this, definition);
}
static type() {
return nodeType;
}
requiredModules() {
return [ModuleName.POLY_SOP];
}
static displayedInputNames() {
var _a, _b;
return ((_b = (_a = definition.inputs) == null ? void 0 : _a.simple) == null ? void 0 : _b.names) || ["input geometries"];
}
}
return BasePolySopNode;
}
export function onPolySopModuleRegister(poly) {
PolyNodeController.registerCreatePolyNodeFunctionForContext(NodeContext.SOP, createPolySopNode);
}