コード例 #1
0
        protected override void OnValidateReferences(Validation.ValidationContext result)
        {
            base.OnValidateReferences(result);

            result.CheckArrayIndexAccess(nameof(Buffer), _buffer, this.LogicalParent.LogicalBuffers);

            result.CheckSchemaNonNegative("ByteOffset", _byteOffset);

            result.CheckSchemaIsInRange("ByteLength", _byteLength, _byteLengthMinimum, int.MaxValue);

            // ByteStride must be multiple of 4, between 4 and 252
            if (_byteStride.HasValue)
            {
                result.CheckSchemaIsInRange(nameof(ByteStride), _byteStride.Value, _byteStrideMinimum, _byteStrideMaximum);
                result.CheckSchemaIsMultipleOf(nameof(ByteStride), _byteStride.Value, 4);
            }
        }
コード例 #2
0
ファイル: gltf.Buffer.cs プロジェクト: peggylin-hub/SharpGLTF
        protected override void OnValidateReferences(Validation.ValidationContext result)
        {
            base.OnValidateReferences(result);

            result.CheckSchemaIsValidURI("Uri", this._uri, EMBEDDEDGLTFBUFFER, EMBEDDEDOCTETSTREAM);
            result.CheckSchemaIsInRange("ByteLength", _byteLength, _byteLengthMinimum, int.MaxValue);
            // result.CheckSchemaIsMultipleOf("ByteLength", _byteLength, 4);
        }
コード例 #3
0
        protected override void OnValidateReferences(Validation.ValidationContext result)
        {
            base.OnValidateReferences(result);

            result.CheckSchemaIsDefined("BufferView", _bufferView);
            result.CheckArrayIndexAccess("BufferView", _bufferView, this.LogicalParent.LogicalBufferViews);

            result.CheckSchemaNonNegative("ByteOffset", _byteOffset);
            result.CheckSchemaIsInRange("Count", _count, _countMinimum, int.MaxValue);

            _sparse?.ValidateReferences(result);
        }