"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Globe = void 0;
var eventhandler_1 = require("../src/render/eventhandler");
var EllipsoidTerrainProvider_1 = require("./core/EllipsoidTerrainProvider");
var GlobeSurfaceShaderSet_1 = require("./scene/GlobeSurfaceShaderSet");
var GlobeSurfaceTileProvider_1 = require("./scene/GlobeSurfaceTileProvider");
var ImageryLayerCollection_1 = require("./scene/ImageryLayerCollection");
var quadtree_primitive_1 = require("./scene/quadtree_primitive");
var Globe = /** @class */ (function (_super) {
    __extends(Globe, _super);
    function Globe(ellipsoid) {
        var _this = _super.call(this) || this;
        var terrainProvider = new EllipsoidTerrainProvider_1.EllipsoidTerrainProvider({
            ellipsoid: ellipsoid,
        });
        _this._terrainProvider = terrainProvider;
        var imageryLayerCollection = new ImageryLayerCollection_1.ImageryLayerCollection();
        _this._ellipsoid = ellipsoid;
        _this._imageryLayerCollection = imageryLayerCollection;
        _this._surfaceShaderSet = new GlobeSurfaceShaderSet_1.GlobeSurfaceShaderSet();
        _this._surface = new quadtree_primitive_1.QuadtreePrimitive({
            tileProvider: new GlobeSurfaceTileProvider_1.GlobeSurfaceTileProvider({
                terrainProvider: terrainProvider,
                imageryLayers: imageryLayerCollection,
                surfaceShaderSet: _this._surfaceShaderSet,
            }),
        });
        return _this;
    }
    Object.defineProperty(Globe.prototype, "terrainProvider", {
        get: function () {
            return this._terrainProvider;
        },
        set: function (value) {
            if (value !== this._terrainProvider) {
                this._terrainProvider = value;
                this.fire('terrainProviderChanged');
            }
        },
        enumerable: false,
        configurable: true
    });
    return Globe;
}(eventhandler_1.EventHandler));
exports.Globe = Globe;
