<commit_before>/*global define*/
define([
        '../Core/Cartesian4',
        '../Core/Color',
        '../Core/defined',
        '../Core/destroyObject',
        './Cesium3DTileContentState',
        './Model',
        '../ThirdParty/when'
    ], function(
        Cartesian4,
        Color,
        defined,
        destroyObject,
        Cesium3DTileContentState,
        Model,
        when) {
    "use strict";

    /**
     * @private
     */
    var Gltf3DTileContentProvider = function(url) {
        this._model = undefined;
        this._url = url;

        /**
         * @readonly
         */
        this.state = Cesium3DTileContentState.UNLOADED;

        /**
         * @type {Promise}
         */
        this.processingPromise = when.defer();

        /**
         * @type {Promise}
         */
        this.readyPromise = when.defer();

        this._debugColor = Cartesian4.fromColor(Color.fromRandom({ alpha : 1.0 }));
        this._debugColorizeTiles = false;
    };

    Gltf3DTileContentProvider.prototype.request = function() {
        var model = Model.fromGltf({
            url : this._url,
            cull : false
//TODO: disable glTF caching
        });

        var that = this;
        when(model.readyPromise).then(function(model) {
            that.state = Cesium3DTileContentState.READY;
            that.readyPromise.resolve(that);
        }).otherwise(function(error) {
            that.state = Cesium3DTileContentState.FAILED;
            that.readyPromise.reject(error);
        });

        this._model = model;
// TODO: allow this to not change the state depending on if the request is actually made, e.g., with RequestsByServer.
        this.state = Cesium3DTileContentState.PROCESSING;
        this.processingPromise.resolve(that);
    };

    function setMaterialDiffuse(content, color) {
        var material = content._model.getMaterial('material_RoofColor');
        if (!defined(material)) {
//TODO: consistent material name
/*jshint debug: true*/
            debugger;
/*jshint debug: false*/
        }
        material.setValue('diffuse', color);
    }<commit_msg>Disable glTF caching<commit_after>/*global define*/
define([
        '../Core/Cartesian4',
        '../Core/Color',
        '../Core/defined',
        '../Core/destroyObject',
        './Cesium3DTileContentState',
        './Model',
        '../ThirdParty/when'
    ], function(
        Cartesian4,
        Color,
        defined,
        destroyObject,
        Cesium3DTileContentState,
        Model,
        when) {
    "use strict";

    /**
     * @private
     */
    var Gltf3DTileContentProvider = function(url) {
        this._model = undefined;
        this._url = url;

        /**
         * @readonly
         */
        this.state = Cesium3DTileContentState.UNLOADED;

        /**
         * @type {Promise}
         */
        this.processingPromise = when.defer();

        /**
         * @type {Promise}
         */
        this.readyPromise = when.defer();

        this._debugColor = Cartesian4.fromColor(Color.fromRandom({ alpha : 1.0 }));
        this._debugColorizeTiles = false;
    };

    Gltf3DTileContentProvider.prototype.request = function() {
        var model = Model.fromGltf({
            url : this._url,
            cull : false,           // The model is already culled by the 3D tiles
            releaseGltfJson : true  // Models are unique and will not benefit from caching so save memory
        });

        var that = this;
        when(model.readyPromise).then(function(model) {
            that.state = Cesium3DTileContentState.READY;
            that.readyPromise.resolve(that);
        }).otherwise(function(error) {
            that.state = Cesium3DTileContentState.FAILED;
            that.readyPromise.reject(error);
        });

        this._model = model;
// TODO: allow this to not change the state depending on if the request is actually made, e.g., with RequestsByServer.
        this.state = Cesium3DTileContentState.PROCESSING;
        this.processingPromise.resolve(that);
    };

    function setMaterialDiffuse(content, color) {
        var material = content._model.getMaterial('material_RoofColor');
        if (!defined(material)) {
//TODO: consistent material name
/*jshint debug: true*/
            debugger;
/*jshint debug: false*/
        }
        material.setValue('diffuse', color);
    }
{'fraction_non_alphanumeric': 0.12139917695473251, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 1.8896961690885072, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3004232', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1222, 'n_words': 249}