gs-json
Version:
gs-JSON is a domain agnostic unifying 3D file format for geometric and semantic modelling (hence the 'gs').
27 lines • 934 B
JavaScript
import { EGeomType } from "./enums";
import { EntAttrib } from "./attrib_entattrib";
import { TopoAttrib } from "./attrib_topoattrib";
/**
* A function to cast obj class to subclass.
* @param
* @return
*/
export function _castToAttribType(_kernel, geom_type, name) {
switch (geom_type) {
case EGeomType.points:
case EGeomType.objs:
return new EntAttrib(_kernel, name, geom_type);
default:// topo attribs
return new TopoAttrib(_kernel, name, geom_type);
}
}
export function _castToAttribTypes(_kernel, geom_type, names) {
switch (geom_type) {
case EGeomType.points:
case EGeomType.objs:
return names.map((name) => new EntAttrib(_kernel, name, geom_type));
default:// topo attribs
return names.map((name) => new TopoAttrib(_kernel, name, geom_type));
}
}
//# sourceMappingURL=attrib_cast.js.map