Enum omf::AttributeData
source · pub enum AttributeData {
Number {
values: Array<Number>,
colormap: Option<NumberColormap>,
},
Vector {
values: Array<Vector>,
},
Text {
values: Array<Text>,
},
Category {
values: Array<Index>,
names: Array<Name>,
gradient: Option<Array<Gradient>>,
attributes: Vec<Attribute>,
},
Boolean {
values: Array<Boolean>,
},
Color {
values: Array<Color>,
},
MappedTexture {
image: Array<Image>,
texcoords: Array<Texcoord>,
},
ProjectedTexture {
image: Array<Image>,
orient: Orient2,
width: f64,
height: f64,
},
}
Expand description
The various types of data that can be attached to an Attribute
.
Variants§
Number
Number data with flexible type.
Values can be stored as 32 or 64-bit signed integers, 32 or 64-bit floating point, date, or date-time. Valid dates are approximately ±262,000 years from the common era. Date-time values are written with microsecond accuracy, and times are always in UTC.
Fields
colormap: Option<NumberColormap>
Optional colormap. If absent then the importing application should invent one.
Make sure the colormap uses the same number type as values
.
Vector
2D or 3D vector data.
Text
Text data.
Category
Category data.
A name is required for each category, a color is optional, and other values can be attached as sub-attributes.
Fields
values: Array<Index>
Array with Index
type storing the category indices.
Values are indices into the names
array, colors
array, and any sub-attributes,
and must be within range for them.
gradient: Option<Array<Gradient>>
Optional array with Gradient
type storing category colors.
If present, must be the same length as names
. If absent then the importing
application should invent colors.
attributes: Vec<Attribute>
Additional attributes that use the same indices.
This could be used to store the density of rock types in a lithology attribute for
example. The location field of these attributes must be
Categories
crate::Location::Categories. They must have the same length as names
.
Boolean
Boolean or filter data.
Fields
values: Array<Boolean>
Array with Boolean
type storing the attribute values.
These values may be true, false, or null. Applications that don’t support three-valued logic may treat null as false.
Color
Color data.
Fields
MappedTexture
A texture applied with UV mapping.
Typically applied to surface vertices. Applications may ignore other locations.
Fields
ProjectedTexture
A texture defined as a rectangle in space projected along its normal.
Behavior of the texture outside the projected rectangle is not defined. The texture might repeat, clip the element, or itself be clipped to reveal the flat color of the element.
The attribute location must be Projected
.
Implementations§
Trait Implementations§
source§impl Clone for AttributeData
impl Clone for AttributeData
source§fn clone(&self) -> AttributeData
fn clone(&self) -> AttributeData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AttributeData
impl Debug for AttributeData
source§impl<'de> Deserialize<'de> for AttributeData
impl<'de> Deserialize<'de> for AttributeData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl JsonSchema for AttributeData
impl JsonSchema for AttributeData
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq for AttributeData
impl PartialEq for AttributeData
source§impl Serialize for AttributeData
impl Serialize for AttributeData
source§impl Validate for AttributeData
impl Validate for AttributeData
impl StructuralPartialEq for AttributeData
Auto Trait Implementations§
impl Freeze for AttributeData
impl RefUnwindSafe for AttributeData
impl Send for AttributeData
impl Sync for AttributeData
impl Unpin for AttributeData
impl UnwindSafe for AttributeData
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)