@csi-foxbyte/cityjson-to-3d-tiles
Version:
A Node.js library that converts CityJSON files into Cesium 3D Tiles—complete with automatic texture atlas packing, Basis compression, three LOD levels, and customizable threading.
2 lines • 12.1 kB
JavaScript
import {ExtensionProperty,PropertyType,RefSet,RefMap,TextureInfo}from'@gltf-transform/core';const t="EXT_structural_metadata";class p extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="StructuralMetadata",this.parentTypes=[PropertyType.ROOT];}getDefaults(){return Object.assign(super.getDefaults(),{schema:null,schemaUri:null,propertyTables:new RefSet,propertyTextures:new RefSet,propertyAttributes:new RefSet})}getSchema(){return this.getRef("schema")}setSchema(e){return this.setRef("schema",e)}getSchemaUri(){return this.get("schemaUri")}setSchemaUri(e){return this.set("schemaUri",e)}listPropertyTables(){return this.listRefs("propertyTables")}addPropertyTable(e){return this.addRef("propertyTables",e)}removePropertyTable(e){return this.removeRef("propertyTables",e)}listPropertyTextures(){return this.listRefs("propertyTextures")}addPropertyTexture(e){return this.addRef("propertyTextures",e)}removePropertyTexture(e){return this.removeRef("propertyTextures",e)}listPropertyAttributes(){return this.listRefs("propertyAttributes")}addPropertyAttribute(e){return this.addRef("propertyAttributes",e)}removePropertyAttribute(e){return this.removeRef("propertyAttributes",e)}}p.EXTENSION_NAME=t;class o extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="Schema",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,description:null,version:null,classes:new RefMap,enums:new RefMap})}getId(){return this.get("id")}setId(e){return this.set("id",e)}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getDescription(){return this.get("description")}setDescription(e){return this.set("description",e)}getVersion(){return this.get("version")}setVersion(e){return this.set("version",e)}setClass(e,n){return this.setRefMap("classes",e,n)}getClass(e){return this.getRefMap("classes",e)}listClassKeys(){return this.listRefMapKeys("classes")}listClassValues(){return this.listRefMapValues("classes")}setEnum(e,n){return this.setRefMap("enums",e,n)}getEnum(e){return this.getRefMap("enums",e)}listEnumKeys(){return this.listRefMapKeys("enums")}listEnumValues(){return this.listRefMapValues("enums")}}o.EXTENSION_NAME=t;class y extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="Class",this.parentTypes=["Schema"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,description:null,properties:new RefMap})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getDescription(){return this.get("description")}setDescription(e){return this.set("description",e)}setProperty(e,n){return this.setRefMap("properties",e,n)}getProperty(e){return this.getRefMap("properties",e)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}}y.EXTENSION_NAME=t;class c extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="ClassProperty",this.parentTypes=["Class"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,description:null,componentType:null,enumType:null,array:null,count:null,normalized:null,offset:null,scale:null,max:null,min:null,required:null,noData:null,default:null})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getDescription(){return this.get("description")}setDescription(e){return this.set("description",e)}getType(){return this.get("type")}setType(e){return this.set("type",e)}getComponentType(){return this.get("componentType")}setComponentType(e){return this.set("componentType",e)}getEnumType(){return this.get("enumType")}setEnumType(e){return this.set("enumType",e)}getArray(){return this.get("array")}setArray(e){return this.set("array",e)}getCount(){return this.get("count")}setCount(e){return this.set("count",e)}getNormalized(){return this.get("normalized")}setNormalized(e){return this.set("normalized",e)}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getMax(){return this.get("max")}setMax(e){return this.set("max",e)}getMin(){return this.get("min")}setMin(e){return this.set("min",e)}getRequired(){return this.get("required")}setRequired(e){return this.set("required",e)}getNoData(){return this.get("noData")}setNoData(e){return this.set("noData",e)}getDefault(){return this.get("default")}setDefault(e){return this.set("default",e)}}c.EXTENSION_NAME=t;class g extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="Enum",this.parentTypes=["Schema"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,description:null,valueType:"UINT16",values:new RefSet})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getDescription(){return this.get("description")}setDescription(e){return this.set("description",e)}getValueType(){return this.get("valueType")}setValueType(e){return this.set("valueType",e)}listValues(){return this.listRefs("values")}addEnumValue(e){return this.addRef("values",e)}removeEnumValue(e){return this.removeRef("values",e)}}g.EXTENSION_NAME=t;class d extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="EnumValue",this.parentTypes=["Enum"];}getDefaults(){return Object.assign(super.getDefaults(),{description:null})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getDescription(){return this.get("description")}setDescription(e){return this.set("description",e)}getValue(){return this.get("value")}setValue(e){return this.set("value",e)}}d.EXTENSION_NAME=t;class f extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="PropertyTable",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,properties:new RefMap})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getClass(){return this.get("class")}setClass(e){return this.set("class",e)}getCount(){return this.get("count")}setCount(e){return this.set("count",e)}setProperty(e,n){return this.setRefMap("properties",e,n)}getProperty(e){return this.getRefMap("properties",e)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}}f.EXTENSION_NAME=t;class h extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="PropertyTableProperty",this.parentTypes=["PropertyTable"];}getDefaults(){return Object.assign(super.getDefaults(),{arrayOffsets:null,stringOffsets:null,arrayOffsetType:null,stringOffsetType:null,offset:null,scale:null,max:null,min:null})}getValues(){return this.get("values")}setValues(e){return this.set("values",e)}getArrayOffsets(){return this.get("arrayOffsets")}setArrayOffsets(e){return this.set("arrayOffsets",e)}getStringOffsets(){return this.get("stringOffsets")}setStringOffsets(e){return this.set("stringOffsets",e)}getArrayOffsetType(){return this.get("arrayOffsetType")}setArrayOffsetType(e){return this.set("arrayOffsetType",e)}getStringOffsetType(){return this.get("stringOffsetType")}setStringOffsetType(e){return this.set("stringOffsetType",e)}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getMax(){return this.get("max")}setMax(e){return this.set("max",e)}getMin(){return this.get("min")}setMin(e){return this.set("min",e)}}h.EXTENSION_NAME=t;class m extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="PropertyTexture",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,properties:new RefMap})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getClass(){return this.get("class")}setClass(e){return this.set("class",e)}setProperty(e,n){return this.setRefMap("properties",e,n)}getProperty(e){return this.getRefMap("properties",e)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}}m.EXTENSION_NAME=t;class b extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="PropertyTextureProperty",this.parentTypes=["PropertyTexture"];}getDefaults(){const e=new TextureInfo(this.graph,"textureInfo");return e.setMinFilter(TextureInfo.MagFilter.NEAREST),e.setMagFilter(TextureInfo.MagFilter.NEAREST),Object.assign(super.getDefaults(),{channels:[0],texture:null,textureInfo:e,offset:null,scale:null,max:null,min:null})}getChannels(){return this.get("channels")}setChannels(e){return this.set("channels",e)}getTexture(){return this.getRef("texture")}setTexture(e){return this.setRef("texture",e)}getTextureInfo(){return this.getRef("texture")?this.getRef("textureInfo"):null}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getMax(){return this.get("max")}setMax(e){return this.set("max",e)}getMin(){return this.get("min")}setMin(e){return this.set("min",e)}}b.EXTENSION_NAME=t;class T extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="PropertyAttribute",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{objectName:null,properties:new RefMap})}getObjectName(){return this.get("objectName")}setObjectName(e){return this.set("objectName",e)}getClass(){return this.get("class")}setClass(e){return this.set("class",e)}setProperty(e,n){return this.setRefMap("properties",e,n)}getProperty(e){return this.getRefMap("properties",e)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}}T.EXTENSION_NAME=t;class P extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="PropertyAttributeProperty",this.parentTypes=["PropertyAttribute"];}getDefaults(){return Object.assign(super.getDefaults(),{offset:null,scale:null,max:null,min:null})}getAttribute(){return this.get("attribute")}setAttribute(e){return this.set("attribute",e)}getOffset(){return this.get("offset")}setOffset(e){return this.set("offset",e)}getScale(){return this.get("scale")}setScale(e){return this.set("scale",e)}getMax(){return this.get("max")}setMax(e){return this.set("max",e)}getMin(){return this.get("min")}setMin(e){return this.set("min",e)}}P.EXTENSION_NAME=t;class x extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="ElementStructuralMetadata",this.parentTypes=[PropertyType.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{})}getPropertyTable(){return this.getRef("propertyTable")}setPropertyTable(e){return this.setRef("propertyTable",e)}getIndex(){return this.get("index")}setIndex(e){return this.set("index",e)}}x.EXTENSION_NAME=t;class N extends ExtensionProperty{init(){this.extensionName=t,this.propertyType="MeshPrimitiveStructuralMetadata",this.parentTypes=[PropertyType.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{propertyTextures:new RefSet,propertyAttributes:new RefSet})}listPropertyTextures(){return this.listRefs("propertyTextures")}addPropertyTexture(e){return this.addRef("propertyTextures",e)}removePropertyTexture(e){return this.removeRef("propertyTextures",e)}listPropertyAttributes(){return this.listRefs("propertyAttributes")}addPropertyAttribute(e){return this.addRef("propertyAttributes",e)}removePropertyAttribute(e){return this.removeRef("propertyAttributes",e)}}N.EXTENSION_NAME=t;export{y as Class,c as ClassProperty,x as ElementStructuralMetadata,g as Enum,d as EnumValue,N as MeshPrimitiveStructuralMetadata,T as PropertyAttribute,P as PropertyAttributeProperty,f as PropertyTable,h as PropertyTableProperty,m as PropertyTexture,b as PropertyTextureProperty,o as Schema,p as StructuralMetadata};//# sourceMappingURL=StructuralMetadata.js.map
//# sourceMappingURL=StructuralMetadata.js.map