//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
namespace Brutal.GltfApi {
using System.Linq;
using System.Runtime.Serialization;
using System.Text.Json.Serialization;
///
/// Object part of the GLTF file schema
/// A typed view into a buffer view that contains raw binary data.
///
public partial class Accessor {
///
/// Backing field for BufferView.
///
private System.Nullable m_bufferView;
///
/// Backing field for ByteOffset.
///
private int m_byteOffset = 0;
///
/// Backing field for ComponentType.
///
private ComponentTypeEnum m_componentType;
///
/// Backing field for Normalized.
///
private bool m_normalized = false;
///
/// Backing field for Count.
///
private int m_count;
///
/// Backing field for Type.
///
private TypeEnum m_type;
///
/// Backing field for Max.
///
private float[] m_max;
///
/// Backing field for Min.
///
private float[] m_min;
///
/// Backing field for Sparse.
///
private AccessorSparse m_sparse;
///
/// Backing field for Name.
///
private string m_name;
///
/// Backing field for Extensions.
///
private System.Collections.Generic.Dictionary m_extensions;
///
/// Backing field for Extras.
///
private Extras m_extras;
///
/// The index of the bufferView.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("bufferView")]
public System.Nullable BufferView {
get {
return this.m_bufferView;
}
set {
if ((value < 0)) {
throw new System.ArgumentOutOfRangeException("BufferView", value, "Expected value to be greater than or equal to 0");
}
this.m_bufferView = value;
}
}
///
/// The offset relative to the start of the buffer view in bytes.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("byteOffset")]
public int ByteOffset {
get {
return this.m_byteOffset;
}
set {
if ((value < 0)) {
throw new System.ArgumentOutOfRangeException("ByteOffset", value, "Expected value to be greater than or equal to 0");
}
this.m_byteOffset = value;
}
}
///
/// The datatype of the accessor's components.
///
[System.Text.Json.Serialization.JsonRequiredAttribute()]
[System.Text.Json.Serialization.JsonPropertyNameAttribute("componentType")]
public ComponentTypeEnum ComponentType {
get {
return this.m_componentType;
}
set {
this.m_componentType = value;
}
}
///
/// Specifies whether integer data values are normalized before usage.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("normalized")]
public bool Normalized {
get {
return this.m_normalized;
}
set {
this.m_normalized = value;
}
}
///
/// The number of elements referenced by this accessor.
///
[System.Text.Json.Serialization.JsonRequiredAttribute()]
[System.Text.Json.Serialization.JsonPropertyNameAttribute("count")]
public int Count {
get {
return this.m_count;
}
set {
if ((value < 1)) {
throw new System.ArgumentOutOfRangeException("Count", value, "Expected value to be greater than or equal to 1");
}
this.m_count = value;
}
}
///
/// Specifies if the accessor's elements are scalars, vectors, or matrices.
///
[System.Text.Json.Serialization.JsonConverterAttribute(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))]
[System.Text.Json.Serialization.JsonRequiredAttribute()]
[System.Text.Json.Serialization.JsonPropertyNameAttribute("type")]
public TypeEnum Type {
get {
return this.m_type;
}
set {
this.m_type = value;
}
}
///
/// Maximum value of each component in this accessor.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("max")]
public float[] Max {
get {
return this.m_max;
}
set {
if ((value == null)) {
this.m_max = value;
return;
}
if ((value.Length < 1u)) {
throw new System.ArgumentException("Array not long enough");
}
if ((value.Length > 16u)) {
throw new System.ArgumentException("Array too long");
}
this.m_max = value;
}
}
///
/// Minimum value of each component in this accessor.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("min")]
public float[] Min {
get {
return this.m_min;
}
set {
if ((value == null)) {
this.m_min = value;
return;
}
if ((value.Length < 1u)) {
throw new System.ArgumentException("Array not long enough");
}
if ((value.Length > 16u)) {
throw new System.ArgumentException("Array too long");
}
this.m_min = value;
}
}
///
/// Sparse storage of elements that deviate from their initialization value.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("sparse")]
public AccessorSparse Sparse {
get {
return this.m_sparse;
}
set {
this.m_sparse = value;
}
}
///
/// The user-defined name of this object.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("name")]
public string Name {
get {
return this.m_name;
}
set {
this.m_name = value;
}
}
///
/// JSON object with extension-specific objects.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("extensions")]
public System.Collections.Generic.Dictionary Extensions {
get {
return this.m_extensions;
}
set {
this.m_extensions = value;
}
}
///
/// Application-specific data.
///
[System.Text.Json.Serialization.JsonPropertyNameAttribute("extras")]
public Extras Extras {
get {
return this.m_extras;
}
set {
this.m_extras = value;
}
}
///
/// This method is used to determine if the BufferView property should be serialized.
///
public bool ShouldSerializeBufferView() {
return ((m_bufferView == null)
== false);
}
///
/// This method is used to determine if the ByteOffset property should be serialized.
///
public bool ShouldSerializeByteOffset() {
return ((m_byteOffset == 0)
== false);
}
///
/// This method is used to determine if the Normalized property should be serialized.
///
public bool ShouldSerializeNormalized() {
return ((m_normalized == false)
== false);
}
///
/// This method is used to determine if the Max property should be serialized.
///
public bool ShouldSerializeMax() {
return ((m_max == null)
== false);
}
///
/// This method is used to determine if the Min property should be serialized.
///
public bool ShouldSerializeMin() {
return ((m_min == null)
== false);
}
///
/// This method is used to determine if the Sparse property should be serialized.
///
public bool ShouldSerializeSparse() {
return ((m_sparse == null)
== false);
}
///
/// This method is used to determine if the Name property should be serialized.
///
public bool ShouldSerializeName() {
return ((m_name == null)
== false);
}
///
/// This method is used to determine if the Extensions property should be serialized.
///
public bool ShouldSerializeExtensions() {
return ((m_extensions == null)
== false);
}
///
/// This method is used to determine if the Extras property should be serialized.
///
public bool ShouldSerializeExtras() {
return ((m_extras == null)
== false);
}
///
/// Enum part of the GLTF file schema
/// The datatype of the accessor's components.
///
public enum ComponentTypeEnum {
Byte = 5120,
UnsignedByte = 5121,
Short = 5122,
UnsignedShort = 5123,
UnsignedInt = 5125,
Float = 5126,
}
///
/// Enum part of the GLTF file schema
/// Specifies if the accessor's elements are scalars, vectors, or matrices.
///
public enum TypeEnum {
Scalar,
Vec2,
Vec3,
Vec4,
Mat2,
Mat3,
Mat4,
}
}
}