English中文

MetadataClassProperty

new Cesium.MetadataClassProperty(options)

元数据属性,作为 A metadata property, as part of a MetadataClass.

请参阅 See the 3D Metadata Specification 对于 3D Tiles for 3D Tiles

名称 Name 类型 Type 说明 Description
options object 具有以下属性的对象: Object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
id string 房产的 ID。 The ID of the property.
type MetadataType 属性的类型,例如 SCALAR、VEC2、VEC3。 The type of the property such as SCALAR, VEC2, VEC3.
componentType MetadataComponentType 可选 optional 属性的组件类型。这包括整数(例如 INT8 或 UINT16)和浮点(FLOAT32 和 FLOAT64)值。 The component type of the property. This includes integer (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values.
enumType MetadataEnum 可选 optional 属性的枚举类型。仅当类型为 ENUM 时定义。 The enum type of the property. Only defined when type is ENUM.
isArray boolean false 可选 optional 如果属性是数组(固定长度或可变长度),则为 true,否则为 false。 True if a property is an array (either fixed length or variable length), false otherwise.
isVariableLengthArray boolean false 可选 optional 如果属性是可变长度数组,则为 true,否则为 false。 True if a property is a variable length array, false otherwise.
arrayLength number 可选 optional 数组元素的数量。仅为固定长度数组定义。 The number of array elements. Only defined for fixed length arrays.
normalized boolean false 可选 optional 属性是否标准化。 Whether the property is normalized.
min number | Array.<number> | Array.<Array.<number>> 可选 optional 存储此属性的最小允许值的数字或数字数组。仅当 type 为数字类型时才定义。 A number or an array of numbers storing the minimum allowable value of this property. Only defined when type is a numeric type.
max number | Array.<number> | Array.<Array.<number>> 可选 optional 存储此属性的最大允许值的数字或数字数组。仅当 type 为数字类型时才定义。 A number or an array of numbers storing the maximum allowable value of this property. Only defined when type is a numeric type.
offset number | Array.<number> | Array.<Array.<number>> 可选 optional 作为值转换的一部分添加到属性值的偏移量。 The offset to be added to property values as part of the value transform.
scale number | Array.<number> | Array.<Array.<number>> 可选 optional 作为值转换的一部分,要与属性值相乘的比例。 The scale to be multiplied to property values as part of the value transform.
noData number | string | Array 可选 optional 表示空值的无数据哨兵值。 The no-data sentinel value that represents null values.
default number | string | Array 可选 optional 未定义实体的属性值时使用的默认值。 A default value to use when an entity's property value is not defined.
required boolean false 可选 optional 是否需要属性。 Whether the property is required.
name string 可选 optional 属性的名称。 The name of the property.
description string 可选 optional 属性的描述。 The description of the property.
semantic string 可选 optional 描述应如何解释此属性的标识符。 An identifier that describes how this property should be interpreted.
extras * 可选 optional 额外的用户定义属性。 Extra user-defined properties.
extensions object 可选 optional 包含扩展的对象。 An object containing extensions.
实验性 Experimental

此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 的标准弃用政策的情况下进行更改。 This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

成员 Members

readonly arrayLength : number

数组元素的数量。仅为固定大小的数组定义。 The number of array elements. Only defined for fixed-size arrays.
属性的组件类型。这包括整数(例如 INT8 或 UINT16)和浮点(FLOAT32 和 FLOAT64)值 The component type of the property. This includes integer (e.g. INT8 or UINT16), and floating point (FLOAT32 and FLOAT64) values

readonly default : number|string|Array

未定义实体的属性值时使用的默认值。 A default value to use when an entity's property value is not defined.

readonly description : string

属性的描述。 The description of the property.
属性的枚举类型。仅当类型为 ENUM 时定义。 The enum type of the property. Only defined when type is ENUM.
包含扩展的对象。 An object containing extensions.
额外的用户定义属性。 Extra user-defined properties.
房产的 ID。 The ID of the property.
如果属性是数组(固定长度或可变长度),则为 true,否则为 false。 True if a property is an array (either fixed length or variable length), false otherwise.

readonly isVariableLengthArray : boolean

如果属性是可变长度数组,则为 true,否则为 false。 True if a property is a variable length array, false otherwise.

readonly max : number|Array.<number>|Array.<Array.<number>>

存储此属性的最大允许值的数字或数字数组。仅当 type 为数字类型时才定义。 A number or an array of numbers storing the maximum allowable value of this property. Only defined when type is a numeric type.

readonly min : number|Array.<number>|Array.<Array.<number>>

存储此属性的最小允许值的数字或数字数组。仅当 type 为数字类型时才定义。 A number or an array of numbers storing the minimum allowable value of this property. Only defined when type is a numeric type.
属性的名称。 The name of the property.

readonly noData : number|string|Array

表示空值的无数据哨兵值 The no-data sentinel value that represents null values

readonly normalized : boolean

属性是否标准化。 Whether the property is normalized.

readonly offset : number|Array.<number>|Array.<Array.<number>>

作为值转换的一部分添加到属性值的偏移量。即使“hasValueTransform”为“false”,它也始终被定义。如果类属性 JSON 本身没有定义它,那么它将被初始化为默认值。 The offset to be added to property values as part of the value transform. This is always defined, even when `hasValueTransform` is `false`. If the class property JSON itself did not define it, then it will be initialized to the default value.
是否需要属性。 Whether the property is required.

readonly scale : number|Array.<number>|Array.<Array.<number>>

作为值转换的一部分,要与属性值相乘的比例。即使“hasValueTransform”为“false”,它也始终被定义。如果类属性 JSON 本身没有定义它,那么它将被初始化为默认值。 The scale to be multiplied to property values as part of the value transform. This is always defined, even when `hasValueTransform` is `false`. If the class property JSON itself did not define it, then it will be initialized to the default value.
描述应如何解释此属性的标识符。 An identifier that describes how this property should be interpreted.
属性的类型,例如 SCALAR、VEC2、VEC3 The type of the property such as SCALAR, VEC2, VEC3

方法 Methods

gpuBytesPerElement()number

确定存储在 GPU 上的单个属性元素的字节大小。 This differs from the CPU byte size if the element type is a 64-bit type that can be downcast to a 32-bit type for texture packing (only relevant for textures created from property tables). Determines the byte size of a single property element, stored on the GPU. This differs from the CPU byte size if the element type is a 64-bit type that can be downcast to a 32-bit type for texture packing (only relevant for textures created from property tables).
返回: Returns:
GPU 上单个属性元素的字节大小。 The byte size of a single property element on the GPU.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.