UNPKG

@polygonjs/polygonjs

Version:

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

36 lines (35 loc) 1.16 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { TetObject } from "../../../core/geometry/modules/tet/TetObject"; import { CoreGroup } from "../../../core/geometry/Group"; import { CoreObjectType } from "../../../core/geometry/ObjectContent"; import { ModuleName } from "../../poly/registers/modules/Common"; export class TetSopNode extends TypedSopNode { dataType() { return CoreObjectType.TET; } requiredModules() { return [ModuleName.TET]; } setTetGeometry(geometry) { const objects = [new TetObject(geometry)]; this._setContainerTetObjects(objects); } setTetGeometries(geometries) { const objects = geometries.map((g) => new TetObject(g)); this._setContainerTetObjects(objects); } setTetObjects(tetObjects) { this._setContainerTetObjects(tetObjects); } setTetObject(tetObject) { this._setContainerTetObjects([tetObject]); } _setContainerTetObjects(objects) { const coreGroup = this.containerController.container().coreContent() || new CoreGroup(); coreGroup.setAllObjects(objects); this._setContainer(coreGroup); } } export class BaseTetSopNodeClass extends TetSopNode { }