import { EnumClass , EnumIO , _from } from '../misc/EnumIO' ; export type PrimitiveModeEnum = EnumIO ; class PrimitiveModeClass extends EnumClass implements PrimitiveModeEnum { constructor ( { index , str } ) { super ( { index , str } ) ; } } const Unknown = new PrimitiveModeClass ( { index : - 1 , str : 'UNKNOWN' , } ) ; const Points = new PrimitiveModeClass ( { index : 0 , str : 'POINTS' , } ) ; const Lines = new PrimitiveModeClass ( { index : 1 , str : 'LINES' , } ) ; const LineLoop = new PrimitiveModeClass ( { index : 2 , str : 'LINE_LOOP' , } ) ; const LineStrip = new PrimitiveModeClass ( { index : 3 , str : 'LINE_STRIP' , } ) ; const Triangles = new PrimitiveModeClass ( { index : 4 , str : 'TRIANGLES' , } ) ; const TriangleStrip = new PrimitiveModeClass ( { index : 5 , str : 'TRIANGLE_STRIP' , } ) ; const TriangleFan = new PrimitiveModeClass ( { index : 6 , str : 'TRIANGLE_FAN' , } ) ; const typeList = [ Unknown , Points , Lines , LineLoop , LineStrip , Triangles , TriangleStrip , TriangleFan , ] ; function from ( index ) { return _from ( { typeList , index } ) ; } export const PrimitiveMode = Object . freeze ( { Unknown , Points , Lines , LineLoop , LineStrip , Triangles , TriangleStrip , TriangleFan , from , } ) ;