rindy 5 سال پیش
والد
کامیت
8bb499519e
100فایلهای تغییر یافته به همراه34 افزوده شده و 37566 حذف شده
  1. 2 0
      .browserslistrc
  2. 1 1
      .gitignore
  3. 10 0
      .jsbeautifyrc
  4. 0 41
      Apps/CesiumViewer/CesiumViewer.css
  5. 0 395
      Apps/CesiumViewer/CesiumViewer.js
  6. BIN
      Apps/CesiumViewer/favicon.ico
  7. 0 23
      Apps/CesiumViewer/index.html
  8. 0 3715
      CHANGES.md
  9. 0 988
      LICENSE.md
  10. 21 54
      README.md
  11. 0 937
      Source/Cesium.js
  12. 0 201
      Source/Core/ApproximateTerrainHeights.js
  13. 0 597
      Source/Core/ArcGISTiledElevationTerrainProvider.js
  14. 0 33
      Source/Core/ArcType.js
  15. 0 128
      Source/Core/AssociativeArray.js
  16. 0 373
      Source/Core/AttributeCompression.js
  17. 0 217
      Source/Core/AxisAlignedBoundingBox.js
  18. 0 29
      Source/Core/BingMapsApi.js
  19. 0 95
      Source/Core/BingMapsGeocoderService.js
  20. 0 358
      Source/Core/BoundingRectangle.js
  21. 0 1298
      Source/Core/BoundingSphere.js
  22. 0 858
      Source/Core/BoxGeometry.js
  23. 0 301
      Source/Core/BoxOutlineGeometry.js
  24. 0 735
      Source/Core/Cartesian2.js
  25. 0 1081
      Source/Core/Cartesian3.js
  26. 0 899
      Source/Core/Cartesian4.js
  27. 0 266
      Source/Core/Cartographic.js
  28. 0 56
      Source/Core/CartographicGeocoderService.js
  29. 0 290
      Source/Core/CatmullRomSpline.js
  30. 0 1044
      Source/Core/CesiumTerrainProvider.js
  31. 0 178
      Source/Core/Check.js
  32. 0 187
      Source/Core/CircleGeometry.js
  33. 0 135
      Source/Core/CircleOutlineGeometry.js
  34. 0 305
      Source/Core/Clock.js
  35. 0 41
      Source/Core/ClockRange.js
  36. 0 40
      Source/Core/ClockStep.js
  37. 0 2173
      Source/Core/Color.js
  38. 0 176
      Source/Core/ColorGeometryInstanceAttribute.js
  39. 0 321
      Source/Core/ComponentDatatype.js
  40. 0 90
      Source/Core/CompressedTextureBuffer.js
  41. 0 426
      Source/Core/CoplanarPolygonGeometry.js
  42. 0 107
      Source/Core/CoplanarPolygonGeometryLibrary.js
  43. 0 213
      Source/Core/CoplanarPolygonOutlineGeometry.js
  44. 0 39
      Source/Core/CornerType.js
  45. 0 1094
      Source/Core/CorridorGeometry.js
  46. 0 300
      Source/Core/CorridorGeometryLibrary.js
  47. 0 531
      Source/Core/CorridorOutlineGeometry.js
  48. 0 161
      Source/Core/Credit.js
  49. 0 232
      Source/Core/CubicRealPolynomial.js
  50. 0 204
      Source/Core/CullingVolume.js
  51. 0 436
      Source/Core/CylinderGeometry.js
  52. 0 53
      Source/Core/CylinderGeometryLibrary.js
  53. 0 244
      Source/Core/CylinderOutlineGeometry.js
  54. 0 25
      Source/Core/DefaultProxy.js
  55. 0 73
      Source/Core/DeveloperError.js
  56. 0 171
      Source/Core/DistanceDisplayCondition.js
  57. 0 164
      Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js
  58. 0 113
      Source/Core/DoublyLinkedList.js
  59. 0 367
      Source/Core/EarthOrientationParameters.js
  60. 0 47
      Source/Core/EarthOrientationParametersSample.js
  61. 0 257
      Source/Core/EasingFunction.js
  62. 0 1074
      Source/Core/EllipseGeometry.js
  63. 0 263
      Source/Core/EllipseGeometryLibrary.js
  64. 0 377
      Source/Core/EllipseOutlineGeometry.js
  65. 0 637
      Source/Core/Ellipsoid.js
  66. 0 395
      Source/Core/EllipsoidGeodesic.js
  67. 0 602
      Source/Core/EllipsoidGeometry.js
  68. 0 435
      Source/Core/EllipsoidOutlineGeometry.js
  69. 0 497
      Source/Core/EllipsoidRhumbLine.js
  70. 0 333
      Source/Core/EllipsoidTangentPlane.js
  71. 0 191
      Source/Core/EllipsoidTerrainProvider.js
  72. 0 290
      Source/Core/EllipsoidalOccluder.js
  73. 0 170
      Source/Core/EncodedCartesian3.js
  74. 0 163
      Source/Core/Event.js
  75. 0 74
      Source/Core/EventHelper.js
  76. 0 36
      Source/Core/ExtrapolationType.js
  77. 0 333
      Source/Core/FeatureDetection.js
  78. 0 481
      Source/Core/FrustumGeometry.js
  79. 0 234
      Source/Core/FrustumOutlineGeometry.js
  80. 0 251
      Source/Core/Fullscreen.js
  81. 0 26
      Source/Core/GeocodeType.js
  82. 0 30
      Source/Core/GeocoderService.js
  83. 0 106
      Source/Core/GeographicProjection.js
  84. 0 228
      Source/Core/GeographicTilingScheme.js
  85. 0 329
      Source/Core/Geometry.js
  86. 0 133
      Source/Core/GeometryAttribute.js
  87. 0 88
      Source/Core/GeometryAttributes.js
  88. 0 119
      Source/Core/GeometryInstance.js
  89. 0 133
      Source/Core/GeometryInstanceAttribute.js
  90. 0 12
      Source/Core/GeometryOffsetAttribute.js
  91. 0 2592
      Source/Core/GeometryPipeline.js
  92. 0 12
      Source/Core/GeometryType.js
  93. 0 550
      Source/Core/GoogleEarthEnterpriseMetadata.js
  94. 0 494
      Source/Core/GoogleEarthEnterpriseTerrainData.js
  95. 0 581
      Source/Core/GoogleEarthEnterpriseTerrainProvider.js
  96. 0 123
      Source/Core/GoogleEarthEnterpriseTileInformation.js
  97. 0 52
      Source/Core/GregorianDate.js
  98. 0 1149
      Source/Core/GroundPolylineGeometry.js
  99. 0 57
      Source/Core/HeadingPitchRange.js
  100. 0 0
      Source/Core/HeadingPitchRoll.js

+ 2 - 0
.browserslistrc

@@ -0,0 +1,2 @@
+> 1%
+last 2 versions

+ 1 - 1
.gitignore

@@ -1,5 +1,6 @@
 .DS_Store
 node_modules
+bak
 /dist
 
 # local env files
@@ -19,4 +20,3 @@ yarn-error.log*
 *.njsproj
 *.sln
 *.sw?
-Build

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 10 - 0
.jsbeautifyrc


+ 0 - 41
Apps/CesiumViewer/CesiumViewer.css

@@ -1,41 +0,0 @@
-@import url(../../Source/Widgets/widgets.css);
-@import url(../../Source/Widgets/lighter.css);
-
-html {
-    height: 100%;
-}
-
-body {
-    height: 100%;
-    width: 100%;
-    margin: 0;
-    overflow: hidden;
-    padding: 0;
-    background: #000;
-}
-
-.fullWindow {
-    position: absolute;
-    top: 0;
-    left: 0;
-    height: 100%;
-    width: 100%;
-    margin: 0;
-    overflow: hidden;
-    padding: 0;
-    font-family: sans-serif;
-}
-
-.loadingIndicator {
-    display: block;
-    position: absolute;
-    top: 50%;
-    left: 50%;
-    margin-top: -33px;
-    margin-left: -33px;
-    width: 66px;
-    height: 66px;
-    background-position: center;
-    background-repeat: no-repeat;
-    background-image: url(Images/ajax-loader.gif);
-}

+ 0 - 395
Apps/CesiumViewer/CesiumViewer.js

@@ -1,395 +0,0 @@
-window.CESIUM_BASE_URL = '../../Source/';
-
-// import {
-//     Cartesian3,
-//     createWorldTerrain,
-//     defined,
-//     formatError,
-//     Math as CesiumMath,
-//     objectToQuery,
-//     queryToObject,
-//     CzmlDataSource,
-//     GeoJsonDataSource,
-//     KmlDataSource,
-//     TileMapServiceImageryProvider,
-//     Viewer,
-//     viewerCesiumInspectorMixin,
-//     viewerDragDropMixin,
-//     UrlTemplateImageryProvider,
-//     WebMapTileServiceImageryProvider,
-//     GeographicTilingScheme
-// } from '../../Source/Cesium.js';
-import * as Cesium from '../../Source/Cesium.js';
-import{drawRectangle} from './rectangle.js'
-window.Cesium = Cesium
-var defined = Cesium.defined
-var formatError = Cesium.formatError
-var CesiumMath = Cesium.Math
-var objectToQuery = Cesium.objectToQuery
-var queryToObject = Cesium.queryToObject
-var TileMapServiceImageryProvider = Cesium.TileMapServiceImageryProvider
-var Viewer = Cesium.Viewer
-var viewerCesiumInspectorMixin = Cesium.viewerCesiumInspectorMixin
-var viewerDragDropMixin = Cesium.viewerDragDropMixin
-var UrlTemplateImageryProvider = Cesium.UrlTemplateImageryProvider
-var WebMapTileServiceImageryProvider = Cesium.WebMapTileServiceImageryProvider
-var GeographicTilingScheme = Cesium.GeographicTilingScheme
-
-// 创建热力图
-function createHeatMap(max, data) {
-    // 创建元素
-    var heatDoc = document.createElement("div");
-    heatDoc.setAttribute("style", "width:1000px;height:1000px;margin: 0px;display: none;");
-    document.body.appendChild(heatDoc);
-    // 创建热力图对象
-    var heatmap = h337.create({
-        container: heatDoc,
-        radius: 20,
-        maxOpacity: .5,
-        minOpacity: 0,
-        blur: .75,
-        gradient: {
-            '0.9': 'red',
-            '0.8': 'orange',
-            '0.7': 'yellow',
-            '0.5': 'blue',
-            '0.3': 'green',
-        },
-    });
-    // 添加数据
-    heatmap.setData({
-        max: max,
-        data: data
-    });
-    return heatmap;
-}
-
-// 创建正方形 绑定热力图 
-function createRectangle(viewer, coordinate, heatMap) {
-    viewer.entities.add({
-        name: 'Rotating rectangle with rotating texture coordinate',
-        show: true,
-        rectangle: {
-            coordinates:new Cesium.Rectangle(coordinate[0], coordinate[1], coordinate[2], coordinate[3]),  //Cesium.Rectangle.fromDegrees(coordinate[0], coordinate[1], coordinate[2], coordinate[3]),
-            material: heatMap._renderer.canvas // 核心语句,填充热力图
-        }
-    });
-}
-
-
-// 生成len个随机数据
-function getData(len) {
-    //构建一些随机数据点
-    var points = [];
-    var max = 0;
-    var width = 1000;
-    var height = 1000;
-    while (len--) {
-        var val = Math.floor(Math.random() * 500);
-        max = Math.max(max, val);
-        var point = {
-            x: Math.floor(Math.random() * width),
-            y: Math.floor(Math.random() * height),
-            value: val
-        };
-        points.push(point);
-    }
-    return {
-        max: max,
-        data: points
-    }
-}
-
-function main() {
-    /*
-     Options parsed from query string:
-       source=url          The URL of a CZML/GeoJSON/KML data source to load at startup.
-                           Automatic data type detection uses file extension.
-       sourceType=czml/geojson/kml
-                           Override data type detection for source.
-       flyTo=false         Don't automatically fly to the loaded source.
-       tmsImageryUrl=url   Automatically use a TMS imagery provider.
-       lookAt=id           The ID of the entity to track at startup.
-       stats=true          Enable the FPS performance display.
-       inspector=true      Enable the inspector widget.
-       debug=true          Full WebGL error reporting at substantial performance cost.
-       theme=lighter       Use the dark-text-on-light-background theme.
-       scene3DOnly=true    Enable 3D only mode.
-       view=longitude,latitude,[height,heading,pitch,roll]
-                           Automatically set a camera view. Values in degrees and meters.
-                           [height,heading,pitch,roll] default is looking straight down, [300,0,-90,0]
-       saveCamera=false    Don't automatically update the camera view in the URL when it changes.
-     */
-    var endUserOptions = queryToObject(window.location.search.substring(1));
-
-    var imageryProvider;
-    if (defined(endUserOptions.tmsImageryUrl)) {
-        imageryProvider = new TileMapServiceImageryProvider({
-            url: endUserOptions.tmsImageryUrl
-        });
-    }
-
-    var loadingIndicator = document.getElementById('loadingIndicator');
-    var viewer;
-    try {
-        // var hasBaseLayerPicker = !defined(imageryProvider);
-        // viewer = new Viewer('cesiumContainer', {
-        //     imageryProvider : imageryProvider,
-        //     baseLayerPicker : hasBaseLayerPicker,
-        //     scene3DOnly : endUserOptions.scene3DOnly,
-        //     requestRenderMode : true
-        // });
-
-        // if (hasBaseLayerPicker) {
-        //     var viewModel = viewer.baseLayerPicker.viewModel;
-        //     viewModel.selectedTerrain = viewModel.terrainProviderViewModels[1];
-        // } else {
-        //     viewer.terrainProvider = createWorldTerrain({
-        //         requestWaterMask: true,
-        //         requestVertexNormals: true
-        //     });
-        // }
-
-        var Google = new UrlTemplateImageryProvider({
-            url: "http://mt3.google.cn/vt/lyrs=y@110&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Ga",
-        })
-
-        var TianDiTu = new WebMapTileServiceImageryProvider({
-            url: "http://{s}.tianditu.gov.cn/img_c/wmts?tk=4bbbafdfeca49cb6fb5efb1a40164445&service=wmts&request=GetTile&version=1.0.0" +
-                "&LAYER=img&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}" +
-                "&style=default&format=tiles",
-            layer: "tdtImg_c",
-            style: "default",
-            format: "tiles",
-            tileMatrixSetID: "c",
-            subdomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"],
-            tilingScheme: new GeographicTilingScheme(),
-            tileMatrixLabels: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"],
-            maximumLevel: 50,
-            show: false
-        })
-
-        TianDiTu = new WebMapTileServiceImageryProvider({
-            url: 'http://t0.tianditu.gov.cn/img_w/wmts?tk=4bbbafdfeca49cb6fb5efb1a40164445',
-            layer: 'img',
-            style: 'default',
-            tileMatrixSetID: 'w',
-            format: 'tiles',
-            maximumLevel: 18
-        });
-
-        var PBF = createMVTWithStyle(Cesium, ol, createMapboxStreetsV6Style, {
-            //url: '/static/poi/{z}/{x}/{y}.pbf',
-            url: 'http://localhost:8080/wts/poi/{z}/{x}/{y}',
-            //url:"https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/{z}/{x}/{y}.vector.pbf?access_token={k}",
-            key: "pk.eyJ1IjoibXV5YW8xOTg3IiwiYSI6ImNpcm9ueHd6cjAwNzZoa20xazY1aWlubjIifQ.5tLtC5j1rh8Eqjlyrq3OaA"
-
-        });
-
-
-        viewer = window.viewer = new Viewer('cesiumContainer', {
-            resolutionScale: 1,
-            terrainProviderViewModels: [],
-            animation: false, //动画控制不显示     
-            baseLayerPicker: false,
-            fullscreenButton: false, //全屏按钮,默认显示true
-            geocoder: false, //地名查找,默认true
-            timeline: false, //时间线,默认true
-            vrButton: false, //双屏模式,默认不显示false
-            homeButton: true, //主页按钮,默认true
-            infoBox: false, //点击要素之后显示的信息,默认true
-            selectionIndicator: false, //选中元素显示,默认true
-            sceneModePicker: false, //是否显示投影方式控件
-            navigationHelpButton: true, //是否显示帮助信息控件
-            maximumRenderTimeChange: Infinity,
-            requestRenderMode: true,
-            imageryProvider: Google,
-        });
-
-        viewer.scene.debugShowFramesPerSecond = true;
-        viewer.scene.screenSpaceCameraController.enableTranslate = false;
-        viewer.scene.screenSpaceCameraController.enableTilt = false;
-        viewer.scene.screenSpaceCameraController.enableLook = false;
-        viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
-
-        //var imageryLayers = viewer.imageryLayers;
-        //imageryLayers.addImageryProvider(PBF);
-
-
-        viewer.camera.setView({
-            destination: Cesium.Cartesian3.fromDegrees(113.07242100, 22.58652789, 1000.0),
-            orientation: {
-                heading: 5.205384767667713,
-                pitch: -1.0220630084744524,
-                roll: 6.27919703978724
-            }
-        })
-
-        // 第一个热力图
-        // var coordinate1 = [1.9733857532084744,  0.39425835263667813,  1.9733970408057608,  0.39426568435545245];
-        // var heatMap1 = createHeatMap(getData(1000).max, getData(1000).data);
-        // createRectangle(viewer, coordinate1, heatMap1);
-
-        // 第二个热力图
-        // var coordinate2 = [-109.0, 30.0, -80.0, 41.0];
-        // var heatMap2 = createHeatMap(getData(3000).max, getData(3000).data);
-        // createRectangle(viewer, coordinate2, heatMap2);
-
-        // // 第三个热力图
-        // var coordinate3 = [-109.0, 41.0, -80.0, 50.0];
-        // var heatMap3 = createHeatMap(getData(5000).max, getData(5000).data);
-        // createRectangle(viewer, coordinate3, heatMap3);
-
-
-        var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
-    
-        drawRectangle(Cesium,viewer,handler,function(coords){
-            console.log(coords)
-            var heatMap1 = createHeatMap(getData(1000).max, getData(1000).data);
-            createRectangle(viewer, [coords.west,coords.south,coords.east,coords.north], heatMap1);
-        })
-
-
-    } catch (exception) {
-        loadingIndicator.style.display = 'none';
-        var message = formatError(exception);
-        console.error(message);
-        if (!document.querySelector('.cesium-widget-errorPanel')) {
-            window.alert(message); //eslint-disable-line no-alert
-        }
-        return;
-    }
-
-    viewer.extend(viewerDragDropMixin);
-    if (endUserOptions.inspector) {
-        viewer.extend(viewerCesiumInspectorMixin);
-    }
-
-    var showLoadError = function (name, error) {
-        var title = 'An error occurred while loading the file: ' + name;
-        var message = 'An error occurred while loading the file, which may indicate that it is invalid.  A detailed error report is below:';
-        viewer.cesiumWidget.showErrorPanel(title, message, error);
-    };
-
-    viewer.dropError.addEventListener(function (viewerArg, name, error) {
-        showLoadError(name, error);
-    });
-
-    var scene = viewer.scene;
-    var context = scene.context;
-    if (endUserOptions.debug) {
-        context.validateShaderProgram = true;
-        context.validateFramebuffer = true;
-        context.logShaderCompilation = true;
-        context.throwOnWebGLError = true;
-    }
-
-    // var view = endUserOptions.view;
-    // var source = endUserOptions.source;
-    // if (defined(source)) {
-    //     var sourceType = endUserOptions.sourceType;
-    //     if (!defined(sourceType)) {
-    //         // autodetect using file extension if not specified
-    //         if (/\.czml$/i.test(source)) {
-    //             sourceType = 'czml';
-    //         } else if (/\.geojson$/i.test(source) || /\.json$/i.test(source) || /\.topojson$/i.test(source)) {
-    //             sourceType = 'geojson';
-    //         } else if (/\.kml$/i.test(source) || /\.kmz$/i.test(source)) {
-    //             sourceType = 'kml';
-    //         }
-    //     }
-
-    //     var loadPromise;
-    //     if (sourceType === 'czml') {
-    //         loadPromise = CzmlDataSource.load(source);
-    //     } else if (sourceType === 'geojson') {
-    //         loadPromise = GeoJsonDataSource.load(source);
-    //     } else if (sourceType === 'kml') {
-    //         loadPromise = KmlDataSource.load(source, {
-    //             camera: scene.camera,
-    //             canvas: scene.canvas
-    //         });
-    //     } else {
-    //         showLoadError(source, 'Unknown format.');
-    //     }
-
-    //     if (defined(loadPromise)) {
-    //         viewer.dataSources.add(loadPromise).then(function (dataSource) {
-    //             var lookAt = endUserOptions.lookAt;
-    //             if (defined(lookAt)) {
-    //                 var entity = dataSource.entities.getById(lookAt);
-    //                 if (defined(entity)) {
-    //                     viewer.trackedEntity = entity;
-    //                 } else {
-    //                     var error = 'No entity with id "' + lookAt + '" exists in the provided data source.';
-    //                     showLoadError(source, error);
-    //                 }
-    //             } else if (!defined(view) && endUserOptions.flyTo !== 'false') {
-    //                 viewer.flyTo(dataSource);
-    //             }
-    //         }).otherwise(function (error) {
-    //             showLoadError(source, error);
-    //         });
-    //     }
-    // }
-
-    if (endUserOptions.stats) {
-        scene.debugShowFramesPerSecond = true;
-    }
-
-    var theme = endUserOptions.theme;
-    if (defined(theme)) {
-        if (endUserOptions.theme === 'lighter') {
-            document.body.classList.add('cesium-lighter');
-            viewer.animation.applyThemeChanges();
-        } else {
-            var error = 'Unknown theme: ' + theme;
-            viewer.cesiumWidget.showErrorPanel(error, '');
-        }
-    }
-
-    // if (defined(view)) {
-    //     var splitQuery = view.split(/[ ,]+/);
-    //     if (splitQuery.length > 1) {
-    //         var longitude = !isNaN(+splitQuery[0]) ? +splitQuery[0] : 0.0;
-    //         var latitude = !isNaN(+splitQuery[1]) ? +splitQuery[1] : 0.0;
-    //         var height = ((splitQuery.length > 2) && (!isNaN(+splitQuery[2]))) ? +splitQuery[2] : 300.0;
-    //         var heading = ((splitQuery.length > 3) && (!isNaN(+splitQuery[3]))) ? CesiumMath.toRadians(+splitQuery[3]) : undefined;
-    //         var pitch = ((splitQuery.length > 4) && (!isNaN(+splitQuery[4]))) ? CesiumMath.toRadians(+splitQuery[4]) : undefined;
-    //         var roll = ((splitQuery.length > 5) && (!isNaN(+splitQuery[5]))) ? CesiumMath.toRadians(+splitQuery[5]) : undefined;
-
-    //         viewer.camera.setView({
-    //             destination: Cartesian3.fromDegrees(longitude, latitude, height),
-    //             orientation: {
-    //                 heading: heading,
-    //                 pitch: pitch,
-    //                 roll: roll
-    //             }
-    //         });
-    //     }
-    // }
-
-    var camera = viewer.camera;
-
-    function saveCamera() {
-        var position = camera.positionCartographic;
-        var hpr = '';
-        if (defined(camera.heading)) {
-            hpr = ',' + CesiumMath.toDegrees(camera.heading) + ',' + CesiumMath.toDegrees(camera.pitch) + ',' + CesiumMath.toDegrees(camera.roll);
-        }
-        endUserOptions.view = CesiumMath.toDegrees(position.longitude) + ',' + CesiumMath.toDegrees(position.latitude) + ',' + position.height + hpr;
-        history.replaceState(undefined, '', '?' + objectToQuery(endUserOptions));
-    }
-
-    var timeout;
-    if (endUserOptions.saveCamera !== 'false') {
-        camera.changed.addEventListener(function () {
-            window.clearTimeout(timeout);
-            timeout = window.setTimeout(saveCamera, 1000);
-        });
-    }
-
-    loadingIndicator.style.display = 'none';
-}
-
-main();

BIN
Apps/CesiumViewer/favicon.ico


+ 0 - 23
Apps/CesiumViewer/index.html

@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <!-- Use correct character set. -->
-    <meta charset="utf-8">
-    <!-- Tell IE to use the latest, best version. -->
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
-    <title>Cesium Viewer</title>
-    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
-    <link rel="stylesheet" href="CesiumViewer.css" media="screen">
-</head>
-<body style="background: #000;">
-    <div id="cesiumContainer" class="fullWindow"></div>
-    <div id="loadingIndicator" class="loadingIndicator"></div>
-    <script src="../../static/heatmap.min.js"></script>
-    <script src="../../static/mapbox-streets-v6-style.js"></script>
-    <script src="../../static/ol.js"></script>
-    <script src="../../static/mvt.js"></script>
-    <script src="CesiumViewer.js" type="module"></script>
-</body>
-</html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 3715
CHANGES.md


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 988
LICENSE.md


+ 21 - 54
README.md

@@ -1,62 +1,29 @@
-<p align="center">
-<img src="https://github.com/AnalyticalGraphicsInc/cesium/wiki/logos/Cesium_Logo_Color.jpg" width="50%" />
-</p>
+# 4dkankan_next
 
-[![Build Status](https://travis-ci.org/AnalyticalGraphicsInc/cesium.svg?branch=master)](https://travis-ci.org/AnalyticalGraphicsInc/cesium)&nbsp;
-[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/) [![Greenkeeper badge](https://badges.greenkeeper.io/AnalyticalGraphicsInc/cesium.svg)](https://greenkeeper.io/)
-
-CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics, and is cross-platform, cross-browser, and tuned for dynamic-data visualization.
-
-[CesiumJS Homepage](https://cesium.com/cesiumjs)
-
-[CesiumJS Features Checklist](https://github.com/AnalyticalGraphicsInc/cesium/wiki/CesiumJS-Features-Checklist)
-
-### :rocket: Get Started
-
-Visit the [Downloads page](https://cesium.com/downloads/) or use the npm module:
+## Project setup
 ```
-npm install cesium
+npm install
 ```
 
-Have questions?  Ask them on the [forum](https://groups.google.com/forum/?hl=en#!forum/cesium-dev).
-
-Interested in contributing?  See [CONTRIBUTING.md](CONTRIBUTING.md). :heart:
-
-### :snowflake: Mission
-
-Our mission is to create the leading 3D globe and map for static and time-dynamic content, with the best possible performance, precision, visual quality, platform support, community, and ease of use.
-
-### :green_book: License
-
-[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).  CesiumJS is free for both commercial and non-commercial use.
+### Compiles and hot-reloads for development
+```
+npm run serve
+```
 
-### :earth_americas: Where Does the 3D Content Come From? ###
+### Compiles and minifies for production
+```
+npm run build
+```
 
-CesiumJS can stream 3D content such as terrain, imagery, and 3D Tiles from the commercial [Cesium ion](https://cesium.com/blog/2018/03/01/hello-cesium-ion/)
-platform and other content sources.  You are free to use any combination of content sources with CesiumJS that you please.
-Using Cesium ion helps support CesiumJS development. :heart:
+### Run your tests
+```
+npm run test
+```
 
-### :clap: Featured Demos
+### Lints and fixes files
+```
+npm run lint
+```
 
-<p> 
-<a href="https://cesium.com/blog/2018/08/21/cybercity/"><img src="https://cesium.com/blog/images/2018/08-21/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://apps.agi.com/SatelliteViewer/?Status=Operational"><img src="https://cesium.com/blog/images/2018/03-29/comspoc-cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2018/02/05/historic-pharsalia-cabin-point-cloud/"><img src="https://cesium.com/blog/images/2018/02-05/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2017/12/12/onesky/"><img src="https://cesium.com/blog/images/2017/12-12/cover.jpg" width="30%" /></a>&nbsp; 
-<a href="https://cesium.com/blog/2017/11/20/nasa-storm-virtual-globe/"><img src="https://cesium.com/blog/images/2017/11-20/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2017/11/16/gefs/"><img src="https://cesium.com/blog/images/2017/11-16/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2019/01/04/norad-tracks-santa/"><img src="https://cesium.com/blog/images/2019/01-04/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2017/07/23/drcog/"><img src="https://cesium.com/blog/images/2017/07-23/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://demos.cesium.com/NewYork/"><img src="https://cesium.com/blog/images/2017/05-05/nyc-cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2018/09/27/swisstopo-live/"><img src="https://cesium.com/blog/images/2018/09-27/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2016/12/12/stk-czml/"><img src="https://cesium.com/blog/images/2016/12-12/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2016/09/29/contextcapture/"><img src="https://cesium.com/blog/images/2016/09-29/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2016/04/20/flightradar24/"><img src="https://cesium.com/blog/images/2016/04-20/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2016/02/03/fodarearth/"><img src="https://cesium.com/blog/images/2016/02-03/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2015/08/19/mars-trek/"><img src="https://cesium.com/blog/images/2015/08-19/cover.jpg" width="30%" /></a>&nbsp;
-<a href="https://cesium.com/blog/2015/07/16/hiroshima-archive/"><img src="https://cesium.com/blog/images/2015/07-16/cover.jpg" width="30%" /></a>&nbsp; 
-<a href="https://cesium.com/blog/2019/06/13/red-bull-x-alps-in-cesium/"><img src="https://cesium.com/blog/images/2019/06-12/redbullxalps.jpg" width="30%" /></a>&nbsp;
-<br/>
-<br/>
-</p>
-<h4><a href="https://cesium.com/blog/categories/userstories">See all demos</a></h4>
+### Customize configuration
+See [Configuration Reference](https://cli.vuejs.org/config/).

+ 0 - 937
Source/Cesium.js

@@ -1,937 +0,0 @@
-export var VERSION = '1.63.1';
-export { default as appendForwardSlash } from './Core/appendForwardSlash.js';
-export { default as ApproximateTerrainHeights } from './Core/ApproximateTerrainHeights.js';
-export { default as ArcGISTiledElevationTerrainProvider } from './Core/ArcGISTiledElevationTerrainProvider.js';
-export { default as ArcType } from './Core/ArcType.js';
-export { default as arrayFill } from './Core/arrayFill.js';
-export { default as arrayRemoveDuplicates } from './Core/arrayRemoveDuplicates.js';
-export { default as arraySlice } from './Core/arraySlice.js';
-export { default as AssociativeArray } from './Core/AssociativeArray.js';
-export { default as AttributeCompression } from './Core/AttributeCompression.js';
-export { default as AxisAlignedBoundingBox } from './Core/AxisAlignedBoundingBox.js';
-export { default as barycentricCoordinates } from './Core/barycentricCoordinates.js';
-export { default as binarySearch } from './Core/binarySearch.js';
-export { default as BingMapsApi } from './Core/BingMapsApi.js';
-export { default as BingMapsGeocoderService } from './Core/BingMapsGeocoderService.js';
-export { default as BoundingRectangle } from './Core/BoundingRectangle.js';
-export { default as BoundingSphere } from './Core/BoundingSphere.js';
-export { default as BoxGeometry } from './Core/BoxGeometry.js';
-export { default as BoxOutlineGeometry } from './Core/BoxOutlineGeometry.js';
-export { default as buildModuleUrl } from './Core/buildModuleUrl.js';
-export { default as cancelAnimationFrame } from './Core/cancelAnimationFrame.js';
-export { default as Cartesian2 } from './Core/Cartesian2.js';
-export { default as Cartesian3 } from './Core/Cartesian3.js';
-export { default as Cartesian4 } from './Core/Cartesian4.js';
-export { default as Cartographic } from './Core/Cartographic.js';
-export { default as CartographicGeocoderService } from './Core/CartographicGeocoderService.js';
-export { default as CatmullRomSpline } from './Core/CatmullRomSpline.js';
-export { default as CesiumTerrainProvider } from './Core/CesiumTerrainProvider.js';
-export { default as Check } from './Core/Check.js';
-export { default as CircleGeometry } from './Core/CircleGeometry.js';
-export { default as CircleOutlineGeometry } from './Core/CircleOutlineGeometry.js';
-export { default as Clock } from './Core/Clock.js';
-export { default as ClockRange } from './Core/ClockRange.js';
-export { default as ClockStep } from './Core/ClockStep.js';
-export { default as clone } from './Core/clone.js';
-export { default as Color } from './Core/Color.js';
-export { default as ColorGeometryInstanceAttribute } from './Core/ColorGeometryInstanceAttribute.js';
-export { default as combine } from './Core/combine.js';
-export { default as ComponentDatatype } from './Core/ComponentDatatype.js';
-export { default as CompressedTextureBuffer } from './Core/CompressedTextureBuffer.js';
-export { default as CoplanarPolygonGeometry } from './Core/CoplanarPolygonGeometry.js';
-export { default as CoplanarPolygonGeometryLibrary } from './Core/CoplanarPolygonGeometryLibrary.js';
-export { default as CoplanarPolygonOutlineGeometry } from './Core/CoplanarPolygonOutlineGeometry.js';
-export { default as CornerType } from './Core/CornerType.js';
-export { default as CorridorGeometry } from './Core/CorridorGeometry.js';
-export { default as CorridorGeometryLibrary } from './Core/CorridorGeometryLibrary.js';
-export { default as CorridorOutlineGeometry } from './Core/CorridorOutlineGeometry.js';
-export { default as createGuid } from './Core/createGuid.js';
-export { default as createWorldTerrain } from './Core/createWorldTerrain.js';
-export { default as Credit } from './Core/Credit.js';
-export { default as CubicRealPolynomial } from './Core/CubicRealPolynomial.js';
-export { default as CullingVolume } from './Core/CullingVolume.js';
-export { default as CylinderGeometry } from './Core/CylinderGeometry.js';
-export { default as CylinderGeometryLibrary } from './Core/CylinderGeometryLibrary.js';
-export { default as CylinderOutlineGeometry } from './Core/CylinderOutlineGeometry.js';
-export { default as decodeGoogleEarthEnterpriseData } from './Core/decodeGoogleEarthEnterpriseData.js';
-export { default as DefaultProxy } from './Core/DefaultProxy.js';
-export { default as defaultValue } from './Core/defaultValue.js';
-export { default as defined } from './Core/defined.js';
-export { default as defineProperties } from './Core/defineProperties.js';
-export { default as deprecationWarning } from './Core/deprecationWarning.js';
-export { default as destroyObject } from './Core/destroyObject.js';
-export { default as DeveloperError } from './Core/DeveloperError.js';
-export { default as DistanceDisplayCondition } from './Core/DistanceDisplayCondition.js';
-export { default as DistanceDisplayConditionGeometryInstanceAttribute } from './Core/DistanceDisplayConditionGeometryInstanceAttribute.js';
-export { default as DoublyLinkedList } from './Core/DoublyLinkedList.js';
-export { default as EarthOrientationParameters } from './Core/EarthOrientationParameters.js';
-export { default as EarthOrientationParametersSample } from './Core/EarthOrientationParametersSample.js';
-export { default as EasingFunction } from './Core/EasingFunction.js';
-export { default as EllipseGeometry } from './Core/EllipseGeometry.js';
-export { default as EllipseGeometryLibrary } from './Core/EllipseGeometryLibrary.js';
-export { default as EllipseOutlineGeometry } from './Core/EllipseOutlineGeometry.js';
-export { default as Ellipsoid } from './Core/Ellipsoid.js';
-export { default as EllipsoidalOccluder } from './Core/EllipsoidalOccluder.js';
-export { default as EllipsoidGeodesic } from './Core/EllipsoidGeodesic.js';
-export { default as EllipsoidGeometry } from './Core/EllipsoidGeometry.js';
-export { default as EllipsoidOutlineGeometry } from './Core/EllipsoidOutlineGeometry.js';
-export { default as EllipsoidRhumbLine } from './Core/EllipsoidRhumbLine.js';
-export { default as EllipsoidTangentPlane } from './Core/EllipsoidTangentPlane.js';
-export { default as EllipsoidTerrainProvider } from './Core/EllipsoidTerrainProvider.js';
-export { default as EncodedCartesian3 } from './Core/EncodedCartesian3.js';
-export { default as Event } from './Core/Event.js';
-export { default as EventHelper } from './Core/EventHelper.js';
-export { default as ExtrapolationType } from './Core/ExtrapolationType.js';
-export { default as FeatureDetection } from './Core/FeatureDetection.js';
-export { default as formatError } from './Core/formatError.js';
-export { default as freezeObject } from './Core/freezeObject.js';
-export { default as FrustumGeometry } from './Core/FrustumGeometry.js';
-export { default as FrustumOutlineGeometry } from './Core/FrustumOutlineGeometry.js';
-export { default as Fullscreen } from './Core/Fullscreen.js';
-export { default as GeocoderService } from './Core/GeocoderService.js';
-export { default as GeocodeType } from './Core/GeocodeType.js';
-export { default as GeographicProjection } from './Core/GeographicProjection.js';
-export { default as GeographicTilingScheme } from './Core/GeographicTilingScheme.js';
-export { default as Geometry } from './Core/Geometry.js';
-export { default as GeometryAttribute } from './Core/GeometryAttribute.js';
-export { default as GeometryAttributes } from './Core/GeometryAttributes.js';
-export { default as GeometryInstance } from './Core/GeometryInstance.js';
-export { default as GeometryInstanceAttribute } from './Core/GeometryInstanceAttribute.js';
-export { default as GeometryOffsetAttribute } from './Core/GeometryOffsetAttribute.js';
-export { default as GeometryPipeline } from './Core/GeometryPipeline.js';
-export { default as GeometryType } from './Core/GeometryType.js';
-export { default as getAbsoluteUri } from './Core/getAbsoluteUri.js';
-export { default as getBaseUri } from './Core/getBaseUri.js';
-export { default as getExtensionFromUri } from './Core/getExtensionFromUri.js';
-export { default as getFilenameFromUri } from './Core/getFilenameFromUri.js';
-export { default as getImagePixels } from './Core/getImagePixels.js';
-export { default as getMagic } from './Core/getMagic.js';
-export { default as getStringFromTypedArray } from './Core/getStringFromTypedArray.js';
-export { default as getTimestamp } from './Core/getTimestamp.js';
-export { default as GoogleEarthEnterpriseMetadata } from './Core/GoogleEarthEnterpriseMetadata.js';
-export { default as GoogleEarthEnterpriseTerrainData } from './Core/GoogleEarthEnterpriseTerrainData.js';
-export { default as GoogleEarthEnterpriseTerrainProvider } from './Core/GoogleEarthEnterpriseTerrainProvider.js';
-export { default as GoogleEarthEnterpriseTileInformation } from './Core/GoogleEarthEnterpriseTileInformation.js';
-export { default as GregorianDate } from './Core/GregorianDate.js';
-export { default as GroundPolylineGeometry } from './Core/GroundPolylineGeometry.js';
-export { default as HeadingPitchRange } from './Core/HeadingPitchRange.js';
-export { default as HeadingPitchRoll } from './Core/HeadingPitchRoll.js';
-export { default as Heap } from './Core/Heap.js';
-export { default as HeightmapEncoding } from './Core/HeightmapEncoding.js';
-export { default as HeightmapTerrainData } from './Core/HeightmapTerrainData.js';
-export { default as HeightmapTessellator } from './Core/HeightmapTessellator.js';
-export { default as HermitePolynomialApproximation } from './Core/HermitePolynomialApproximation.js';
-export { default as HermiteSpline } from './Core/HermiteSpline.js';
-export { default as Iau2000Orientation } from './Core/Iau2000Orientation.js';
-export { default as Iau2006XysData } from './Core/Iau2006XysData.js';
-export { default as Iau2006XysSample } from './Core/Iau2006XysSample.js';
-export { default as IauOrientationAxes } from './Core/IauOrientationAxes.js';
-export { default as IauOrientationParameters } from './Core/IauOrientationParameters.js';
-export { default as IndexDatatype } from './Core/IndexDatatype.js';
-export { default as InterpolationAlgorithm } from './Core/InterpolationAlgorithm.js';
-export { default as Intersect } from './Core/Intersect.js';
-export { default as Intersections2D } from './Core/Intersections2D.js';
-export { default as IntersectionTests } from './Core/IntersectionTests.js';
-export { default as Interval } from './Core/Interval.js';
-export { default as Ion } from './Core/Ion.js';
-export { default as IonGeocoderService } from './Core/IonGeocoderService.js';
-export { default as IonResource } from './Core/IonResource.js';
-export { default as isArray } from './Core/isArray.js';
-export { default as isBitSet } from './Core/isBitSet.js';
-export { default as isBlobUri } from './Core/isBlobUri.js';
-export { default as isCrossOriginUrl } from './Core/isCrossOriginUrl.js';
-export { default as isDataUri } from './Core/isDataUri.js';
-export { default as isLeapYear } from './Core/isLeapYear.js';
-export { default as Iso8601 } from './Core/Iso8601.js';
-export { default as JulianDate } from './Core/JulianDate.js';
-export { default as KeyboardEventModifier } from './Core/KeyboardEventModifier.js';
-export { default as LagrangePolynomialApproximation } from './Core/LagrangePolynomialApproximation.js';
-export { default as LeapSecond } from './Core/LeapSecond.js';
-export { default as LinearApproximation } from './Core/LinearApproximation.js';
-export { default as LinearSpline } from './Core/LinearSpline.js';
-export { default as loadAndExecuteScript } from './Core/loadAndExecuteScript.js';
-export { default as loadCRN } from './Core/loadCRN.js';
-export { default as loadImageFromTypedArray } from './Core/loadImageFromTypedArray.js';
-export { default as loadKTX } from './Core/loadKTX.js';
-export { default as ManagedArray } from './Core/ManagedArray.js';
-export { default as MapboxApi } from './Core/MapboxApi.js';
-export { default as MapProjection } from './Core/MapProjection.js';
-export { default as Math } from './Core/Math.js';
-export { default as Matrix2 } from './Core/Matrix2.js';
-export { default as Matrix3 } from './Core/Matrix3.js';
-export { default as Matrix4 } from './Core/Matrix4.js';
-export { default as mergeSort } from './Core/mergeSort.js';
-export { default as NearFarScalar } from './Core/NearFarScalar.js';
-export { default as objectToQuery } from './Core/objectToQuery.js';
-export { default as Occluder } from './Core/Occluder.js';
-export { default as OffsetGeometryInstanceAttribute } from './Core/OffsetGeometryInstanceAttribute.js';
-export { default as oneTimeWarning } from './Core/oneTimeWarning.js';
-export { default as OpenCageGeocoderService } from './Core/OpenCageGeocoderService.js';
-export { default as OrientedBoundingBox } from './Core/OrientedBoundingBox.js';
-export { default as OrthographicFrustum } from './Core/OrthographicFrustum.js';
-export { default as OrthographicOffCenterFrustum } from './Core/OrthographicOffCenterFrustum.js';
-export { default as Packable } from './Core/Packable.js';
-export { default as PackableForInterpolation } from './Core/PackableForInterpolation.js';
-export { default as parseResponseHeaders } from './Core/parseResponseHeaders.js';
-export { default as PeliasGeocoderService } from './Core/PeliasGeocoderService.js';
-export { default as PerspectiveFrustum } from './Core/PerspectiveFrustum.js';
-export { default as PerspectiveOffCenterFrustum } from './Core/PerspectiveOffCenterFrustum.js';
-export { default as PinBuilder } from './Core/PinBuilder.js';
-export { default as PixelFormat } from './Core/PixelFormat.js';
-export { default as Plane } from './Core/Plane.js';
-export { default as PlaneGeometry } from './Core/PlaneGeometry.js';
-export { default as PlaneOutlineGeometry } from './Core/PlaneOutlineGeometry.js';
-export { default as pointInsideTriangle } from './Core/pointInsideTriangle.js';
-export { default as PolygonGeometry } from './Core/PolygonGeometry.js';
-export { default as PolygonGeometryLibrary } from './Core/PolygonGeometryLibrary.js';
-export { default as PolygonHierarchy } from './Core/PolygonHierarchy.js';
-export { default as PolygonOutlineGeometry } from './Core/PolygonOutlineGeometry.js';
-export { default as PolygonPipeline } from './Core/PolygonPipeline.js';
-export { default as PolylineGeometry } from './Core/PolylineGeometry.js';
-export { default as PolylinePipeline } from './Core/PolylinePipeline.js';
-export { default as PolylineVolumeGeometry } from './Core/PolylineVolumeGeometry.js';
-export { default as PolylineVolumeGeometryLibrary } from './Core/PolylineVolumeGeometryLibrary.js';
-export { default as PolylineVolumeOutlineGeometry } from './Core/PolylineVolumeOutlineGeometry.js';
-export { default as PrimitiveType } from './Core/PrimitiveType.js';
-export { default as QuadraticRealPolynomial } from './Core/QuadraticRealPolynomial.js';
-export { default as QuantizedMeshTerrainData } from './Core/QuantizedMeshTerrainData.js';
-export { default as QuarticRealPolynomial } from './Core/QuarticRealPolynomial.js';
-export { default as Quaternion } from './Core/Quaternion.js';
-export { default as QuaternionSpline } from './Core/QuaternionSpline.js';
-export { default as queryToObject } from './Core/queryToObject.js';
-export { default as Queue } from './Core/Queue.js';
-export { default as Ray } from './Core/Ray.js';
-export { default as Rectangle } from './Core/Rectangle.js';
-export { default as RectangleCollisionChecker } from './Core/RectangleCollisionChecker.js';
-export { default as RectangleGeometry } from './Core/RectangleGeometry.js';
-export { default as RectangleGeometryLibrary } from './Core/RectangleGeometryLibrary.js';
-export { default as RectangleOutlineGeometry } from './Core/RectangleOutlineGeometry.js';
-export { default as ReferenceFrame } from './Core/ReferenceFrame.js';
-export { default as Request } from './Core/Request.js';
-export { default as requestAnimationFrame } from './Core/requestAnimationFrame.js';
-export { default as RequestErrorEvent } from './Core/RequestErrorEvent.js';
-export { default as RequestScheduler } from './Core/RequestScheduler.js';
-export { default as RequestState } from './Core/RequestState.js';
-export { default as RequestType } from './Core/RequestType.js';
-export { default as Resource } from './Core/Resource.js';
-export { default as RuntimeError } from './Core/RuntimeError.js';
-export { default as sampleTerrain } from './Core/sampleTerrain.js';
-export { default as sampleTerrainMostDetailed } from './Core/sampleTerrainMostDetailed.js';
-export { default as scaleToGeodeticSurface } from './Core/scaleToGeodeticSurface.js';
-export { default as ScreenSpaceEventHandler } from './Core/ScreenSpaceEventHandler.js';
-export { default as ScreenSpaceEventType } from './Core/ScreenSpaceEventType.js';
-export { default as ShowGeometryInstanceAttribute } from './Core/ShowGeometryInstanceAttribute.js';
-export { default as Simon1994PlanetaryPositions } from './Core/Simon1994PlanetaryPositions.js';
-export { default as SimplePolylineGeometry } from './Core/SimplePolylineGeometry.js';
-export { default as SphereGeometry } from './Core/SphereGeometry.js';
-export { default as SphereOutlineGeometry } from './Core/SphereOutlineGeometry.js';
-export { default as Spherical } from './Core/Spherical.js';
-export { default as Spline } from './Core/Spline.js';
-export { default as subdivideArray } from './Core/subdivideArray.js';
-export { default as TaskProcessor } from './Core/TaskProcessor.js';
-export { default as TerrainData } from './Core/TerrainData.js';
-export { default as TerrainEncoding } from './Core/TerrainEncoding.js';
-export { default as TerrainMesh } from './Core/TerrainMesh.js';
-export { default as TerrainProvider } from './Core/TerrainProvider.js';
-export { default as TerrainQuantization } from './Core/TerrainQuantization.js';
-export { default as TileAvailability } from './Core/TileAvailability.js';
-export { default as TileEdge } from './Core/TileEdge.js';
-export { default as TileProviderError } from './Core/TileProviderError.js';
-export { default as TilingScheme } from './Core/TilingScheme.js';
-export { default as TimeConstants } from './Core/TimeConstants.js';
-export { default as TimeInterval } from './Core/TimeInterval.js';
-export { default as TimeIntervalCollection } from './Core/TimeIntervalCollection.js';
-export { default as TimeStandard } from './Core/TimeStandard.js';
-export { default as Tipsify } from './Core/Tipsify.js';
-export { default as Transforms } from './Core/Transforms.js';
-export { default as TranslationRotationScale } from './Core/TranslationRotationScale.js';
-export { default as TridiagonalSystemSolver } from './Core/TridiagonalSystemSolver.js';
-export { default as TrustedServers } from './Core/TrustedServers.js';
-export { default as VertexFormat } from './Core/VertexFormat.js';
-export { default as VideoSynchronizer } from './Core/VideoSynchronizer.js';
-export { default as Visibility } from './Core/Visibility.js';
-export { default as VRTheWorldTerrainProvider } from './Core/VRTheWorldTerrainProvider.js';
-export { default as WallGeometry } from './Core/WallGeometry.js';
-export { default as WallGeometryLibrary } from './Core/WallGeometryLibrary.js';
-export { default as WallOutlineGeometry } from './Core/WallOutlineGeometry.js';
-export { default as WebGLConstants } from './Core/WebGLConstants.js';
-export { default as webGLConstantToGlslType } from './Core/webGLConstantToGlslType.js';
-export { default as WebMercatorProjection } from './Core/WebMercatorProjection.js';
-export { default as WebMercatorTilingScheme } from './Core/WebMercatorTilingScheme.js';
-export { default as WeightSpline } from './Core/WeightSpline.js';
-export { default as WindingOrder } from './Core/WindingOrder.js';
-export { default as wrapFunction } from './Core/wrapFunction.js';
-export { default as writeTextToCanvas } from './Core/writeTextToCanvas.js';
-export { default as BillboardGraphics } from './DataSources/BillboardGraphics.js';
-export { default as BillboardVisualizer } from './DataSources/BillboardVisualizer.js';
-export { default as BoundingSphereState } from './DataSources/BoundingSphereState.js';
-export { default as BoxGeometryUpdater } from './DataSources/BoxGeometryUpdater.js';
-export { default as BoxGraphics } from './DataSources/BoxGraphics.js';
-export { default as CallbackProperty } from './DataSources/CallbackProperty.js';
-export { default as CheckerboardMaterialProperty } from './DataSources/CheckerboardMaterialProperty.js';
-export { default as ColorMaterialProperty } from './DataSources/ColorMaterialProperty.js';
-export { default as CompositeEntityCollection } from './DataSources/CompositeEntityCollection.js';
-export { default as CompositeMaterialProperty } from './DataSources/CompositeMaterialProperty.js';
-export { default as CompositePositionProperty } from './DataSources/CompositePositionProperty.js';
-export { default as CompositeProperty } from './DataSources/CompositeProperty.js';
-export { default as ConstantPositionProperty } from './DataSources/ConstantPositionProperty.js';
-export { default as ConstantProperty } from './DataSources/ConstantProperty.js';
-export { default as CorridorGeometryUpdater } from './DataSources/CorridorGeometryUpdater.js';
-export { default as CorridorGraphics } from './DataSources/CorridorGraphics.js';
-export { default as createMaterialPropertyDescriptor } from './DataSources/createMaterialPropertyDescriptor.js';
-export { default as createPropertyDescriptor } from './DataSources/createPropertyDescriptor.js';
-export { default as createRawPropertyDescriptor } from './DataSources/createRawPropertyDescriptor.js';
-export { default as CustomDataSource } from './DataSources/CustomDataSource.js';
-export { default as CylinderGeometryUpdater } from './DataSources/CylinderGeometryUpdater.js';
-export { default as CylinderGraphics } from './DataSources/CylinderGraphics.js';
-export { default as CzmlDataSource } from './DataSources/CzmlDataSource.js';
-export { default as DataSource } from './DataSources/DataSource.js';
-export { default as DataSourceClock } from './DataSources/DataSourceClock.js';
-export { default as DataSourceCollection } from './DataSources/DataSourceCollection.js';
-export { default as DataSourceDisplay } from './DataSources/DataSourceDisplay.js';
-export { default as DynamicGeometryBatch } from './DataSources/DynamicGeometryBatch.js';
-export { default as DynamicGeometryUpdater } from './DataSources/DynamicGeometryUpdater.js';
-export { default as EllipseGeometryUpdater } from './DataSources/EllipseGeometryUpdater.js';
-export { default as EllipseGraphics } from './DataSources/EllipseGraphics.js';
-export { default as EllipsoidGeometryUpdater } from './DataSources/EllipsoidGeometryUpdater.js';
-export { default as EllipsoidGraphics } from './DataSources/EllipsoidGraphics.js';
-export { default as Entity } from './DataSources/Entity.js';
-export { default as EntityCluster } from './DataSources/EntityCluster.js';
-export { default as EntityCollection } from './DataSources/EntityCollection.js';
-export { default as EntityView } from './DataSources/EntityView.js';
-export { default as exportKml } from './DataSources/exportKml.js';
-export { default as GeoJsonDataSource } from './DataSources/GeoJsonDataSource.js';
-export { default as GeometryUpdater } from './DataSources/GeometryUpdater.js';
-export { default as GeometryVisualizer } from './DataSources/GeometryVisualizer.js';
-export { default as GridMaterialProperty } from './DataSources/GridMaterialProperty.js';
-export { default as GroundGeometryUpdater } from './DataSources/GroundGeometryUpdater.js';
-export { default as heightReferenceOnEntityPropertyChanged } from './DataSources/heightReferenceOnEntityPropertyChanged.js';
-export { default as ImageMaterialProperty } from './DataSources/ImageMaterialProperty.js';
-export { default as KmlCamera } from './DataSources/KmlCamera.js';
-export { default as KmlDataSource } from './DataSources/KmlDataSource.js';
-export { default as KmlLookAt } from './DataSources/KmlLookAt.js';
-export { default as KmlTour } from './DataSources/KmlTour.js';
-export { default as KmlTourFlyTo } from './DataSources/KmlTourFlyTo.js';
-export { default as KmlTourWait } from './DataSources/KmlTourWait.js';
-export { default as LabelGraphics } from './DataSources/LabelGraphics.js';
-export { default as LabelVisualizer } from './DataSources/LabelVisualizer.js';
-export { default as MaterialProperty } from './DataSources/MaterialProperty.js';
-export { default as ModelGraphics } from './DataSources/ModelGraphics.js';
-export { default as ModelVisualizer } from './DataSources/ModelVisualizer.js';
-export { default as NodeTransformationProperty } from './DataSources/NodeTransformationProperty.js';
-export { default as PathGraphics } from './DataSources/PathGraphics.js';
-export { default as PathVisualizer } from './DataSources/PathVisualizer.js';
-export { default as PlaneGeometryUpdater } from './DataSources/PlaneGeometryUpdater.js';
-export { default as PlaneGraphics } from './DataSources/PlaneGraphics.js';
-export { default as PointGraphics } from './DataSources/PointGraphics.js';
-export { default as PointVisualizer } from './DataSources/PointVisualizer.js';
-export { default as PolygonGeometryUpdater } from './DataSources/PolygonGeometryUpdater.js';
-export { default as PolygonGraphics } from './DataSources/PolygonGraphics.js';
-export { default as PolylineArrowMaterialProperty } from './DataSources/PolylineArrowMaterialProperty.js';
-export { default as PolylineDashMaterialProperty } from './DataSources/PolylineDashMaterialProperty.js';
-export { default as PolylineGeometryUpdater } from './DataSources/PolylineGeometryUpdater.js';
-export { default as PolylineGlowMaterialProperty } from './DataSources/PolylineGlowMaterialProperty.js';
-export { default as PolylineGraphics } from './DataSources/PolylineGraphics.js';
-export { default as PolylineOutlineMaterialProperty } from './DataSources/PolylineOutlineMaterialProperty.js';
-export { default as PolylineVisualizer } from './DataSources/PolylineVisualizer.js';
-export { default as PolylineVolumeGeometryUpdater } from './DataSources/PolylineVolumeGeometryUpdater.js';
-export { default as PolylineVolumeGraphics } from './DataSources/PolylineVolumeGraphics.js';
-export { default as PositionProperty } from './DataSources/PositionProperty.js';
-export { default as PositionPropertyArray } from './DataSources/PositionPropertyArray.js';
-export { default as Property } from './DataSources/Property.js';
-export { default as PropertyArray } from './DataSources/PropertyArray.js';
-export { default as PropertyBag } from './DataSources/PropertyBag.js';
-export { default as RectangleGeometryUpdater } from './DataSources/RectangleGeometryUpdater.js';
-export { default as RectangleGraphics } from './DataSources/RectangleGraphics.js';
-export { default as ReferenceProperty } from './DataSources/ReferenceProperty.js';
-export { default as Rotation } from './DataSources/Rotation.js';
-export { default as SampledPositionProperty } from './DataSources/SampledPositionProperty.js';
-export { default as SampledProperty } from './DataSources/SampledProperty.js';
-export { default as ScaledPositionProperty } from './DataSources/ScaledPositionProperty.js';
-export { default as StaticGeometryColorBatch } from './DataSources/StaticGeometryColorBatch.js';
-export { default as StaticGeometryPerMaterialBatch } from './DataSources/StaticGeometryPerMaterialBatch.js';
-export { default as StaticGroundGeometryColorBatch } from './DataSources/StaticGroundGeometryColorBatch.js';
-export { default as StaticGroundGeometryPerMaterialBatch } from './DataSources/StaticGroundGeometryPerMaterialBatch.js';
-export { default as StaticGroundPolylinePerMaterialBatch } from './DataSources/StaticGroundPolylinePerMaterialBatch.js';
-export { default as StaticOutlineGeometryBatch } from './DataSources/StaticOutlineGeometryBatch.js';
-export { default as StripeMaterialProperty } from './DataSources/StripeMaterialProperty.js';
-export { default as StripeOrientation } from './DataSources/StripeOrientation.js';
-export { default as TerrainOffsetProperty } from './DataSources/TerrainOffsetProperty.js';
-export { default as TimeIntervalCollectionPositionProperty } from './DataSources/TimeIntervalCollectionPositionProperty.js';
-export { default as TimeIntervalCollectionProperty } from './DataSources/TimeIntervalCollectionProperty.js';
-export { default as VelocityOrientationProperty } from './DataSources/VelocityOrientationProperty.js';
-export { default as VelocityVectorProperty } from './DataSources/VelocityVectorProperty.js';
-export { default as Visualizer } from './DataSources/Visualizer.js';
-export { default as WallGeometryUpdater } from './DataSources/WallGeometryUpdater.js';
-export { default as WallGraphics } from './DataSources/WallGraphics.js';
-export { default as AutomaticUniforms } from './Renderer/AutomaticUniforms.js';
-export { default as Buffer } from './Renderer/Buffer.js';
-export { default as BufferUsage } from './Renderer/BufferUsage.js';
-export { default as checkFloatTexturePrecision } from './Renderer/checkFloatTexturePrecision.js';
-export { default as ClearCommand } from './Renderer/ClearCommand.js';
-export { default as ComputeCommand } from './Renderer/ComputeCommand.js';
-export { default as ComputeEngine } from './Renderer/ComputeEngine.js';
-export { default as Context } from './Renderer/Context.js';
-export { default as ContextLimits } from './Renderer/ContextLimits.js';
-export { default as createUniform } from './Renderer/createUniform.js';
-export { default as createUniformArray } from './Renderer/createUniformArray.js';
-export { default as CubeMap } from './Renderer/CubeMap.js';
-export { default as CubeMapFace } from './Renderer/CubeMapFace.js';
-export { default as DrawCommand } from './Renderer/DrawCommand.js';
-export { default as Framebuffer } from './Renderer/Framebuffer.js';
-export { default as freezeRenderState } from './Renderer/freezeRenderState.js';
-export { default as loadCubeMap } from './Renderer/loadCubeMap.js';
-export { default as MipmapHint } from './Renderer/MipmapHint.js';
-export { default as modernizeShader } from './Renderer/modernizeShader.js';
-export { default as Pass } from './Renderer/Pass.js';
-export { default as PassState } from './Renderer/PassState.js';
-export { default as PixelDatatype } from './Renderer/PixelDatatype.js';
-export { default as Renderbuffer } from './Renderer/Renderbuffer.js';
-export { default as RenderbufferFormat } from './Renderer/RenderbufferFormat.js';
-export { default as RenderState } from './Renderer/RenderState.js';
-export { default as Sampler } from './Renderer/Sampler.js';
-export { default as ShaderCache } from './Renderer/ShaderCache.js';
-export { default as ShaderProgram } from './Renderer/ShaderProgram.js';
-export { default as ShaderSource } from './Renderer/ShaderSource.js';
-export { default as Texture } from './Renderer/Texture.js';
-export { default as TextureCache } from './Renderer/TextureCache.js';
-export { default as TextureMagnificationFilter } from './Renderer/TextureMagnificationFilter.js';
-export { default as TextureMinificationFilter } from './Renderer/TextureMinificationFilter.js';
-export { default as TextureWrap } from './Renderer/TextureWrap.js';
-export { default as UniformState } from './Renderer/UniformState.js';
-export { default as VertexArray } from './Renderer/VertexArray.js';
-export { default as VertexArrayFacade } from './Renderer/VertexArrayFacade.js';
-export { default as Appearance } from './Scene/Appearance.js';
-export { default as ArcGisMapServerImageryProvider } from './Scene/ArcGisMapServerImageryProvider.js';
-export { default as AttributeType } from './Scene/AttributeType.js';
-export { default as AutoExposure } from './Scene/AutoExposure.js';
-export { default as Axis } from './Scene/Axis.js';
-export { default as Batched3DModel3DTileContent } from './Scene/Batched3DModel3DTileContent.js';
-export { default as BatchTable } from './Scene/BatchTable.js';
-export { default as Billboard } from './Scene/Billboard.js';
-export { default as BillboardCollection } from './Scene/BillboardCollection.js';
-export { default as BingMapsImageryProvider } from './Scene/BingMapsImageryProvider.js';
-export { default as BingMapsStyle } from './Scene/BingMapsStyle.js';
-export { default as BlendEquation } from './Scene/BlendEquation.js';
-export { default as BlendFunction } from './Scene/BlendFunction.js';
-export { default as BlendingState } from './Scene/BlendingState.js';
-export { default as BlendOption } from './Scene/BlendOption.js';
-export { default as BoxEmitter } from './Scene/BoxEmitter.js';
-export { default as BrdfLutGenerator } from './Scene/BrdfLutGenerator.js';
-export { default as Camera } from './Scene/Camera.js';
-export { default as CameraEventAggregator } from './Scene/CameraEventAggregator.js';
-export { default as CameraEventType } from './Scene/CameraEventType.js';
-export { default as CameraFlightPath } from './Scene/CameraFlightPath.js';
-export { default as Cesium3DTile } from './Scene/Cesium3DTile.js';
-export { default as Cesium3DTileBatchTable } from './Scene/Cesium3DTileBatchTable.js';
-export { default as Cesium3DTileColorBlendMode } from './Scene/Cesium3DTileColorBlendMode.js';
-export { default as Cesium3DTileContent } from './Scene/Cesium3DTileContent.js';
-export { default as Cesium3DTileContentFactory } from './Scene/Cesium3DTileContentFactory.js';
-export { default as Cesium3DTileContentState } from './Scene/Cesium3DTileContentState.js';
-export { default as Cesium3DTileFeature } from './Scene/Cesium3DTileFeature.js';
-export { default as Cesium3DTileFeatureTable } from './Scene/Cesium3DTileFeatureTable.js';
-export { default as Cesium3DTileOptimizationHint } from './Scene/Cesium3DTileOptimizationHint.js';
-export { default as Cesium3DTileOptimizations } from './Scene/Cesium3DTileOptimizations.js';
-export { default as Cesium3DTilePass } from './Scene/Cesium3DTilePass.js';
-export { default as Cesium3DTilePassState } from './Scene/Cesium3DTilePassState.js';
-export { default as Cesium3DTilePointFeature } from './Scene/Cesium3DTilePointFeature.js';
-export { default as Cesium3DTileRefine } from './Scene/Cesium3DTileRefine.js';
-export { default as Cesium3DTileset } from './Scene/Cesium3DTileset.js';
-export { default as Cesium3DTilesetCache } from './Scene/Cesium3DTilesetCache.js';
-export { default as Cesium3DTilesetHeatmap } from './Scene/Cesium3DTilesetHeatmap.js';
-export { default as Cesium3DTilesetMostDetailedTraversal } from './Scene/Cesium3DTilesetMostDetailedTraversal.js';
-export { default as Cesium3DTilesetStatistics } from './Scene/Cesium3DTilesetStatistics.js';
-export { default as Cesium3DTilesetTraversal } from './Scene/Cesium3DTilesetTraversal.js';
-export { default as Cesium3DTileStyle } from './Scene/Cesium3DTileStyle.js';
-export { default as Cesium3DTileStyleEngine } from './Scene/Cesium3DTileStyleEngine.js';
-export { default as CircleEmitter } from './Scene/CircleEmitter.js';
-export { default as ClassificationModel } from './Scene/ClassificationModel.js';
-export { default as ClassificationPrimitive } from './Scene/ClassificationPrimitive.js';
-export { default as ClassificationType } from './Scene/ClassificationType.js';
-export { default as ClippingPlane } from './Scene/ClippingPlane.js';
-export { default as ClippingPlaneCollection } from './Scene/ClippingPlaneCollection.js';
-export { default as ColorBlendMode } from './Scene/ColorBlendMode.js';
-export { default as Composite3DTileContent } from './Scene/Composite3DTileContent.js';
-export { default as computeFlyToLocationForRectangle } from './Scene/computeFlyToLocationForRectangle.js';
-export { default as ConditionsExpression } from './Scene/ConditionsExpression.js';
-export { default as ConeEmitter } from './Scene/ConeEmitter.js';
-export { default as createBillboardPointCallback } from './Scene/createBillboardPointCallback.js';
-export { default as createOpenStreetMapImageryProvider } from './Scene/createOpenStreetMapImageryProvider.js';
-export { default as createTangentSpaceDebugPrimitive } from './Scene/createTangentSpaceDebugPrimitive.js';
-export { default as createTileMapServiceImageryProvider } from './Scene/createTileMapServiceImageryProvider.js';
-export { default as createWorldImagery } from './Scene/createWorldImagery.js';
-export { default as CreditDisplay } from './Scene/CreditDisplay.js';
-export { default as CullFace } from './Scene/CullFace.js';
-export { default as DebugAppearance } from './Scene/DebugAppearance.js';
-export { default as DebugCameraPrimitive } from './Scene/DebugCameraPrimitive.js';
-export { default as DebugModelMatrixPrimitive } from './Scene/DebugModelMatrixPrimitive.js';
-export { default as DepthFunction } from './Scene/DepthFunction.js';
-export { default as DepthPlane } from './Scene/DepthPlane.js';
-export { default as DerivedCommand } from './Scene/DerivedCommand.js';
-export { default as DeviceOrientationCameraController } from './Scene/DeviceOrientationCameraController.js';
-export { default as DiscardEmptyTileImagePolicy } from './Scene/DiscardEmptyTileImagePolicy.js';
-export { default as DiscardMissingTileImagePolicy } from './Scene/DiscardMissingTileImagePolicy.js';
-export { default as DracoLoader } from './Scene/DracoLoader.js';
-export { default as EllipsoidPrimitive } from './Scene/EllipsoidPrimitive.js';
-export { default as EllipsoidSurfaceAppearance } from './Scene/EllipsoidSurfaceAppearance.js';
-export { default as Empty3DTileContent } from './Scene/Empty3DTileContent.js';
-export { default as Expression } from './Scene/Expression.js';
-export { default as ExpressionNodeType } from './Scene/ExpressionNodeType.js';
-export { default as Fog } from './Scene/Fog.js';
-export { default as FrameRateMonitor } from './Scene/FrameRateMonitor.js';
-export { default as FrameState } from './Scene/FrameState.js';
-export { default as FrustumCommands } from './Scene/FrustumCommands.js';
-export { default as Geometry3DTileContent } from './Scene/Geometry3DTileContent.js';
-export { default as getBinaryAccessor } from './Scene/getBinaryAccessor.js';
-export { default as getClipAndStyleCode } from './Scene/getClipAndStyleCode.js';
-export { default as getClippingFunction } from './Scene/getClippingFunction.js';
-export { default as GetFeatureInfoFormat } from './Scene/GetFeatureInfoFormat.js';
-export { default as Globe } from './Scene/Globe.js';
-export { default as GlobeDepth } from './Scene/GlobeDepth.js';
-export { default as GlobeSurfaceShaderSet } from './Scene/GlobeSurfaceShaderSet.js';
-export { default as GlobeSurfaceTile } from './Scene/GlobeSurfaceTile.js';
-export { default as GlobeSurfaceTileProvider } from './Scene/GlobeSurfaceTileProvider.js';
-export { default as GoogleEarthEnterpriseImageryProvider } from './Scene/GoogleEarthEnterpriseImageryProvider.js';
-export { default as GoogleEarthEnterpriseMapsProvider } from './Scene/GoogleEarthEnterpriseMapsProvider.js';
-export { default as GridImageryProvider } from './Scene/GridImageryProvider.js';
-export { default as GroundPolylinePrimitive } from './Scene/GroundPolylinePrimitive.js';
-export { default as GroundPrimitive } from './Scene/GroundPrimitive.js';
-export { default as HeightReference } from './Scene/HeightReference.js';
-export { default as HorizontalOrigin } from './Scene/HorizontalOrigin.js';
-export { default as Imagery } from './Scene/Imagery.js';
-export { default as ImageryLayer } from './Scene/ImageryLayer.js';
-export { default as ImageryLayerCollection } from './Scene/ImageryLayerCollection.js';
-export { default as ImageryLayerFeatureInfo } from './Scene/ImageryLayerFeatureInfo.js';
-export { default as ImageryProvider } from './Scene/ImageryProvider.js';
-export { default as ImagerySplitDirection } from './Scene/ImagerySplitDirection.js';
-export { default as ImageryState } from './Scene/ImageryState.js';
-export { default as Instanced3DModel3DTileContent } from './Scene/Instanced3DModel3DTileContent.js';
-export { default as InvertClassification } from './Scene/InvertClassification.js';
-export { default as IonImageryProvider } from './Scene/IonImageryProvider.js';
-export { default as IonWorldImageryStyle } from './Scene/IonWorldImageryStyle.js';
-export { default as JobScheduler } from './Scene/JobScheduler.js';
-export { default as JobType } from './Scene/JobType.js';
-export { default as Label } from './Scene/Label.js';
-export { default as LabelCollection } from './Scene/LabelCollection.js';
-export { default as LabelStyle } from './Scene/LabelStyle.js';
-export { default as MapboxImageryProvider } from './Scene/MapboxImageryProvider.js';
-export { default as MapboxStyleImageryProvider } from './Scene/MapboxStyleImageryProvider.js';
-export { default as MapMode2D } from './Scene/MapMode2D.js';
-export { default as Material } from './Scene/Material.js';
-export { default as MaterialAppearance } from './Scene/MaterialAppearance.js';
-export { default as Model } from './Scene/Model.js';
-export { default as ModelAnimation } from './Scene/ModelAnimation.js';
-export { default as ModelAnimationCache } from './Scene/ModelAnimationCache.js';
-export { default as ModelAnimationCollection } from './Scene/ModelAnimationCollection.js';
-export { default as ModelAnimationLoop } from './Scene/ModelAnimationLoop.js';
-export { default as ModelAnimationState } from './Scene/ModelAnimationState.js';
-export { default as ModelInstance } from './Scene/ModelInstance.js';
-export { default as ModelInstanceCollection } from './Scene/ModelInstanceCollection.js';
-export { default as ModelLoadResources } from './Scene/ModelLoadResources.js';
-export { default as ModelMaterial } from './Scene/ModelMaterial.js';
-export { default as ModelMesh } from './Scene/ModelMesh.js';
-export { default as ModelNode } from './Scene/ModelNode.js';
-export { default as ModelUtility } from './Scene/ModelUtility.js';
-export { default as Moon } from './Scene/Moon.js';
-export { default as NeverTileDiscardPolicy } from './Scene/NeverTileDiscardPolicy.js';
-export { default as OctahedralProjectedCubeMap } from './Scene/OctahedralProjectedCubeMap.js';
-export { default as OIT } from './Scene/OIT.js';
-export { default as OpenStreetMapImageryProvider } from './Scene/OpenStreetMapImageryProvider.js';
-export { default as OrderedGroundPrimitiveCollection } from './Scene/OrderedGroundPrimitiveCollection.js';
-export { default as Particle } from './Scene/Particle.js';
-export { default as ParticleBurst } from './Scene/ParticleBurst.js';
-export { default as ParticleEmitter } from './Scene/ParticleEmitter.js';
-export { default as ParticleSystem } from './Scene/ParticleSystem.js';
-export { default as PerformanceDisplay } from './Scene/PerformanceDisplay.js';
-export { default as PerInstanceColorAppearance } from './Scene/PerInstanceColorAppearance.js';
-export { default as PickDepth } from './Scene/PickDepth.js';
-export { default as PickDepthFramebuffer } from './Scene/PickDepthFramebuffer.js';
-export { default as PickFramebuffer } from './Scene/PickFramebuffer.js';
-export { default as Picking } from './Scene/Picking.js';
-export { default as PointCloud } from './Scene/PointCloud.js';
-export { default as PointCloud3DTileContent } from './Scene/PointCloud3DTileContent.js';
-export { default as PointCloudEyeDomeLighting } from './Scene/PointCloudEyeDomeLighting.js';
-export { default as PointCloudShading } from './Scene/PointCloudShading.js';
-export { default as PointPrimitive } from './Scene/PointPrimitive.js';
-export { default as PointPrimitiveCollection } from './Scene/PointPrimitiveCollection.js';
-export { default as Polyline } from './Scene/Polyline.js';
-export { default as PolylineCollection } from './Scene/PolylineCollection.js';
-export { default as PolylineColorAppearance } from './Scene/PolylineColorAppearance.js';
-export { default as PolylineMaterialAppearance } from './Scene/PolylineMaterialAppearance.js';
-export { default as PostProcessStage } from './Scene/PostProcessStage.js';
-export { default as PostProcessStageCollection } from './Scene/PostProcessStageCollection.js';
-export { default as PostProcessStageComposite } from './Scene/PostProcessStageComposite.js';
-export { default as PostProcessStageLibrary } from './Scene/PostProcessStageLibrary.js';
-export { default as PostProcessStageSampleMode } from './Scene/PostProcessStageSampleMode.js';
-export { default as PostProcessStageTextureCache } from './Scene/PostProcessStageTextureCache.js';
-export { default as Primitive } from './Scene/Primitive.js';
-export { default as PrimitiveCollection } from './Scene/PrimitiveCollection.js';
-export { default as PrimitivePipeline } from './Scene/PrimitivePipeline.js';
-export { default as PrimitiveState } from './Scene/PrimitiveState.js';
-export { default as processModelMaterialsCommon } from './Scene/processModelMaterialsCommon.js';
-export { default as processPbrMaterials } from './Scene/processPbrMaterials.js';
-export { default as QuadtreeOccluders } from './Scene/QuadtreeOccluders.js';
-export { default as QuadtreePrimitive } from './Scene/QuadtreePrimitive.js';
-export { default as QuadtreeTile } from './Scene/QuadtreeTile.js';
-export { default as QuadtreeTileLoadState } from './Scene/QuadtreeTileLoadState.js';
-export { default as QuadtreeTileProvider } from './Scene/QuadtreeTileProvider.js';
-export { default as Scene } from './Scene/Scene.js';
-export { default as SceneFramebuffer } from './Scene/SceneFramebuffer.js';
-export { default as SceneMode } from './Scene/SceneMode.js';
-export { default as SceneTransforms } from './Scene/SceneTransforms.js';
-export { default as SceneTransitioner } from './Scene/SceneTransitioner.js';
-export { default as ScreenSpaceCameraController } from './Scene/ScreenSpaceCameraController.js';
-export { default as SDFSettings } from './Scene/SDFSettings.js';
-export { default as ShadowMap } from './Scene/ShadowMap.js';
-export { default as ShadowMapShader } from './Scene/ShadowMapShader.js';
-export { default as ShadowMode } from './Scene/ShadowMode.js';
-export { default as ShadowVolumeAppearance } from './Scene/ShadowVolumeAppearance.js';
-export { default as SingleTileImageryProvider } from './Scene/SingleTileImageryProvider.js';
-export { default as SkyAtmosphere } from './Scene/SkyAtmosphere.js';
-export { default as SkyBox } from './Scene/SkyBox.js';
-export { default as SphereEmitter } from './Scene/SphereEmitter.js';
-export { default as StencilConstants } from './Scene/StencilConstants.js';
-export { default as StencilFunction } from './Scene/StencilFunction.js';
-export { default as StencilOperation } from './Scene/StencilOperation.js';
-export { default as StyleExpression } from './Scene/StyleExpression.js';
-export { default as Sun } from './Scene/Sun.js';
-export { default as SunPostProcess } from './Scene/SunPostProcess.js';
-export { default as TerrainFillMesh } from './Scene/TerrainFillMesh.js';
-export { default as TerrainState } from './Scene/TerrainState.js';
-export { default as TextureAtlas } from './Scene/TextureAtlas.js';
-export { default as TileBoundingRegion } from './Scene/TileBoundingRegion.js';
-export { default as TileBoundingSphere } from './Scene/TileBoundingSphere.js';
-export { default as TileBoundingVolume } from './Scene/TileBoundingVolume.js';
-export { default as TileCoordinatesImageryProvider } from './Scene/TileCoordinatesImageryProvider.js';
-export { default as TileDiscardPolicy } from './Scene/TileDiscardPolicy.js';
-export { default as TileImagery } from './Scene/TileImagery.js';
-export { default as TileMapServiceImageryProvider } from './Scene/TileMapServiceImageryProvider.js';
-export { default as TileOrientedBoundingBox } from './Scene/TileOrientedBoundingBox.js';
-export { default as TileReplacementQueue } from './Scene/TileReplacementQueue.js';
-export { default as TileSelectionResult } from './Scene/TileSelectionResult.js';
-export { default as Tileset3DTileContent } from './Scene/Tileset3DTileContent.js';
-export { default as TileState } from './Scene/TileState.js';
-export { default as TimeDynamicImagery } from './Scene/TimeDynamicImagery.js';
-export { default as TimeDynamicPointCloud } from './Scene/TimeDynamicPointCloud.js';
-export { default as Tonemapper } from './Scene/Tonemapper.js';
-export { default as TweenCollection } from './Scene/TweenCollection.js';
-export { default as UrlTemplateImageryProvider } from './Scene/UrlTemplateImageryProvider.js';
-export { default as Vector3DTileBatch } from './Scene/Vector3DTileBatch.js';
-export { default as Vector3DTileContent } from './Scene/Vector3DTileContent.js';
-export { default as Vector3DTileGeometry } from './Scene/Vector3DTileGeometry.js';
-export { default as Vector3DTilePoints } from './Scene/Vector3DTilePoints.js';
-export { default as Vector3DTilePolygons } from './Scene/Vector3DTilePolygons.js';
-export { default as Vector3DTilePolylines } from './Scene/Vector3DTilePolylines.js';
-export { default as Vector3DTilePrimitive } from './Scene/Vector3DTilePrimitive.js';
-export { default as VerticalOrigin } from './Scene/VerticalOrigin.js';
-export { default as View } from './Scene/View.js';
-export { default as ViewportQuad } from './Scene/ViewportQuad.js';
-export { default as WebMapServiceImageryProvider } from './Scene/WebMapServiceImageryProvider.js';
-export { default as WebMapTileServiceImageryProvider } from './Scene/WebMapTileServiceImageryProvider.js';
-export { default as _shadersAdjustTranslucentFS } from './Shaders/AdjustTranslucentFS.js';
-export { default as _shadersBillboardCollectionFS } from './Shaders/BillboardCollectionFS.js';
-export { default as _shadersBillboardCollectionVS } from './Shaders/BillboardCollectionVS.js';
-export { default as _shadersBrdfLutGeneratorFS } from './Shaders/BrdfLutGeneratorFS.js';
-export { default as _shadersCheckFloatTexturePrecisionFS } from './Shaders/CheckFloatTexturePrecisionFS.js';
-export { default as _shadersCompositeOITFS } from './Shaders/CompositeOITFS.js';
-export { default as _shadersDepthPlaneFS } from './Shaders/DepthPlaneFS.js';
-export { default as _shadersDepthPlaneVS } from './Shaders/DepthPlaneVS.js';
-export { default as _shadersEllipsoidFS } from './Shaders/EllipsoidFS.js';
-export { default as _shadersEllipsoidVS } from './Shaders/EllipsoidVS.js';
-export { default as _shadersGlobeFS } from './Shaders/GlobeFS.js';
-export { default as _shadersGlobeVS } from './Shaders/GlobeVS.js';
-export { default as _shadersGroundAtmosphere } from './Shaders/GroundAtmosphere.js';
-export { default as _shadersOctahedralProjectionAtlasFS } from './Shaders/OctahedralProjectionAtlasFS.js';
-export { default as _shadersOctahedralProjectionFS } from './Shaders/OctahedralProjectionFS.js';
-export { default as _shadersOctahedralProjectionVS } from './Shaders/OctahedralProjectionVS.js';
-export { default as _shadersPointPrimitiveCollectionFS } from './Shaders/PointPrimitiveCollectionFS.js';
-export { default as _shadersPointPrimitiveCollectionVS } from './Shaders/PointPrimitiveCollectionVS.js';
-export { default as _shadersPolylineCommon } from './Shaders/PolylineCommon.js';
-export { default as _shadersPolylineFS } from './Shaders/PolylineFS.js';
-export { default as _shadersPolylineShadowVolumeFS } from './Shaders/PolylineShadowVolumeFS.js';
-export { default as _shadersPolylineShadowVolumeMorphFS } from './Shaders/PolylineShadowVolumeMorphFS.js';
-export { default as _shadersPolylineShadowVolumeMorphVS } from './Shaders/PolylineShadowVolumeMorphVS.js';
-export { default as _shadersPolylineShadowVolumeVS } from './Shaders/PolylineShadowVolumeVS.js';
-export { default as _shadersPolylineVS } from './Shaders/PolylineVS.js';
-export { default as _shadersReprojectWebMercatorFS } from './Shaders/ReprojectWebMercatorFS.js';
-export { default as _shadersReprojectWebMercatorVS } from './Shaders/ReprojectWebMercatorVS.js';
-export { default as _shadersShadowVolumeAppearanceFS } from './Shaders/ShadowVolumeAppearanceFS.js';
-export { default as _shadersShadowVolumeAppearanceVS } from './Shaders/ShadowVolumeAppearanceVS.js';
-export { default as _shadersShadowVolumeFS } from './Shaders/ShadowVolumeFS.js';
-export { default as _shadersSkyAtmosphereFS } from './Shaders/SkyAtmosphereFS.js';
-export { default as _shadersSkyAtmosphereVS } from './Shaders/SkyAtmosphereVS.js';
-export { default as _shadersSkyBoxFS } from './Shaders/SkyBoxFS.js';
-export { default as _shadersSkyBoxVS } from './Shaders/SkyBoxVS.js';
-export { default as _shadersSunFS } from './Shaders/SunFS.js';
-export { default as _shadersSunTextureFS } from './Shaders/SunTextureFS.js';
-export { default as _shadersSunVS } from './Shaders/SunVS.js';
-export { default as _shadersVector3DTilePolylinesVS } from './Shaders/Vector3DTilePolylinesVS.js';
-export { default as _shadersVectorTileVS } from './Shaders/VectorTileVS.js';
-export { default as _shadersViewportQuadFS } from './Shaders/ViewportQuadFS.js';
-export { default as _shadersViewportQuadVS } from './Shaders/ViewportQuadVS.js';
-export { default as Autolinker } from './ThirdParty/Autolinker.js';
-export { default as bitmap_sdf } from './ThirdParty/bitmap-sdf.js';
-export { default as earcut_2_1_1 } from './ThirdParty/earcut-2.1.1.js';
-export { default as graphemesplitter } from './ThirdParty/graphemesplitter.js';
-export { default as jsep } from './ThirdParty/jsep.js';
-export { default as kdbush } from './ThirdParty/kdbush.js';
-export { default as knockout_3_5_0 } from './ThirdParty/knockout-3.5.0.js';
-export { default as knockout_es5 } from './ThirdParty/knockout-es5.js';
-export { default as knockout } from './ThirdParty/knockout.js';
-export { default as LercDecode } from './ThirdParty/LercDecode.js';
-export { default as measureText } from './ThirdParty/measureText.js';
-export { default as mersenne_twister } from './ThirdParty/mersenne-twister.js';
-export { default as NoSleep } from './ThirdParty/NoSleep.js';
-export { default as protobuf_minimal } from './ThirdParty/protobuf-minimal.js';
-export { default as purify } from './ThirdParty/purify.js';
-export { default as quickselect } from './ThirdParty/quickselect.js';
-export { default as rbush } from './ThirdParty/rbush.js';
-export { default as sprintf } from './ThirdParty/sprintf.js';
-export { default as topojson } from './ThirdParty/topojson.js';
-export { default as Tween } from './ThirdParty/Tween.js';
-export { default as Uri } from './ThirdParty/Uri.js';
-export { default as when } from './ThirdParty/when.js';
-export { default as zip } from './ThirdParty/zip.js';
-export { default as ClockViewModel } from './Widgets/ClockViewModel.js';
-export { default as Command } from './Widgets/Command.js';
-export { default as createCommand } from './Widgets/createCommand.js';
-export { default as getElement } from './Widgets/getElement.js';
-export { default as InspectorShared } from './Widgets/InspectorShared.js';
-export { default as subscribeAndEvaluate } from './Widgets/subscribeAndEvaluate.js';
-export { default as SvgPathBindingHandler } from './Widgets/SvgPathBindingHandler.js';
-export { default as ToggleButtonViewModel } from './Widgets/ToggleButtonViewModel.js';
-export { default as _shadersAllMaterialAppearanceFS } from './Shaders/Appearances/AllMaterialAppearanceFS.js';
-export { default as _shadersAllMaterialAppearanceVS } from './Shaders/Appearances/AllMaterialAppearanceVS.js';
-export { default as _shadersBasicMaterialAppearanceFS } from './Shaders/Appearances/BasicMaterialAppearanceFS.js';
-export { default as _shadersBasicMaterialAppearanceVS } from './Shaders/Appearances/BasicMaterialAppearanceVS.js';
-export { default as _shadersEllipsoidSurfaceAppearanceFS } from './Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js';
-export { default as _shadersEllipsoidSurfaceAppearanceVS } from './Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js';
-export { default as _shadersPerInstanceColorAppearanceFS } from './Shaders/Appearances/PerInstanceColorAppearanceFS.js';
-export { default as _shadersPerInstanceColorAppearanceVS } from './Shaders/Appearances/PerInstanceColorAppearanceVS.js';
-export { default as _shadersPerInstanceFlatColorAppearanceFS } from './Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js';
-export { default as _shadersPerInstanceFlatColorAppearanceVS } from './Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js';
-export { default as _shadersPolylineColorAppearanceVS } from './Shaders/Appearances/PolylineColorAppearanceVS.js';
-export { default as _shadersPolylineMaterialAppearanceVS } from './Shaders/Appearances/PolylineMaterialAppearanceVS.js';
-export { default as _shadersTexturedMaterialAppearanceFS } from './Shaders/Appearances/TexturedMaterialAppearanceFS.js';
-export { default as _shadersTexturedMaterialAppearanceVS } from './Shaders/Appearances/TexturedMaterialAppearanceVS.js';
-export { default as _shadersCzmBuiltins } from './Shaders/Builtin/CzmBuiltins.js';
-export { default as _shadersAspectRampMaterial } from './Shaders/Materials/AspectRampMaterial.js';
-export { default as _shadersBumpMapMaterial } from './Shaders/Materials/BumpMapMaterial.js';
-export { default as _shadersCheckerboardMaterial } from './Shaders/Materials/CheckerboardMaterial.js';
-export { default as _shadersDotMaterial } from './Shaders/Materials/DotMaterial.js';
-export { default as _shadersElevationContourMaterial } from './Shaders/Materials/ElevationContourMaterial.js';
-export { default as _shadersElevationRampMaterial } from './Shaders/Materials/ElevationRampMaterial.js';
-export { default as _shadersFadeMaterial } from './Shaders/Materials/FadeMaterial.js';
-export { default as _shadersGridMaterial } from './Shaders/Materials/GridMaterial.js';
-export { default as _shadersNormalMapMaterial } from './Shaders/Materials/NormalMapMaterial.js';
-export { default as _shadersPolylineArrowMaterial } from './Shaders/Materials/PolylineArrowMaterial.js';
-export { default as _shadersPolylineDashMaterial } from './Shaders/Materials/PolylineDashMaterial.js';
-export { default as _shadersPolylineGlowMaterial } from './Shaders/Materials/PolylineGlowMaterial.js';
-export { default as _shadersPolylineOutlineMaterial } from './Shaders/Materials/PolylineOutlineMaterial.js';
-export { default as _shadersRimLightingMaterial } from './Shaders/Materials/RimLightingMaterial.js';
-export { default as _shadersSlopeRampMaterial } from './Shaders/Materials/SlopeRampMaterial.js';
-export { default as _shadersStripeMaterial } from './Shaders/Materials/StripeMaterial.js';
-export { default as _shadersWater } from './Shaders/Materials/Water.js';
-export { default as _shadersAcesTonemappingStage } from './Shaders/PostProcessStages/AcesTonemappingStage.js';
-export { default as _shadersAdditiveBlend } from './Shaders/PostProcessStages/AdditiveBlend.js';
-export { default as _shadersAmbientOcclusionGenerate } from './Shaders/PostProcessStages/AmbientOcclusionGenerate.js';
-export { default as _shadersAmbientOcclusionModulate } from './Shaders/PostProcessStages/AmbientOcclusionModulate.js';
-export { default as _shadersBlackAndWhite } from './Shaders/PostProcessStages/BlackAndWhite.js';
-export { default as _shadersBloomComposite } from './Shaders/PostProcessStages/BloomComposite.js';
-export { default as _shadersBrightness } from './Shaders/PostProcessStages/Brightness.js';
-export { default as _shadersBrightPass } from './Shaders/PostProcessStages/BrightPass.js';
-export { default as _shadersContrastBias } from './Shaders/PostProcessStages/ContrastBias.js';
-export { default as _shadersDepthOfField } from './Shaders/PostProcessStages/DepthOfField.js';
-export { default as _shadersDepthView } from './Shaders/PostProcessStages/DepthView.js';
-export { default as _shadersDepthViewPacked } from './Shaders/PostProcessStages/DepthViewPacked.js';
-export { default as _shadersEdgeDetection } from './Shaders/PostProcessStages/EdgeDetection.js';
-export { default as _shadersFilmicTonemapping } from './Shaders/PostProcessStages/FilmicTonemapping.js';
-export { default as _shadersFXAA } from './Shaders/PostProcessStages/FXAA.js';
-export { default as _shadersGaussianBlur1D } from './Shaders/PostProcessStages/GaussianBlur1D.js';
-export { default as _shadersLensFlare } from './Shaders/PostProcessStages/LensFlare.js';
-export { default as _shadersModifiedReinhardTonemapping } from './Shaders/PostProcessStages/ModifiedReinhardTonemapping.js';
-export { default as _shadersNightVision } from './Shaders/PostProcessStages/NightVision.js';
-export { default as _shadersPassThrough } from './Shaders/PostProcessStages/PassThrough.js';
-export { default as _shadersPassThroughDepth } from './Shaders/PostProcessStages/PassThroughDepth.js';
-export { default as _shadersPointCloudEyeDomeLighting } from './Shaders/PostProcessStages/PointCloudEyeDomeLighting.js';
-export { default as _shadersReinhardTonemapping } from './Shaders/PostProcessStages/ReinhardTonemapping.js';
-export { default as _shadersSilhouette } from './Shaders/PostProcessStages/Silhouette.js';
-export { default as addBuffer } from './ThirdParty/GltfPipeline/addBuffer.js';
-export { default as addDefaults } from './ThirdParty/GltfPipeline/addDefaults.js';
-export { default as addExtensionsRequired } from './ThirdParty/GltfPipeline/addExtensionsRequired.js';
-export { default as addExtensionsUsed } from './ThirdParty/GltfPipeline/addExtensionsUsed.js';
-export { default as addPipelineExtras } from './ThirdParty/GltfPipeline/addPipelineExtras.js';
-export { default as addToArray } from './ThirdParty/GltfPipeline/addToArray.js';
-export { default as findAccessorMinMax } from './ThirdParty/GltfPipeline/findAccessorMinMax.js';
-export { default as ForEach } from './ThirdParty/GltfPipeline/ForEach.js';
-export { default as getAccessorByteStride } from './ThirdParty/GltfPipeline/getAccessorByteStride.js';
-export { default as getComponentReader } from './ThirdParty/GltfPipeline/getComponentReader.js';
-export { default as hasExtension } from './ThirdParty/GltfPipeline/hasExtension.js';
-export { default as moveTechniqueRenderStates } from './ThirdParty/GltfPipeline/moveTechniqueRenderStates.js';
-export { default as moveTechniquesToExtension } from './ThirdParty/GltfPipeline/moveTechniquesToExtension.js';
-export { default as numberOfComponentsForType } from './ThirdParty/GltfPipeline/numberOfComponentsForType.js';
-export { default as parseGlb } from './ThirdParty/GltfPipeline/parseGlb.js';
-export { default as readAccessorPacked } from './ThirdParty/GltfPipeline/readAccessorPacked.js';
-export { default as removeExtensionsRequired } from './ThirdParty/GltfPipeline/removeExtensionsRequired.js';
-export { default as removeExtensionsUsed } from './ThirdParty/GltfPipeline/removeExtensionsUsed.js';
-export { default as removePipelineExtras } from './ThirdParty/GltfPipeline/removePipelineExtras.js';
-export { default as removeUnusedElements } from './ThirdParty/GltfPipeline/removeUnusedElements.js';
-export { default as updateAccessorComponentTypes } from './ThirdParty/GltfPipeline/updateAccessorComponentTypes.js';
-export { default as updateVersion } from './ThirdParty/GltfPipeline/updateVersion.js';
-export { default as FXAA3_11 } from './ThirdParty/Shaders/FXAA3_11.js';
-export { default as Animation } from './Widgets/Animation/Animation.js';
-export { default as AnimationViewModel } from './Widgets/Animation/AnimationViewModel.js';
-export { default as BaseLayerPicker } from './Widgets/BaseLayerPicker/BaseLayerPicker.js';
-export { default as BaseLayerPickerViewModel } from './Widgets/BaseLayerPicker/BaseLayerPickerViewModel.js';
-export { default as createDefaultImageryProviderViewModels } from './Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels.js';
-export { default as createDefaultTerrainProviderViewModels } from './Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels.js';
-export { default as ProviderViewModel } from './Widgets/BaseLayerPicker/ProviderViewModel.js';
-export { default as Cesium3DTilesInspector } from './Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.js';
-export { default as Cesium3DTilesInspectorViewModel } from './Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js';
-export { default as CesiumInspector } from './Widgets/CesiumInspector/CesiumInspector.js';
-export { default as CesiumInspectorViewModel } from './Widgets/CesiumInspector/CesiumInspectorViewModel.js';
-export { default as CesiumWidget } from './Widgets/CesiumWidget/CesiumWidget.js';
-export { default as FullscreenButton } from './Widgets/FullscreenButton/FullscreenButton.js';
-export { default as FullscreenButtonViewModel } from './Widgets/FullscreenButton/FullscreenButtonViewModel.js';
-export { default as Geocoder } from './Widgets/Geocoder/Geocoder.js';
-export { default as GeocoderViewModel } from './Widgets/Geocoder/GeocoderViewModel.js';
-export { default as HomeButton } from './Widgets/HomeButton/HomeButton.js';
-export { default as HomeButtonViewModel } from './Widgets/HomeButton/HomeButtonViewModel.js';
-export { default as InfoBox } from './Widgets/InfoBox/InfoBox.js';
-export { default as InfoBoxViewModel } from './Widgets/InfoBox/InfoBoxViewModel.js';
-export { default as NavigationHelpButton } from './Widgets/NavigationHelpButton/NavigationHelpButton.js';
-export { default as NavigationHelpButtonViewModel } from './Widgets/NavigationHelpButton/NavigationHelpButtonViewModel.js';
-export { default as PerformanceWatchdog } from './Widgets/PerformanceWatchdog/PerformanceWatchdog.js';
-export { default as PerformanceWatchdogViewModel } from './Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel.js';
-export { default as ProjectionPicker } from './Widgets/ProjectionPicker/ProjectionPicker.js';
-export { default as ProjectionPickerViewModel } from './Widgets/ProjectionPicker/ProjectionPickerViewModel.js';
-export { default as SceneModePicker } from './Widgets/SceneModePicker/SceneModePicker.js';
-export { default as SceneModePickerViewModel } from './Widgets/SceneModePicker/SceneModePickerViewModel.js';
-export { default as SelectionIndicator } from './Widgets/SelectionIndicator/SelectionIndicator.js';
-export { default as SelectionIndicatorViewModel } from './Widgets/SelectionIndicator/SelectionIndicatorViewModel.js';
-export { default as Timeline } from './Widgets/Timeline/Timeline.js';
-export { default as TimelineHighlightRange } from './Widgets/Timeline/TimelineHighlightRange.js';
-export { default as TimelineTrack } from './Widgets/Timeline/TimelineTrack.js';
-export { default as Viewer } from './Widgets/Viewer/Viewer.js';
-export { default as viewerCesium3DTilesInspectorMixin } from './Widgets/Viewer/viewerCesium3DTilesInspectorMixin.js';
-export { default as viewerCesiumInspectorMixin } from './Widgets/Viewer/viewerCesiumInspectorMixin.js';
-export { default as viewerDragDropMixin } from './Widgets/Viewer/viewerDragDropMixin.js';
-export { default as viewerPerformanceWatchdogMixin } from './Widgets/Viewer/viewerPerformanceWatchdogMixin.js';
-export { default as VRButton } from './Widgets/VRButton/VRButton.js';
-export { default as VRButtonViewModel } from './Widgets/VRButton/VRButtonViewModel.js';
-export { default as _shadersdegreesPerRadian } from './Shaders/Builtin/Constants/degreesPerRadian.js';
-export { default as _shadersdepthRange } from './Shaders/Builtin/Constants/depthRange.js';
-export { default as _shadersellipsoidInverseRadii } from './Shaders/Builtin/Constants/ellipsoidInverseRadii.js';
-export { default as _shadersellipsoidRadii } from './Shaders/Builtin/Constants/ellipsoidRadii.js';
-export { default as _shadersepsilon1 } from './Shaders/Builtin/Constants/epsilon1.js';
-export { default as _shadersepsilon2 } from './Shaders/Builtin/Constants/epsilon2.js';
-export { default as _shadersepsilon3 } from './Shaders/Builtin/Constants/epsilon3.js';
-export { default as _shadersepsilon4 } from './Shaders/Builtin/Constants/epsilon4.js';
-export { default as _shadersepsilon5 } from './Shaders/Builtin/Constants/epsilon5.js';
-export { default as _shadersepsilon6 } from './Shaders/Builtin/Constants/epsilon6.js';
-export { default as _shadersepsilon7 } from './Shaders/Builtin/Constants/epsilon7.js';
-export { default as _shadersinfinity } from './Shaders/Builtin/Constants/infinity.js';
-export { default as _shadersoneOverPi } from './Shaders/Builtin/Constants/oneOverPi.js';
-export { default as _shadersoneOverTwoPi } from './Shaders/Builtin/Constants/oneOverTwoPi.js';
-export { default as _shaderspassCesium3DTile } from './Shaders/Builtin/Constants/passCesium3DTile.js';
-export { default as _shaderspassCesium3DTileClassification } from './Shaders/Builtin/Constants/passCesium3DTileClassification.js';
-export { default as _shaderspassCesium3DTileClassificationIgnoreShow } from './Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js';
-export { default as _shaderspassClassification } from './Shaders/Builtin/Constants/passClassification.js';
-export { default as _shaderspassCompute } from './Shaders/Builtin/Constants/passCompute.js';
-export { default as _shaderspassEnvironment } from './Shaders/Builtin/Constants/passEnvironment.js';
-export { default as _shaderspassGlobe } from './Shaders/Builtin/Constants/passGlobe.js';
-export { default as _shaderspassOpaque } from './Shaders/Builtin/Constants/passOpaque.js';
-export { default as _shaderspassOverlay } from './Shaders/Builtin/Constants/passOverlay.js';
-export { default as _shaderspassTerrainClassification } from './Shaders/Builtin/Constants/passTerrainClassification.js';
-export { default as _shaderspassTranslucent } from './Shaders/Builtin/Constants/passTranslucent.js';
-export { default as _shaderspi } from './Shaders/Builtin/Constants/pi.js';
-export { default as _shaderspiOverFour } from './Shaders/Builtin/Constants/piOverFour.js';
-export { default as _shaderspiOverSix } from './Shaders/Builtin/Constants/piOverSix.js';
-export { default as _shaderspiOverThree } from './Shaders/Builtin/Constants/piOverThree.js';
-export { default as _shaderspiOverTwo } from './Shaders/Builtin/Constants/piOverTwo.js';
-export { default as _shadersradiansPerDegree } from './Shaders/Builtin/Constants/radiansPerDegree.js';
-export { default as _shaderssceneMode2D } from './Shaders/Builtin/Constants/sceneMode2D.js';
-export { default as _shaderssceneMode3D } from './Shaders/Builtin/Constants/sceneMode3D.js';
-export { default as _shaderssceneModeColumbusView } from './Shaders/Builtin/Constants/sceneModeColumbusView.js';
-export { default as _shaderssceneModeMorphing } from './Shaders/Builtin/Constants/sceneModeMorphing.js';
-export { default as _shaderssolarRadius } from './Shaders/Builtin/Constants/solarRadius.js';
-export { default as _shadersthreePiOver2 } from './Shaders/Builtin/Constants/threePiOver2.js';
-export { default as _shaderstwoPi } from './Shaders/Builtin/Constants/twoPi.js';
-export { default as _shaderswebMercatorMaxLatitude } from './Shaders/Builtin/Constants/webMercatorMaxLatitude.js';
-export { default as _shadersacesTonemapping } from './Shaders/Builtin/Functions/acesTonemapping.js';
-export { default as _shadersalphaWeight } from './Shaders/Builtin/Functions/alphaWeight.js';
-export { default as _shadersantialias } from './Shaders/Builtin/Functions/antialias.js';
-export { default as _shadersapproximateSphericalCoordinates } from './Shaders/Builtin/Functions/approximateSphericalCoordinates.js';
-export { default as _shadersbranchFreeTernary } from './Shaders/Builtin/Functions/branchFreeTernary.js';
-export { default as _shaderscascadeColor } from './Shaders/Builtin/Functions/cascadeColor.js';
-export { default as _shaderscascadeDistance } from './Shaders/Builtin/Functions/cascadeDistance.js';
-export { default as _shaderscascadeMatrix } from './Shaders/Builtin/Functions/cascadeMatrix.js';
-export { default as _shaderscascadeWeights } from './Shaders/Builtin/Functions/cascadeWeights.js';
-export { default as _shaderscolumbusViewMorph } from './Shaders/Builtin/Functions/columbusViewMorph.js';
-export { default as _shaderscomputePosition } from './Shaders/Builtin/Functions/computePosition.js';
-export { default as _shaderscosineAndSine } from './Shaders/Builtin/Functions/cosineAndSine.js';
-export { default as _shadersdecompressTextureCoordinates } from './Shaders/Builtin/Functions/decompressTextureCoordinates.js';
-export { default as _shadersdepthClampFarPlane } from './Shaders/Builtin/Functions/depthClampFarPlane.js';
-export { default as _shaderseastNorthUpToEyeCoordinates } from './Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js';
-export { default as _shadersellipsoidContainsPoint } from './Shaders/Builtin/Functions/ellipsoidContainsPoint.js';
-export { default as _shadersellipsoidWgs84TextureCoordinates } from './Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js';
-export { default as _shadersequalsEpsilon } from './Shaders/Builtin/Functions/equalsEpsilon.js';
-export { default as _shaderseyeOffset } from './Shaders/Builtin/Functions/eyeOffset.js';
-export { default as _shaderseyeToWindowCoordinates } from './Shaders/Builtin/Functions/eyeToWindowCoordinates.js';
-export { default as _shadersfastApproximateAtan } from './Shaders/Builtin/Functions/fastApproximateAtan.js';
-export { default as _shadersfog } from './Shaders/Builtin/Functions/fog.js';
-export { default as _shadersgammaCorrect } from './Shaders/Builtin/Functions/gammaCorrect.js';
-export { default as _shadersgeodeticSurfaceNormal } from './Shaders/Builtin/Functions/geodeticSurfaceNormal.js';
-export { default as _shadersgetDefaultMaterial } from './Shaders/Builtin/Functions/getDefaultMaterial.js';
-export { default as _shadersgetLambertDiffuse } from './Shaders/Builtin/Functions/getLambertDiffuse.js';
-export { default as _shadersgetSpecular } from './Shaders/Builtin/Functions/getSpecular.js';
-export { default as _shadersgetWaterNoise } from './Shaders/Builtin/Functions/getWaterNoise.js';
-export { default as _shadersHSBToRGB } from './Shaders/Builtin/Functions/HSBToRGB.js';
-export { default as _shadersHSLToRGB } from './Shaders/Builtin/Functions/HSLToRGB.js';
-export { default as _shadershue } from './Shaders/Builtin/Functions/hue.js';
-export { default as _shadersinverseGamma } from './Shaders/Builtin/Functions/inverseGamma.js';
-export { default as _shadersisEmpty } from './Shaders/Builtin/Functions/isEmpty.js';
-export { default as _shadersisFull } from './Shaders/Builtin/Functions/isFull.js';
-export { default as _shaderslatitudeToWebMercatorFraction } from './Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js';
-export { default as _shaderslineDistance } from './Shaders/Builtin/Functions/lineDistance.js';
-export { default as _shadersluminance } from './Shaders/Builtin/Functions/luminance.js';
-export { default as _shadersmetersPerPixel } from './Shaders/Builtin/Functions/metersPerPixel.js';
-export { default as _shadersmodelToWindowCoordinates } from './Shaders/Builtin/Functions/modelToWindowCoordinates.js';
-export { default as _shadersmultiplyWithColorBalance } from './Shaders/Builtin/Functions/multiplyWithColorBalance.js';
-export { default as _shadersnearFarScalar } from './Shaders/Builtin/Functions/nearFarScalar.js';
-export { default as _shadersoctDecode } from './Shaders/Builtin/Functions/octDecode.js';
-export { default as _shaderspackDepth } from './Shaders/Builtin/Functions/packDepth.js';
-export { default as _shadersphong } from './Shaders/Builtin/Functions/phong.js';
-export { default as _shadersplaneDistance } from './Shaders/Builtin/Functions/planeDistance.js';
-export { default as _shaderspointAlongRay } from './Shaders/Builtin/Functions/pointAlongRay.js';
-export { default as _shadersrayEllipsoidIntersectionInterval } from './Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js';
-export { default as _shadersreadDepth } from './Shaders/Builtin/Functions/readDepth.js';
-export { default as _shadersreverseLogDepth } from './Shaders/Builtin/Functions/reverseLogDepth.js';
-export { default as _shadersRGBToHSB } from './Shaders/Builtin/Functions/RGBToHSB.js';
-export { default as _shadersRGBToHSL } from './Shaders/Builtin/Functions/RGBToHSL.js';
-export { default as _shadersRGBToXYZ } from './Shaders/Builtin/Functions/RGBToXYZ.js';
-export { default as _shaderssampleOctahedralProjection } from './Shaders/Builtin/Functions/sampleOctahedralProjection.js';
-export { default as _shaderssaturation } from './Shaders/Builtin/Functions/saturation.js';
-export { default as _shadersshadowDepthCompare } from './Shaders/Builtin/Functions/shadowDepthCompare.js';
-export { default as _shadersshadowVisibility } from './Shaders/Builtin/Functions/shadowVisibility.js';
-export { default as _shaderssignNotZero } from './Shaders/Builtin/Functions/signNotZero.js';
-export { default as _shaderssphericalHarmonics } from './Shaders/Builtin/Functions/sphericalHarmonics.js';
-export { default as _shaderstangentToEyeSpaceMatrix } from './Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js';
-export { default as _shaderstransformPlane } from './Shaders/Builtin/Functions/transformPlane.js';
-export { default as _shaderstranslateRelativeToEye } from './Shaders/Builtin/Functions/translateRelativeToEye.js';
-export { default as _shaderstranslucentPhong } from './Shaders/Builtin/Functions/translucentPhong.js';
-export { default as _shaderstranspose } from './Shaders/Builtin/Functions/transpose.js';
-export { default as _shadersunpackDepth } from './Shaders/Builtin/Functions/unpackDepth.js';
-export { default as _shadersunpackFloat } from './Shaders/Builtin/Functions/unpackFloat.js';
-export { default as _shadersvertexLogDepth } from './Shaders/Builtin/Functions/vertexLogDepth.js';
-export { default as _shaderswindowToEyeCoordinates } from './Shaders/Builtin/Functions/windowToEyeCoordinates.js';
-export { default as _shaderswriteDepthClampedToFarPlane } from './Shaders/Builtin/Functions/writeDepthClampedToFarPlane.js';
-export { default as _shaderswriteLogDepth } from './Shaders/Builtin/Functions/writeLogDepth.js';
-export { default as _shadersXYZToRGB } from './Shaders/Builtin/Functions/XYZToRGB.js';
-export { default as _shadersdepthRangeStruct } from './Shaders/Builtin/Structs/depthRangeStruct.js';
-export { default as _shadersmaterial } from './Shaders/Builtin/Structs/material.js';
-export { default as _shadersmaterialInput } from './Shaders/Builtin/Structs/materialInput.js';
-export { default as _shadersray } from './Shaders/Builtin/Structs/ray.js';
-export { default as _shadersraySegment } from './Shaders/Builtin/Structs/raySegment.js';
-export { default as _shadersshadowParameters } from './Shaders/Builtin/Structs/shadowParameters.js';
-export { default as createTaskProcessorWorker } from './WorkersES6/createTaskProcessorWorker.js';

+ 0 - 201
Source/Core/ApproximateTerrainHeights.js

@@ -1,201 +0,0 @@
-import BoundingSphere from './BoundingSphere.js';
-import buildModuleUrl from './buildModuleUrl.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Cartographic from './Cartographic.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-import GeographicTilingScheme from './GeographicTilingScheme.js';
-import Rectangle from './Rectangle.js';
-import Resource from './Resource.js';
-
-    var scratchDiagonalCartesianNE = new Cartesian3();
-    var scratchDiagonalCartesianSW = new Cartesian3();
-    var scratchDiagonalCartographic = new Cartographic();
-    var scratchCenterCartesian = new Cartesian3();
-    var scratchSurfaceCartesian = new Cartesian3();
-
-    var scratchBoundingSphere = new BoundingSphere();
-    var tilingScheme = new GeographicTilingScheme();
-    var scratchCorners = [new Cartographic(), new Cartographic(), new Cartographic(), new Cartographic()];
-    var scratchTileXY = new Cartesian2();
-
-    /**
-     * A collection of functions for approximating terrain height
-     * @private
-     */
-    var ApproximateTerrainHeights = {};
-
-    /**
-     * Initializes the minimum and maximum terrain heights
-     * @return {Promise}
-     */
-    ApproximateTerrainHeights.initialize = function() {
-        var initPromise = ApproximateTerrainHeights._initPromise;
-        if (defined(initPromise)) {
-            return initPromise;
-        }
-
-        initPromise = Resource.fetchJson(buildModuleUrl('Assets/approximateTerrainHeights.json'))
-            .then(function(json) {
-                ApproximateTerrainHeights._terrainHeights = json;
-            });
-        ApproximateTerrainHeights._initPromise = initPromise;
-
-        return initPromise;
-    };
-
-    /**
-     * Computes the minimum and maximum terrain heights for a given rectangle
-     * @param {Rectangle} rectangle The bounding rectangle
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
-     * @return {{minimumTerrainHeight: Number, maximumTerrainHeight: Number}}
-     */
-    ApproximateTerrainHeights.getMinimumMaximumHeights = function(rectangle, ellipsoid) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('rectangle', rectangle);
-        if (!defined(ApproximateTerrainHeights._terrainHeights)) {
-            throw new DeveloperError('You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function');
-        }
-        //>>includeEnd('debug');
-        ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
-
-        var xyLevel = getTileXYLevel(rectangle);
-
-        // Get the terrain min/max for that tile
-        var minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
-        var maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
-        if (defined(xyLevel)) {
-            var key = xyLevel.level + '-' + xyLevel.x + '-' + xyLevel.y;
-            var heights = ApproximateTerrainHeights._terrainHeights[key];
-            if (defined(heights)) {
-                minTerrainHeight = heights[0];
-                maxTerrainHeight = heights[1];
-            }
-
-            // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface
-            ellipsoid.cartographicToCartesian(Rectangle.northeast(rectangle, scratchDiagonalCartographic),
-                scratchDiagonalCartesianNE);
-            ellipsoid.cartographicToCartesian(Rectangle.southwest(rectangle, scratchDiagonalCartographic),
-                scratchDiagonalCartesianSW);
-
-            Cartesian3.midpoint(scratchDiagonalCartesianSW, scratchDiagonalCartesianNE, scratchCenterCartesian);
-            var surfacePosition = ellipsoid.scaleToGeodeticSurface(scratchCenterCartesian, scratchSurfaceCartesian);
-            if (defined(surfacePosition)) {
-                var distance = Cartesian3.distance(scratchCenterCartesian, surfacePosition);
-                minTerrainHeight = Math.min(minTerrainHeight, -distance);
-            } else {
-                minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
-            }
-        }
-
-        minTerrainHeight = Math.max(ApproximateTerrainHeights._defaultMinTerrainHeight, minTerrainHeight);
-
-        return {
-            minimumTerrainHeight: minTerrainHeight,
-            maximumTerrainHeight: maxTerrainHeight
-        };
-    };
-
-    /**
-     * Computes the bounding sphere based on the tile heights in the rectangle
-     * @param {Rectangle} rectangle The bounding rectangle
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
-     * @return {BoundingSphere} The result bounding sphere
-     */
-    ApproximateTerrainHeights.getBoundingSphere = function(rectangle, ellipsoid) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('rectangle', rectangle);
-        if (!defined(ApproximateTerrainHeights._terrainHeights)) {
-            throw new DeveloperError('You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function');
-        }
-        //>>includeEnd('debug');
-        ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
-
-        var xyLevel = getTileXYLevel(rectangle);
-
-        // Get the terrain max for that tile
-        var maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
-        if (defined(xyLevel)) {
-            var key = xyLevel.level + '-' + xyLevel.x + '-' + xyLevel.y;
-            var heights = ApproximateTerrainHeights._terrainHeights[key];
-            if (defined(heights)) {
-                maxTerrainHeight = heights[1];
-            }
-        }
-
-        var result = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0);
-        BoundingSphere.fromRectangle3D(rectangle, ellipsoid, maxTerrainHeight, scratchBoundingSphere);
-
-        return BoundingSphere.union(result, scratchBoundingSphere, result);
-    };
-
-    function getTileXYLevel(rectangle) {
-        Cartographic.fromRadians(rectangle.east, rectangle.north, 0.0, scratchCorners[0]);
-        Cartographic.fromRadians(rectangle.west, rectangle.north, 0.0, scratchCorners[1]);
-        Cartographic.fromRadians(rectangle.east, rectangle.south, 0.0, scratchCorners[2]);
-        Cartographic.fromRadians(rectangle.west, rectangle.south, 0.0, scratchCorners[3]);
-
-        // Determine which tile the bounding rectangle is in
-        var lastLevelX = 0, lastLevelY = 0;
-        var currentX = 0, currentY = 0;
-        var maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;
-        var i;
-        for(i = 0; i <= maxLevel; ++i) {
-            var failed = false;
-            for(var j = 0; j < 4; ++j) {
-                var corner = scratchCorners[j];
-                tilingScheme.positionToTileXY(corner, i, scratchTileXY);
-                if (j === 0) {
-                    currentX = scratchTileXY.x;
-                    currentY = scratchTileXY.y;
-                } else if(currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {
-                    failed = true;
-                    break;
-                }
-            }
-
-            if (failed) {
-                break;
-            }
-
-            lastLevelX = currentX;
-            lastLevelY = currentY;
-        }
-
-        if (i === 0) {
-            return undefined;
-        }
-
-        return {
-            x : lastLevelX,
-            y : lastLevelY,
-            level : (i > maxLevel) ? maxLevel : (i - 1)
-        };
-    }
-
-    ApproximateTerrainHeights._terrainHeightsMaxLevel = 6;
-    ApproximateTerrainHeights._defaultMaxTerrainHeight = 9000.0;
-    ApproximateTerrainHeights._defaultMinTerrainHeight = -100000.0;
-    ApproximateTerrainHeights._terrainHeights = undefined;
-    ApproximateTerrainHeights._initPromise = undefined;
-
-    defineProperties(ApproximateTerrainHeights, {
-        /**
-         * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,
-         * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.
-         * @type {Boolean}
-         * @readonly
-         * @memberof ApproximateTerrainHeights
-         */
-        initialized: {
-            get: function() {
-                return defined(ApproximateTerrainHeights._terrainHeights);
-            }
-        }
-    });
-export default ApproximateTerrainHeights;

+ 0 - 597
Source/Core/ArcGISTiledElevationTerrainProvider.js

@@ -1,597 +0,0 @@
-import when from '../ThirdParty/when.js';
-import Cartesian2 from './Cartesian2.js';
-import Credit from './Credit.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-import Event from './Event.js';
-import GeographicTilingScheme from './GeographicTilingScheme.js';
-import HeightmapEncoding from './HeightmapEncoding.js';
-import HeightmapTerrainData from './HeightmapTerrainData.js';
-import Rectangle from './Rectangle.js';
-import Request from './Request.js';
-import RequestState from './RequestState.js';
-import RequestType from './RequestType.js';
-import Resource from './Resource.js';
-import RuntimeError from './RuntimeError.js';
-import TerrainProvider from './TerrainProvider.js';
-import TileAvailability from './TileAvailability.js';
-import TileProviderError from './TileProviderError.js';
-import WebMercatorTilingScheme from './WebMercatorTilingScheme.js';
-
-    var ALL_CHILDREN = 15;
-
-    /**
-     * A {@link TerrainProvider} that produces terrain geometry by tessellating height maps
-     * retrieved from Elevation Tiles of an an ArcGIS ImageService.
-     *
-     * @alias ArcGISTiledElevationTerrainProvider
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Resource|String|Promise<Resource>|Promise<String>} options.url The URL of the ArcGIS ImageServer service.
-     * @param {String} [options.token] The authorization token to use to connect to the service.
-     * @param {Ellipsoid} [options.ellipsoid] The ellipsoid.  If the tilingScheme is specified,
-     *                    this parameter is ignored and the tiling scheme's ellipsoid is used instead.
-     *                    If neither parameter is specified, the WGS84 ellipsoid is used.
-     *
-     * @example
-     * var terrainProvider = new Cesium.ArcGISTiledElevationTerrainProvider({
-     *   url : 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer',
-     *   token : 'KED1aF_I4UzXOHy3BnhwyBHU4l5oY6rO6walkmHoYqGp4XyIWUd5YZUC1ZrLAzvV40pR6gBXQayh0eFA8m6vPg..'
-     * });
-     * viewer.terrainProvider = terrainProvider;
-     *
-     *  @see TerrainProvider
-     */
-    function ArcGISTiledElevationTerrainProvider(options) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(options) || !defined(options.url)) {
-            throw new DeveloperError('options.url is required.');
-        }
-        //>>includeEnd('debug');
-
-        this._resource = undefined;
-        this._credit = undefined;
-        this._tilingScheme = undefined;
-        this._levelZeroMaximumGeometricError = undefined;
-        this._maxLevel = undefined;
-        this._terrainDataStructure = undefined;
-        this._ready = false;
-        this._width = undefined;
-        this._height = undefined;
-        this._encoding = undefined;
-        var token = options.token;
-
-        this._hasAvailability = false;
-        this._tilesAvailable = undefined;
-        this._tilesAvailablityLoaded = undefined;
-        this._availableCache = {};
-
-        var that = this;
-        var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);
-        this._readyPromise = when(options.url)
-            .then(function(url) {
-                var resource = Resource.createIfNeeded(url);
-                resource.appendForwardSlash();
-                if (defined(token)) {
-                    resource = resource.getDerivedResource({
-                        queryParameters: {
-                            token: token
-                        }
-                    });
-                }
-                that._resource = resource;
-
-                var metadataResource = resource.getDerivedResource({
-                    queryParameters: {
-                        f: 'pjson'
-                    }
-                });
-
-                return metadataResource.fetchJson();
-            })
-            .then(function(metadata) {
-                var copyrightText = metadata.copyrightText;
-                if (defined(copyrightText)) {
-                    that._credit = new Credit(copyrightText);
-                }
-
-                var spatialReference = metadata.spatialReference;
-                var wkid = defaultValue(spatialReference.latestWkid, spatialReference.wkid);
-                var extent = metadata.extent;
-                var tilingSchemeOptions = {
-                    ellipsoid: ellipsoid
-                };
-                if (wkid === 4326) {
-                    tilingSchemeOptions.rectangle = Rectangle.fromDegrees(extent.xmin, extent.ymin,
-                        extent.xmax, extent.ymax);
-                    that._tilingScheme = new GeographicTilingScheme(tilingSchemeOptions);
-                } else if (wkid === 3857) {
-                    tilingSchemeOptions.rectangleSouthwestInMeters = new Cartesian2(extent.xmin, extent.ymin);
-                    tilingSchemeOptions.rectangleNortheastInMeters = new Cartesian2(extent.xmax, extent.ymax);
-                    that._tilingScheme = new WebMercatorTilingScheme(tilingSchemeOptions);
-                } else {
-                    return when.reject(new RuntimeError('Invalid spatial reference'));
-                }
-
-                var tileInfo = metadata.tileInfo;
-                if (!defined(tileInfo)) {
-                    return when.reject(new RuntimeError('tileInfo is required'));
-                }
-
-                that._width = tileInfo.rows + 1;
-                that._height = tileInfo.cols + 1;
-                that._encoding = (tileInfo.format === 'LERC') ? HeightmapEncoding.LERC : HeightmapEncoding.NONE;
-                that._lodCount = tileInfo.lods.length - 1;
-
-                var hasAvailability = that._hasAvailability = (metadata.capabilities.indexOf('Tilemap') !== -1);
-                if (hasAvailability) {
-                    that._tilesAvailable = new TileAvailability(that._tilingScheme, that._lodCount);
-                    that._tilesAvailable.addAvailableTileRange(0, 0, 0,
-                        that._tilingScheme.getNumberOfXTilesAtLevel(0), that._tilingScheme.getNumberOfYTilesAtLevel(0));
-                    that._tilesAvailablityLoaded = new TileAvailability(that._tilingScheme, that._lodCount);
-                }
-
-                that._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(that._tilingScheme.ellipsoid, that._width, that._tilingScheme.getNumberOfXTilesAtLevel(0));
-
-                if (metadata.bandCount > 1) {
-                    console.log('ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one.');
-                }
-
-                that._terrainDataStructure = {
-                    elementMultiplier: 1.0,
-                    lowestEncodedHeight: metadata.minValues[0],
-                    highestEncodedHeight: metadata.maxValues[0]
-                };
-
-                that._ready = true;
-
-                return true;
-            })
-            .otherwise(function(error) {
-                var message = 'An error occurred while accessing ' + that._resource.url + '.';
-                TileProviderError.handleError(undefined, that, that._errorEvent, message);
-                return when.reject(error);
-            });
-
-        this._errorEvent = new Event();
-    }
-
-    defineProperties(ArcGISTiledElevationTerrainProvider.prototype, {
-        /**
-         * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing
-         * to the event, you will be notified of the error and can potentially recover from it.  Event listeners
-         * are passed an instance of {@link TileProviderError}.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {Event}
-         */
-        errorEvent: {
-            get: function() {
-                return this._errorEvent;
-            }
-        },
-
-        /**
-         * Gets the credit to display when this terrain provider is active.  Typically this is used to credit
-         * the source of the terrain.  This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {Credit}
-         */
-        credit: {
-            get: function() {
-                //>>includeStart('debug', pragmas.debug);
-                if (!this.ready) {
-                    throw new DeveloperError('credit must not be called before ready returns true.');
-                }
-                //>>includeEnd('debug');
-                return this._credit;
-            }
-        },
-
-        /**
-         * Gets the tiling scheme used by this provider.  This function should
-         * not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {GeographicTilingScheme}
-         */
-        tilingScheme: {
-            get: function() {
-                //>>includeStart('debug', pragmas.debug);
-                if (!this.ready) {
-                    throw new DeveloperError('tilingScheme must not be called before ready returns true.');
-                }
-                //>>includeEnd('debug');
-                return this._tilingScheme;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the provider is ready for use.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        ready: {
-            get: function() {
-                return this._ready;
-            }
-        },
-
-        /**
-         * Gets a promise that resolves to true when the provider is ready for use.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {Promise.<Boolean>}
-         * @readonly
-         */
-        readyPromise: {
-            get: function() {
-                return this._readyPromise;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the provider includes a water mask.  The water mask
-         * indicates which areas of the globe are water rather than land, so they can be rendered
-         * as a reflective surface with animated waves.  This function should not be
-         * called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        hasWaterMask: {
-            get: function() {
-                return false;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the requested tiles include vertex normals.
-         * This function should not be called before {@link ArcGISTiledElevationTerrainProvider#ready} returns true.
-         * @memberof ArcGISTiledElevationTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        hasVertexNormals: {
-            get: function() {
-                return false;
-            }
-        }
-    });
-
-    /**
-     * Requests the geometry for a given tile.  This function should not be called before
-     * {@link ArcGISTiledElevationTerrainProvider#ready} returns true.  The result includes terrain
-     * data and indicates that all child tiles are available.
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @param {Request} [request] The request object. Intended for internal use only.
-     * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry.  If this method
-     *          returns undefined instead of a promise, it is an indication that too many requests are already
-     *          pending and the request will be retried later.
-     */
-    ArcGISTiledElevationTerrainProvider.prototype.requestTileGeometry = function(x, y, level, request) {
-        //>>includeStart('debug', pragmas.debug)
-        if (!this._ready) {
-            throw new DeveloperError('requestTileGeometry must not be called before the terrain provider is ready.');
-        }
-        //>>includeEnd('debug');
-
-        var tileResource = this._resource.getDerivedResource({
-            url: 'tile/' + level + '/' + y + '/' + x,
-            request: request
-        });
-
-        var hasAvailability = this._hasAvailability;
-        var availabilityPromise = when.resolve(true);
-        var availabilityRequest;
-        if (hasAvailability && !defined(isTileAvailable(this, level + 1, x * 2, y * 2))) {
-            // We need to load child availability
-            var availabilityResult = requestAvailability(this, level + 1, x * 2, y * 2);
-
-            availabilityPromise = availabilityResult.promise;
-            availabilityRequest = availabilityResult.request;
-        }
-
-        var promise = tileResource.fetchArrayBuffer();
-        if (!defined(promise) || !defined(availabilityPromise)) {
-            return undefined;
-        }
-
-        var that = this;
-        var tilesAvailable = this._tilesAvailable;
-        return when.join(promise, availabilityPromise)
-            .then(function(result) {
-                return new HeightmapTerrainData({
-                    buffer: result[0],
-                    width: that._width,
-                    height: that._height,
-                    childTileMask: hasAvailability ? tilesAvailable.computeChildMaskForTile(level, x, y) : ALL_CHILDREN,
-                    structure: that._terrainDataStructure,
-                    encoding: that._encoding
-                });
-            })
-            .otherwise(function(error) {
-                if (defined(availabilityRequest) && (availabilityRequest.state === RequestState.CANCELLED)) {
-                    request.cancel();
-
-                    // Don't reject the promise till the request is actually cancelled
-                    // Otherwise it will think the request failed, but it didn't.
-                    return request.deferred.promise
-                        .always(function() {
-                            request.state = RequestState.CANCELLED;
-                            return when.reject(error);
-                        });
-                }
-                return when.reject(error);
-            });
-    };
-
-    function isTileAvailable(that, level, x, y) {
-        if (!that._hasAvailability) {
-            return undefined;
-        }
-
-        var tilesAvailablityLoaded = that._tilesAvailablityLoaded;
-        var tilesAvailable = that._tilesAvailable;
-
-        if (level > that._lodCount) {
-            return false;
-        }
-
-        // Check if tiles are known to be available
-        if (tilesAvailable.isTileAvailable(level, x, y)) {
-            return true;
-        }
-
-        // or to not be available
-        if (tilesAvailablityLoaded.isTileAvailable(level, x, y)) {
-            return false;
-        }
-
-        return undefined;
-    }
-
-    /**
-     * Gets the maximum geometric error allowed in a tile at a given level.
-     *
-     * @param {Number} level The tile level for which to get the maximum geometric error.
-     * @returns {Number} The maximum geometric error.
-     */
-    ArcGISTiledElevationTerrainProvider.prototype.getLevelMaximumGeometricError = function(level) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!this.ready) {
-            throw new DeveloperError('getLevelMaximumGeometricError must not be called before ready returns true.');
-        }
-        //>>includeEnd('debug');
-
-        return this._levelZeroMaximumGeometricError / (1 << level);
-    };
-
-    /**
-     * Determines whether data for a tile is available to be loaded.
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @returns {Boolean} Undefined if not supported, otherwise true or false.
-     */
-    ArcGISTiledElevationTerrainProvider.prototype.getTileDataAvailable = function(x, y, level) {
-        if (!this._hasAvailability) {
-            return undefined;
-        }
-
-        var result = isTileAvailable(this, level, x, y);
-        if (defined(result)) {
-            return result;
-        }
-
-        requestAvailability(this, level, x, y);
-
-        return undefined;
-    };
-
-    /**
-     * Makes sure we load availability data for a tile
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
-     */
-    ArcGISTiledElevationTerrainProvider.prototype.loadTileDataAvailability = function(x, y, level) {
-        return undefined;
-    };
-
-    function findRange(origin, width, height, data) {
-        var endCol = width - 1;
-        var endRow = height - 1;
-
-        var value = data[origin.y * width + origin.x];
-        var endingIndices = [];
-        var range = {
-            startX: origin.x,
-            startY: origin.y,
-            endX: 0,
-            endY: 0
-        };
-
-        var corner = new Cartesian2(origin.x + 1, origin.y + 1);
-        var doneX = false;
-        var doneY = false;
-        while (!(doneX && doneY)) {
-            // We want to use the original value when checking Y,
-            //  so get it before it possibly gets incremented
-            var endX = corner.x;
-
-            // If we no longer move in the Y direction we need to check the corner tile in X pass
-            var endY = doneY ? (corner.y + 1) : corner.y;
-
-            // Check X range
-            if (!doneX) {
-                for (var y = origin.y; y < endY; ++y) {
-                    if (data[y * width + corner.x] !== value) {
-                        doneX = true;
-                        break;
-                    }
-                }
-
-                if (doneX) {
-                    endingIndices.push(new Cartesian2(corner.x, origin.y));
-
-                    // Use the last good column so we can continue with Y
-                    --corner.x;
-                    --endX;
-                    range.endX = corner.x;
-                } else if (corner.x === endCol) {
-                    range.endX = corner.x;
-                    doneX = true;
-                } else {
-                    ++corner.x;
-                }
-            }
-
-            // Check Y range - The corner tile is checked here
-            if (!doneY) {
-                var col = corner.y * width;
-                for (var x = origin.x; x <= endX; ++x) {
-                    if (data[col + x] !== value) {
-                        doneY = true;
-                        break;
-                    }
-                }
-
-                if (doneY) {
-                    endingIndices.push(new Cartesian2(origin.x, corner.y));
-
-                    // Use the last good row so we can continue with X
-                    --corner.y;
-                    range.endY = corner.y;
-                } else if (corner.y === endRow) {
-                    range.endY = corner.y;
-                    doneY = true;
-                } else {
-                    ++corner.y;
-                }
-            }
-        }
-
-        return {
-            endingIndices: endingIndices,
-            range: range,
-            value: value
-        };
-    }
-
-    function computeAvailability(x, y, width, height, data) {
-        var ranges = [];
-
-        var singleValue = data.every(function(val) {
-            return val === data[0];
-        });
-        if (singleValue) {
-            if (data[0] === 1) {
-                ranges.push({
-                    startX: x,
-                    startY: y,
-                    endX: x + width - 1,
-                    endY: y + height - 1
-                });
-            }
-
-            return ranges;
-        }
-
-        var positions = [new Cartesian2(0, 0)];
-        while (positions.length > 0) {
-            var origin = positions.pop();
-            var result = findRange(origin, width, height, data);
-
-            if (result.value === 1) {
-                // Convert range into the array into global tile coordinates
-                var range = result.range;
-                range.startX += x;
-                range.endX += x;
-                range.startY += y;
-                range.endY += y;
-                ranges.push(range);
-            }
-
-            var endingIndices = result.endingIndices;
-            if (endingIndices.length > 0) {
-                positions = positions.concat(endingIndices);
-            }
-        }
-
-        return ranges;
-    }
-
-    function requestAvailability(that, level, x, y) {
-        if (!that._hasAvailability) {
-            return {};
-        }
-
-        // Fetch 128x128 availability list, so we make the minimum amount of requests
-        var xOffset = Math.floor(x / 128) * 128;
-        var yOffset = Math.floor(y / 128) * 128;
-
-        var dim = Math.min(1 << level, 128);
-        var url = 'tilemap/' + level + '/' + yOffset + '/' + xOffset + '/' + dim + '/' + dim;
-
-        var availableCache = that._availableCache;
-        if (defined(availableCache[url])) {
-            return availableCache[url];
-        }
-
-        var request = new Request({
-            throttle: true,
-            throttleByServer: true,
-            type: RequestType.TERRAIN
-        });
-
-        var tilemapResource = that._resource.getDerivedResource({
-            url: url,
-            request: request
-        });
-
-        var promise = tilemapResource.fetchJson();
-        if (!defined(promise)) {
-            return {};
-        }
-
-        promise = promise
-            .then(function(result) {
-                var available = computeAvailability(xOffset, yOffset, dim, dim, result.data);
-
-                // Mark whole area as having availability loaded
-                that._tilesAvailablityLoaded.addAvailableTileRange(xOffset, yOffset, xOffset + dim, yOffset + dim);
-
-                var tilesAvailable = that._tilesAvailable;
-                for (var i = 0; i < available.length; ++i) {
-                    var range = available[i];
-                    tilesAvailable.addAvailableTileRange(level, range.startX, range.startY, range.endX, range.endY);
-                }
-
-                // Conveniently return availability of original tile
-                return isTileAvailable(that, level, x, y);
-            });
-
-        availableCache[url] = {
-            promise: promise,
-            request: request
-        };
-
-        promise = promise
-            .always(function(result) {
-                delete availableCache[url];
-
-                return result;
-            });
-
-        return {
-            promise: promise,
-            request: request
-        };
-    }
-export default ArcGISTiledElevationTerrainProvider;

+ 0 - 33
Source/Core/ArcType.js

@@ -1,33 +0,0 @@
-import freezeObject from './freezeObject.js';
-
-    /**
-     * ArcType defines the path that should be taken connecting vertices.
-     *
-     * @exports ArcType
-     */
-    var ArcType = {
-        /**
-         * Straight line that does not conform to the surface of the ellipsoid.
-         *
-         * @type {Number}
-         * @constant
-         */
-        NONE : 0,
-
-        /**
-         * Follow geodesic path.
-         *
-         * @type {Number}
-         * @constant
-         */
-        GEODESIC : 1,
-
-        /**
-         * Follow rhumb or loxodrome path.
-         *
-         * @type {Number}
-         * @constant
-         */
-        RHUMB : 2
-    };
-export default freezeObject(ArcType);

+ 0 - 128
Source/Core/AssociativeArray.js

@@ -1,128 +0,0 @@
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * A collection of key-value pairs that is stored as a hash for easy
-     * lookup but also provides an array for fast iteration.
-     * @alias AssociativeArray
-     * @constructor
-     */
-    function AssociativeArray() {
-        this._array = [];
-        this._hash = {};
-    }
-
-    defineProperties(AssociativeArray.prototype, {
-        /**
-         * Gets the number of items in the collection.
-         * @memberof AssociativeArray.prototype
-         *
-         * @type {Number}
-         */
-        length : {
-            get : function() {
-                return this._array.length;
-            }
-        },
-        /**
-         * Gets an unordered array of all values in the collection.
-         * This is a live array that will automatically reflect the values in the collection,
-         * it should not be modified directly.
-         * @memberof AssociativeArray.prototype
-         *
-         * @type {Array}
-         */
-        values : {
-            get : function() {
-                return this._array;
-            }
-        }
-    });
-
-    /**
-     * Determines if the provided key is in the array.
-     *
-     * @param {String|Number} key The key to check.
-     * @returns {Boolean} <code>true</code> if the key is in the array, <code>false</code> otherwise.
-     */
-    AssociativeArray.prototype.contains = function(key) {
-        //>>includeStart('debug', pragmas.debug);
-        if (typeof key !== 'string' && typeof key !== 'number') {
-            throw new DeveloperError('key is required to be a string or number.');
-        }
-        //>>includeEnd('debug');
-        return defined(this._hash[key]);
-    };
-
-    /**
-     * Associates the provided key with the provided value.  If the key already
-     * exists, it is overwritten with the new value.
-     *
-     * @param {String|Number} key A unique identifier.
-     * @param {*} value The value to associate with the provided key.
-     */
-    AssociativeArray.prototype.set = function(key, value) {
-        //>>includeStart('debug', pragmas.debug);
-        if (typeof key !== 'string' && typeof key !== 'number') {
-            throw new DeveloperError('key is required to be a string or number.');
-        }
-        //>>includeEnd('debug');
-
-        var oldValue = this._hash[key];
-        if (value !== oldValue) {
-            this.remove(key);
-            this._hash[key] = value;
-            this._array.push(value);
-        }
-    };
-
-    /**
-     * Retrieves the value associated with the provided key.
-     *
-     * @param {String|Number} key The key whose value is to be retrieved.
-     * @returns {*} The associated value, or undefined if the key does not exist in the collection.
-     */
-    AssociativeArray.prototype.get = function(key) {
-        //>>includeStart('debug', pragmas.debug);
-        if (typeof key !== 'string' && typeof key !== 'number') {
-            throw new DeveloperError('key is required to be a string or number.');
-        }
-        //>>includeEnd('debug');
-        return this._hash[key];
-    };
-
-    /**
-     * Removes a key-value pair from the collection.
-     *
-     * @param {String|Number} key The key to be removed.
-     * @returns {Boolean} True if it was removed, false if the key was not in the collection.
-     */
-    AssociativeArray.prototype.remove = function(key) {
-        //>>includeStart('debug', pragmas.debug);
-        if (defined(key) && typeof key !== 'string' && typeof key !== 'number') {
-            throw new DeveloperError('key is required to be a string or number.');
-        }
-        //>>includeEnd('debug');
-
-        var value = this._hash[key];
-        var hasValue = defined(value);
-        if (hasValue) {
-            var array = this._array;
-            array.splice(array.indexOf(value), 1);
-            delete this._hash[key];
-        }
-        return hasValue;
-    };
-
-    /**
-     * Clears the collection.
-     */
-    AssociativeArray.prototype.removeAll = function() {
-        var array = this._array;
-        if (array.length > 0) {
-            this._hash = {};
-            array.length = 0;
-        }
-    };
-export default AssociativeArray;

+ 0 - 373
Source/Core/AttributeCompression.js

@@ -1,373 +0,0 @@
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import CesiumMath from './Math.js';
-
-    var RIGHT_SHIFT = 1.0 / 256.0;
-    var LEFT_SHIFT = 256.0;
-
-    /**
-     * Attribute compression and decompression functions.
-     *
-     * @exports AttributeCompression
-     *
-     * @private
-     */
-    var AttributeCompression = {};
-
-    /**
-     * Encodes a normalized vector into 2 SNORM values in the range of [0-rangeMax] following the 'oct' encoding.
-     *
-     * Oct encoding is a compact representation of unit length vectors.
-     * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
-     * Cigolle et al 2014: {@link http://jcgt.org/published/0003/02/01/}
-     *
-     * @param {Cartesian3} vector The normalized vector to be compressed into 2 component 'oct' encoding.
-     * @param {Cartesian2} result The 2 component oct-encoded unit length vector.
-     * @param {Number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
-     * @returns {Cartesian2} The 2 component oct-encoded unit length vector.
-     *
-     * @exception {DeveloperError} vector must be normalized.
-     *
-     * @see AttributeCompression.octDecodeInRange
-     */
-    AttributeCompression.octEncodeInRange = function(vector, rangeMax, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('vector', vector);
-        Check.defined('result', result);
-        var magSquared = Cartesian3.magnitudeSquared(vector);
-        if (Math.abs(magSquared - 1.0) > CesiumMath.EPSILON6) {
-            throw new DeveloperError('vector must be normalized.');
-        }
-        //>>includeEnd('debug');
-
-        result.x = vector.x / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));
-        result.y = vector.y / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));
-        if (vector.z < 0) {
-            var x = result.x;
-            var y = result.y;
-            result.x = (1.0 - Math.abs(y)) * CesiumMath.signNotZero(x);
-            result.y = (1.0 - Math.abs(x)) * CesiumMath.signNotZero(y);
-        }
-
-        result.x = CesiumMath.toSNorm(result.x, rangeMax);
-        result.y = CesiumMath.toSNorm(result.y, rangeMax);
-
-        return result;
-    };
-
-    /**
-     * Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding.
-     *
-     * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.
-     * @param {Cartesian2} result The 2 byte oct-encoded unit length vector.
-     * @returns {Cartesian2} The 2 byte oct-encoded unit length vector.
-     *
-     * @exception {DeveloperError} vector must be normalized.
-     *
-     * @see AttributeCompression.octEncodeInRange
-     * @see AttributeCompression.octDecode
-     */
-    AttributeCompression.octEncode = function(vector, result) {
-        return AttributeCompression.octEncodeInRange(vector, 255, result);
-    };
-
-    var octEncodeScratch = new Cartesian2();
-    var uint8ForceArray = new Uint8Array(1);
-    function forceUint8(value) {
-        uint8ForceArray[0] = value;
-        return uint8ForceArray[0];
-    }
-    /**
-     * @param {Cartesian3} vector The normalized vector to be compressed into 4 byte 'oct' encoding.
-     * @param {Cartesian4} result The 4 byte oct-encoded unit length vector.
-     * @returns {Cartesian4} The 4 byte oct-encoded unit length vector.
-     *
-     * @exception {DeveloperError} vector must be normalized.
-     *
-     * @see AttributeCompression.octEncodeInRange
-     * @see AttributeCompression.octDecodeFromCartesian4
-     */
-    AttributeCompression.octEncodeToCartesian4 = function(vector, result) {
-        AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);
-        result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);
-        result.y = forceUint8(octEncodeScratch.x);
-        result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);
-        result.w = forceUint8(octEncodeScratch.y);
-        return result;
-    };
-
-    /**
-     * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component vector.
-     *
-     * @param {Number} x The x component of the oct-encoded unit length vector.
-     * @param {Number} y The y component of the oct-encoded unit length vector.
-     * @param {Number} rangeMax The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
-     * @param {Cartesian3} result The decoded and normalized vector
-     * @returns {Cartesian3} The decoded and normalized vector.
-     *
-     * @exception {DeveloperError} x and y must be unsigned normalized integers between 0 and rangeMax.
-     *
-     * @see AttributeCompression.octEncodeInRange
-     */
-    AttributeCompression.octDecodeInRange = function(x, y, rangeMax, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('result', result);
-        if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {
-            throw new DeveloperError('x and y must be unsigned normalized integers between 0 and ' + rangeMax);
-        }
-        //>>includeEnd('debug');
-
-        result.x = CesiumMath.fromSNorm(x, rangeMax);
-        result.y = CesiumMath.fromSNorm(y, rangeMax);
-        result.z = 1.0 - (Math.abs(result.x) + Math.abs(result.y));
-
-        if (result.z < 0.0)
-        {
-            var oldVX = result.x;
-            result.x = (1.0 - Math.abs(result.y)) * CesiumMath.signNotZero(oldVX);
-            result.y = (1.0 - Math.abs(oldVX)) * CesiumMath.signNotZero(result.y);
-        }
-
-        return Cartesian3.normalize(result, result);
-    };
-
-    /**
-     * Decodes a unit-length vector in 2 byte 'oct' encoding to a normalized 3-component vector.
-     *
-     * @param {Number} x The x component of the oct-encoded unit length vector.
-     * @param {Number} y The y component of the oct-encoded unit length vector.
-     * @param {Cartesian3} result The decoded and normalized vector.
-     * @returns {Cartesian3} The decoded and normalized vector.
-     *
-     * @exception {DeveloperError} x and y must be an unsigned normalized integer between 0 and 255.
-     *
-     * @see AttributeCompression.octDecodeInRange
-     */
-    AttributeCompression.octDecode = function(x, y, result) {
-        return AttributeCompression.octDecodeInRange(x, y, 255, result);
-    };
-
-    /**
-     * Decodes a unit-length vector in 4 byte 'oct' encoding to a normalized 3-component vector.
-     *
-     * @param {Cartesian4} encoded The oct-encoded unit length vector.
-     * @param {Cartesian3} result The decoded and normalized vector.
-     * @returns {Cartesian3} The decoded and normalized vector.
-     *
-     * @exception {DeveloperError} x, y, z, and w must be unsigned normalized integers between 0 and 255.
-     *
-     * @see AttributeCompression.octDecodeInRange
-     * @see AttributeCompression.octEncodeToCartesian4
-     */
-    AttributeCompression.octDecodeFromCartesian4 = function(encoded, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('encoded', encoded);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-        var x = encoded.x;
-        var y = encoded.y;
-        var z = encoded.z;
-        var w = encoded.w;
-        //>>includeStart('debug', pragmas.debug);
-        if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) {
-            throw new DeveloperError('x, y, z, and w must be unsigned normalized integers between 0 and 255');
-        }
-        //>>includeEnd('debug');
-
-        var xOct16 = x * LEFT_SHIFT + y;
-        var yOct16 = z * LEFT_SHIFT + w;
-        return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result);
-    };
-
-    /**
-     * Packs an oct encoded vector into a single floating-point number.
-     *
-     * @param {Cartesian2} encoded The oct encoded vector.
-     * @returns {Number} The oct encoded vector packed into a single float.
-     *
-     */
-    AttributeCompression.octPackFloat = function(encoded) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('encoded', encoded);
-        //>>includeEnd('debug');
-        return 256.0 * encoded.x + encoded.y;
-    };
-
-    var scratchEncodeCart2 = new Cartesian2();
-
-    /**
-     * Encodes a normalized vector into 2 SNORM values in the range of [0-255] following the 'oct' encoding and
-     * stores those values in a single float-point number.
-     *
-     * @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.
-     * @returns {Number} The 2 byte oct-encoded unit length vector.
-     *
-     * @exception {DeveloperError} vector must be normalized.
-     */
-    AttributeCompression.octEncodeFloat = function(vector) {
-        AttributeCompression.octEncode(vector, scratchEncodeCart2);
-        return AttributeCompression.octPackFloat(scratchEncodeCart2);
-    };
-
-    /**
-     * Decodes a unit-length vector in 'oct' encoding packed in a floating-point number to a normalized 3-component vector.
-     *
-     * @param {Number} value The oct-encoded unit length vector stored as a single floating-point number.
-     * @param {Cartesian3} result The decoded and normalized vector
-     * @returns {Cartesian3} The decoded and normalized vector.
-     *
-     */
-    AttributeCompression.octDecodeFloat = function(value, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('value', value);
-        //>>includeEnd('debug');
-
-        var temp = value / 256.0;
-        var x = Math.floor(temp);
-        var y = (temp - x) * 256.0;
-
-        return AttributeCompression.octDecode(x, y, result);
-    };
-
-    /**
-     * Encodes three normalized vectors into 6 SNORM values in the range of [0-255] following the 'oct' encoding and
-     * packs those into two floating-point numbers.
-     *
-     * @param {Cartesian3} v1 A normalized vector to be compressed.
-     * @param {Cartesian3} v2 A normalized vector to be compressed.
-     * @param {Cartesian3} v3 A normalized vector to be compressed.
-     * @param {Cartesian2} result The 'oct' encoded vectors packed into two floating-point numbers.
-     * @returns {Cartesian2} The 'oct' encoded vectors packed into two floating-point numbers.
-     *
-     */
-    AttributeCompression.octPack = function(v1, v2, v3, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('v1', v1);
-        Check.defined('v2', v2);
-        Check.defined('v3', v3);
-        Check.defined('result', result);
-        //>>includeEnd('debug');
-
-        var encoded1 = AttributeCompression.octEncodeFloat(v1);
-        var encoded2 = AttributeCompression.octEncodeFloat(v2);
-
-        var encoded3 = AttributeCompression.octEncode(v3, scratchEncodeCart2);
-        result.x = 65536.0 * encoded3.x + encoded1;
-        result.y = 65536.0 * encoded3.y + encoded2;
-        return result;
-    };
-
-    /**
-     * Decodes three unit-length vectors in 'oct' encoding packed into a floating-point number to a normalized 3-component vector.
-     *
-     * @param {Cartesian2} packed The three oct-encoded unit length vectors stored as two floating-point number.
-     * @param {Cartesian3} v1 One decoded and normalized vector.
-     * @param {Cartesian3} v2 One decoded and normalized vector.
-     * @param {Cartesian3} v3 One decoded and normalized vector.
-     */
-    AttributeCompression.octUnpack = function(packed, v1, v2, v3) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('packed', packed);
-        Check.defined('v1', v1);
-        Check.defined('v2', v2);
-        Check.defined('v3', v3);
-        //>>includeEnd('debug');
-
-        var temp = packed.x / 65536.0;
-        var x = Math.floor(temp);
-        var encodedFloat1 = (temp - x) * 65536.0;
-
-        temp = packed.y / 65536.0;
-        var y = Math.floor(temp);
-        var encodedFloat2 = (temp - y) * 65536.0;
-
-        AttributeCompression.octDecodeFloat(encodedFloat1, v1);
-        AttributeCompression.octDecodeFloat(encodedFloat2, v2);
-        AttributeCompression.octDecode(x, y, v3);
-    };
-
-    /**
-     * Pack texture coordinates into a single float. The texture coordinates will only preserve 12 bits of precision.
-     *
-     * @param {Cartesian2} textureCoordinates The texture coordinates to compress.  Both coordinates must be in the range 0.0-1.0.
-     * @returns {Number} The packed texture coordinates.
-     *
-     */
-    AttributeCompression.compressTextureCoordinates = function(textureCoordinates) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('textureCoordinates', textureCoordinates);
-        //>>includeEnd('debug');
-
-        // Move x and y to the range 0-4095;
-        var x = (textureCoordinates.x * 4095.0) | 0;
-        var y = (textureCoordinates.y * 4095.0) | 0;
-        return 4096.0 * x + y;
-    };
-
-    /**
-     * Decompresses texture coordinates that were packed into a single float.
-     *
-     * @param {Number} compressed The compressed texture coordinates.
-     * @param {Cartesian2} result The decompressed texture coordinates.
-     * @returns {Cartesian2} The modified result parameter.
-     *
-     */
-    AttributeCompression.decompressTextureCoordinates = function(compressed, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('compressed', compressed);
-        Check.defined('result', result);
-        //>>includeEnd('debug');
-
-        var temp = compressed / 4096.0;
-        var xZeroTo4095 = Math.floor(temp);
-        result.x = xZeroTo4095 / 4095.0;
-        result.y = (compressed - xZeroTo4095 * 4096) / 4095;
-        return result;
-    };
-
-    function zigZagDecode(value) {
-        return (value >> 1) ^ (-(value & 1));
-    }
-
-    /**
-     * Decodes delta and ZigZag encoded vertices. This modifies the buffers in place.
-     *
-     * @param {Uint16Array} uBuffer The buffer view of u values.
-     * @param {Uint16Array} vBuffer The buffer view of v values.
-     * @param {Uint16Array} [heightBuffer] The buffer view of height values.
-     *
-     * @see {@link https://github.com/AnalyticalGraphicsInc/quantized-mesh|quantized-mesh-1.0 terrain format}
-     */
-    AttributeCompression.zigZagDeltaDecode = function(uBuffer, vBuffer, heightBuffer) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('uBuffer', uBuffer);
-        Check.defined('vBuffer', vBuffer);
-        Check.typeOf.number.equals('uBuffer.length', 'vBuffer.length', uBuffer.length, vBuffer.length);
-        if (defined(heightBuffer)) {
-            Check.typeOf.number.equals('uBuffer.length', 'heightBuffer.length', uBuffer.length, heightBuffer.length);
-        }
-        //>>includeEnd('debug');
-
-        var count = uBuffer.length;
-
-        var u = 0;
-        var v = 0;
-        var height = 0;
-
-        for (var i = 0; i < count; ++i) {
-            u += zigZagDecode(uBuffer[i]);
-            v += zigZagDecode(vBuffer[i]);
-
-            uBuffer[i] = u;
-            vBuffer[i] = v;
-
-            if (defined(heightBuffer)) {
-                height += zigZagDecode(heightBuffer[i]);
-                heightBuffer[i] = height;
-            }
-        }
-    };
-export default AttributeCompression;

+ 0 - 217
Source/Core/AxisAlignedBoundingBox.js

@@ -1,217 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import Intersect from './Intersect.js';
-
-    /**
-     * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.
-     * @alias AxisAlignedBoundingBox
-     * @constructor
-     *
-     * @param {Cartesian3} [minimum=Cartesian3.ZERO] The minimum point along the x, y, and z axes.
-     * @param {Cartesian3} [maximum=Cartesian3.ZERO] The maximum point along the x, y, and z axes.
-     * @param {Cartesian3} [center] The center of the box; automatically computed if not supplied.
-     *
-     * @see BoundingSphere
-     * @see BoundingRectangle
-     */
-    function AxisAlignedBoundingBox(minimum, maximum, center) {
-        /**
-         * The minimum point defining the bounding box.
-         * @type {Cartesian3}
-         * @default {@link Cartesian3.ZERO}
-         */
-        this.minimum = Cartesian3.clone(defaultValue(minimum, Cartesian3.ZERO));
-
-        /**
-         * The maximum point defining the bounding box.
-         * @type {Cartesian3}
-         * @default {@link Cartesian3.ZERO}
-         */
-        this.maximum = Cartesian3.clone(defaultValue(maximum, Cartesian3.ZERO));
-
-        //If center was not defined, compute it.
-        if (!defined(center)) {
-            center = Cartesian3.midpoint(this.minimum, this.maximum, new Cartesian3());
-        } else {
-            center = Cartesian3.clone(center);
-        }
-
-        /**
-         * The center point of the bounding box.
-         * @type {Cartesian3}
-         */
-        this.center = center;
-    }
-
-    /**
-     * Computes an instance of an AxisAlignedBoundingBox. The box is determined by
-     * finding the points spaced the farthest apart on the x, y, and z axes.
-     *
-     * @param {Cartesian3[]} positions List of points that the bounding box will enclose.  Each point must have a <code>x</code>, <code>y</code>, and <code>z</code> properties.
-     * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
-     * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
-     *
-     * @example
-     * // Compute an axis aligned bounding box enclosing two points.
-     * var box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
-     */
-    AxisAlignedBoundingBox.fromPoints = function(positions, result) {
-        if (!defined(result)) {
-            result = new AxisAlignedBoundingBox();
-        }
-
-        if (!defined(positions) || positions.length === 0) {
-            result.minimum = Cartesian3.clone(Cartesian3.ZERO, result.minimum);
-            result.maximum = Cartesian3.clone(Cartesian3.ZERO, result.maximum);
-            result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);
-            return result;
-        }
-
-        var minimumX = positions[0].x;
-        var minimumY = positions[0].y;
-        var minimumZ = positions[0].z;
-
-        var maximumX = positions[0].x;
-        var maximumY = positions[0].y;
-        var maximumZ = positions[0].z;
-
-        var length = positions.length;
-        for ( var i = 1; i < length; i++) {
-            var p = positions[i];
-            var x = p.x;
-            var y = p.y;
-            var z = p.z;
-
-            minimumX = Math.min(x, minimumX);
-            maximumX = Math.max(x, maximumX);
-            minimumY = Math.min(y, minimumY);
-            maximumY = Math.max(y, maximumY);
-            minimumZ = Math.min(z, minimumZ);
-            maximumZ = Math.max(z, maximumZ);
-        }
-
-        var minimum = result.minimum;
-        minimum.x = minimumX;
-        minimum.y = minimumY;
-        minimum.z = minimumZ;
-
-        var maximum = result.maximum;
-        maximum.x = maximumX;
-        maximum.y = maximumY;
-        maximum.z = maximumZ;
-
-        result.center = Cartesian3.midpoint(minimum, maximum, result.center);
-
-        return result;
-    };
-
-    /**
-     * Duplicates a AxisAlignedBoundingBox instance.
-     *
-     * @param {AxisAlignedBoundingBox} box The bounding box to duplicate.
-     * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
-     * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
-     */
-    AxisAlignedBoundingBox.clone = function(box, result) {
-        if (!defined(box)) {
-            return undefined;
-        }
-
-        if (!defined(result)) {
-            return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);
-        }
-
-        result.minimum = Cartesian3.clone(box.minimum, result.minimum);
-        result.maximum = Cartesian3.clone(box.maximum, result.maximum);
-        result.center = Cartesian3.clone(box.center, result.center);
-        return result;
-    };
-
-    /**
-     * Compares the provided AxisAlignedBoundingBox componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {AxisAlignedBoundingBox} [left] The first AxisAlignedBoundingBox.
-     * @param {AxisAlignedBoundingBox} [right] The second AxisAlignedBoundingBox.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    AxisAlignedBoundingBox.equals = function(left, right) {
-        return (left === right) ||
-               ((defined(left)) &&
-                (defined(right)) &&
-                Cartesian3.equals(left.center, right.center) &&
-                Cartesian3.equals(left.minimum, right.minimum) &&
-                Cartesian3.equals(left.maximum, right.maximum));
-    };
-
-    var intersectScratch = new Cartesian3();
-    /**
-     * Determines which side of a plane a box is located.
-     *
-     * @param {AxisAlignedBoundingBox} box The bounding box to test.
-     * @param {Plane} plane The plane to test against.
-     * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
-     *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
-     *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box
-     *                      intersects the plane.
-     */
-    AxisAlignedBoundingBox.intersectPlane = function(box, plane) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('box', box);
-        Check.defined('plane', plane);
-        //>>includeEnd('debug');
-
-        intersectScratch = Cartesian3.subtract(box.maximum, box.minimum, intersectScratch);
-        var h = Cartesian3.multiplyByScalar(intersectScratch, 0.5, intersectScratch); //The positive half diagonal
-        var normal = plane.normal;
-        var e = h.x * Math.abs(normal.x) + h.y * Math.abs(normal.y) + h.z * Math.abs(normal.z);
-        var s = Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center
-
-        if (s - e > 0) {
-            return Intersect.INSIDE;
-        }
-
-        if (s + e < 0) {
-            //Not in front because normals point inward
-            return Intersect.OUTSIDE;
-        }
-
-        return Intersect.INTERSECTING;
-    };
-
-    /**
-     * Duplicates this AxisAlignedBoundingBox instance.
-     *
-     * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
-     * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
-     */
-    AxisAlignedBoundingBox.prototype.clone = function(result) {
-        return AxisAlignedBoundingBox.clone(this, result);
-    };
-
-    /**
-     * Determines which side of a plane this box is located.
-     *
-     * @param {Plane} plane The plane to test against.
-     * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
-     *                      the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
-     *                      on the opposite side, and {@link Intersect.INTERSECTING} if the box
-     *                      intersects the plane.
-     */
-    AxisAlignedBoundingBox.prototype.intersectPlane = function(plane) {
-        return AxisAlignedBoundingBox.intersectPlane(this, plane);
-    };
-
-    /**
-     * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {AxisAlignedBoundingBox} [right] The right hand side AxisAlignedBoundingBox.
-     * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
-     */
-    AxisAlignedBoundingBox.prototype.equals = function(right) {
-        return AxisAlignedBoundingBox.equals(this, right);
-    };
-export default AxisAlignedBoundingBox;

+ 0 - 29
Source/Core/BingMapsApi.js

@@ -1,29 +0,0 @@
-import defined from './defined.js';
-
-    /**
-     * Object for setting and retrieving the default Bing Maps API key.
-     *
-     * A Bing API key is only required if you are using {@link BingMapsImageryProvider}
-     * or {@link BingMapsGeocoderService}. You can create your own key at
-     * {@link https://www.bingmapsportal.com/}.
-     *
-     * @exports BingMapsApi
-     */
-    var BingMapsApi = {};
-
-    /**
-     * The default Bing Maps API key to use if one is not provided to the
-     * constructor of an object that uses the Bing Maps API.
-     *
-     * @type {String}
-     */
-    BingMapsApi.defaultKey = undefined;
-
-    BingMapsApi.getKey = function(providedKey) {
-        if (defined(providedKey)) {
-            return providedKey;
-        }
-
-        return BingMapsApi.defaultKey;
-    };
-export default BingMapsApi;

+ 0 - 95
Source/Core/BingMapsGeocoderService.js

@@ -1,95 +0,0 @@
-import BingMapsApi from './BingMapsApi.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defineProperties from './defineProperties.js';
-import Rectangle from './Rectangle.js';
-import Resource from './Resource.js';
-
-    var url = 'https://dev.virtualearth.net/REST/v1/Locations';
-
-    /**
-     * Provides geocoding through Bing Maps.
-     * @alias BingMapsGeocoderService
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {String} [options.key] A key to use with the Bing Maps geocoding service
-     */
-    function BingMapsGeocoderService(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var key = options.key;
-        this._key = BingMapsApi.getKey(key);
-
-        this._resource = new Resource({
-            url: url,
-            queryParameters: {
-                key: this._key
-            }
-        });
-    }
-
-    defineProperties(BingMapsGeocoderService.prototype, {
-        /**
-         * The URL endpoint for the Bing geocoder service
-         * @type {String}
-         * @memberof BingMapsGeocoderService.prototype
-         * @readonly
-         */
-        url : {
-            get : function () {
-                return url;
-            }
-        },
-
-        /**
-         * The key for the Bing geocoder service
-         * @type {String}
-         * @memberof BingMapsGeocoderService.prototype
-         * @readonly
-         */
-        key : {
-            get : function () {
-                return this._key;
-            }
-        }
-    });
-
-    /**
-     * @function
-     *
-     * @param {String} query The query to be sent to the geocoder service
-     * @returns {Promise<GeocoderService~Result[]>}
-     */
-    BingMapsGeocoderService.prototype.geocode = function(query) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.string('query', query);
-        //>>includeEnd('debug');
-
-        var resource = this._resource.getDerivedResource({
-            queryParameters: {
-                query: query
-            }
-        });
-
-        return resource.fetchJsonp('jsonp').then(function(result) {
-            if (result.resourceSets.length === 0) {
-                return [];
-            }
-
-            var results = result.resourceSets[0].resources;
-
-            return results.map(function (resource) {
-                var bbox = resource.bbox;
-                var south = bbox[0];
-                var west = bbox[1];
-                var north = bbox[2];
-                var east = bbox[3];
-                return {
-                    displayName: resource.name,
-                    destination: Rectangle.fromDegrees(west, south, east, north)
-                };
-            });
-        });
-    };
-export default BingMapsGeocoderService;

+ 0 - 358
Source/Core/BoundingRectangle.js

@@ -1,358 +0,0 @@
-import Cartesian2 from './Cartesian2.js';
-import Cartographic from './Cartographic.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import GeographicProjection from './GeographicProjection.js';
-import Intersect from './Intersect.js';
-import Rectangle from './Rectangle.js';
-
-    /**
-     * A bounding rectangle given by a corner, width and height.
-     * @alias BoundingRectangle
-     * @constructor
-     *
-     * @param {Number} [x=0.0] The x coordinate of the rectangle.
-     * @param {Number} [y=0.0] The y coordinate of the rectangle.
-     * @param {Number} [width=0.0] The width of the rectangle.
-     * @param {Number} [height=0.0] The height of the rectangle.
-     *
-     * @see BoundingSphere
-     * @see Packable
-     */
-    function BoundingRectangle(x, y, width, height) {
-        /**
-         * The x coordinate of the rectangle.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.x = defaultValue(x, 0.0);
-
-        /**
-         * The y coordinate of the rectangle.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.y = defaultValue(y, 0.0);
-
-        /**
-         * The width of the rectangle.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.width = defaultValue(width, 0.0);
-
-        /**
-         * The height of the rectangle.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.height = defaultValue(height, 0.0);
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    BoundingRectangle.packedLength = 4;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {BoundingRectangle} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    BoundingRectangle.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        array[startingIndex++] = value.x;
-        array[startingIndex++] = value.y;
-        array[startingIndex++] = value.width;
-        array[startingIndex] = value.height;
-
-        return array;
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {BoundingRectangle} [result] The object into which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
-     */
-    BoundingRectangle.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        if (!defined(result)) {
-            result = new BoundingRectangle();
-        }
-        result.x = array[startingIndex++];
-        result.y = array[startingIndex++];
-        result.width = array[startingIndex++];
-        result.height = array[startingIndex];
-        return result;
-    };
-
-    /**
-     * Computes a bounding rectangle enclosing the list of 2D points.
-     * The rectangle is oriented with the corner at the bottom left.
-     *
-     * @param {Cartesian2[]} positions List of points that the bounding rectangle will enclose.  Each point must have <code>x</code> and <code>y</code> properties.
-     * @param {BoundingRectangle} [result] The object onto which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
-     */
-    BoundingRectangle.fromPoints = function(positions, result) {
-        if (!defined(result)) {
-            result = new BoundingRectangle();
-        }
-
-        if (!defined(positions) || positions.length === 0) {
-            result.x = 0;
-            result.y = 0;
-            result.width = 0;
-            result.height = 0;
-            return result;
-        }
-
-        var length = positions.length;
-
-        var minimumX = positions[0].x;
-        var minimumY = positions[0].y;
-
-        var maximumX = positions[0].x;
-        var maximumY = positions[0].y;
-
-        for ( var i = 1; i < length; i++) {
-            var p = positions[i];
-            var x = p.x;
-            var y = p.y;
-
-            minimumX = Math.min(x, minimumX);
-            maximumX = Math.max(x, maximumX);
-            minimumY = Math.min(y, minimumY);
-            maximumY = Math.max(y, maximumY);
-        }
-
-        result.x = minimumX;
-        result.y = minimumY;
-        result.width = maximumX - minimumX;
-        result.height = maximumY - minimumY;
-        return result;
-    };
-
-    var defaultProjection = new GeographicProjection();
-    var fromRectangleLowerLeft = new Cartographic();
-    var fromRectangleUpperRight = new Cartographic();
-    /**
-     * Computes a bounding rectangle from a rectangle.
-     *
-     * @param {Rectangle} rectangle The valid rectangle used to create a bounding rectangle.
-     * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
-     * @param {BoundingRectangle} [result] The object onto which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
-     */
-    BoundingRectangle.fromRectangle = function(rectangle, projection, result) {
-        if (!defined(result)) {
-            result = new BoundingRectangle();
-        }
-
-        if (!defined(rectangle)) {
-            result.x = 0;
-            result.y = 0;
-            result.width = 0;
-            result.height = 0;
-            return result;
-        }
-
-        projection = defaultValue(projection, defaultProjection);
-
-        var lowerLeft = projection.project(Rectangle.southwest(rectangle, fromRectangleLowerLeft));
-        var upperRight = projection.project(Rectangle.northeast(rectangle, fromRectangleUpperRight));
-
-        Cartesian2.subtract(upperRight, lowerLeft, upperRight);
-
-        result.x = lowerLeft.x;
-        result.y = lowerLeft.y;
-        result.width = upperRight.x;
-        result.height = upperRight.y;
-        return result;
-    };
-
-    /**
-     * Duplicates a BoundingRectangle instance.
-     *
-     * @param {BoundingRectangle} rectangle The bounding rectangle to duplicate.
-     * @param {BoundingRectangle} [result] The object onto which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
-     */
-    BoundingRectangle.clone = function(rectangle, result) {
-        if (!defined(rectangle)) {
-            return undefined;
-        }
-
-        if (!defined(result)) {
-            return new BoundingRectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
-        }
-
-        result.x = rectangle.x;
-        result.y = rectangle.y;
-        result.width = rectangle.width;
-        result.height = rectangle.height;
-        return result;
-    };
-
-    /**
-     * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
-     *
-     * @param {BoundingRectangle} left A rectangle to enclose in bounding rectangle.
-     * @param {BoundingRectangle} right A rectangle to enclose in a bounding rectangle.
-     * @param {BoundingRectangle} [result] The object onto which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
-     */
-    BoundingRectangle.union = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new BoundingRectangle();
-        }
-
-        var lowerLeftX = Math.min(left.x, right.x);
-        var lowerLeftY = Math.min(left.y, right.y);
-        var upperRightX = Math.max(left.x + left.width, right.x + right.width);
-        var upperRightY = Math.max(left.y + left.height, right.y + right.height);
-
-        result.x = lowerLeftX;
-        result.y = lowerLeftY;
-        result.width = upperRightX - lowerLeftX;
-        result.height = upperRightY - lowerLeftY;
-        return result;
-    };
-
-    /**
-     * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
-     *
-     * @param {BoundingRectangle} rectangle A rectangle to expand.
-     * @param {Cartesian2} point A point to enclose in a bounding rectangle.
-     * @param {BoundingRectangle} [result] The object onto which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
-     */
-    BoundingRectangle.expand = function(rectangle, point, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('rectangle', rectangle);
-        Check.typeOf.object('point', point);
-        //>>includeEnd('debug');
-
-        result = BoundingRectangle.clone(rectangle, result);
-
-        var width = point.x - result.x;
-        var height = point.y - result.y;
-
-        if (width > result.width) {
-            result.width = width;
-        } else if (width < 0) {
-            result.width -= width;
-            result.x = point.x;
-        }
-
-        if (height > result.height) {
-            result.height = height;
-        } else if (height < 0) {
-            result.height -= height;
-            result.y = point.y;
-        }
-
-        return result;
-    };
-
-    /**
-     * Determines if two rectangles intersect.
-     *
-     * @param {BoundingRectangle} left A rectangle to check for intersection.
-     * @param {BoundingRectangle} right The other rectangle to check for intersection.
-     * @returns {Intersect} <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
-     */
-    BoundingRectangle.intersect = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        var leftX = left.x;
-        var leftY = left.y;
-        var rightX = right.x;
-        var rightY = right.y;
-        if (!(leftX > rightX + right.width ||
-              leftX + left.width < rightX ||
-              leftY + left.height < rightY ||
-              leftY > rightY + right.height)) {
-            return Intersect.INTERSECTING;
-        }
-
-        return Intersect.OUTSIDE;
-    };
-
-    /**
-     * Compares the provided BoundingRectangles componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {BoundingRectangle} [left] The first BoundingRectangle.
-     * @param {BoundingRectangle} [right] The second BoundingRectangle.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    BoundingRectangle.equals = function(left, right) {
-        return (left === right) ||
-               ((defined(left)) &&
-                (defined(right)) &&
-                (left.x === right.x) &&
-                (left.y === right.y) &&
-                (left.width === right.width) &&
-                (left.height === right.height));
-    };
-
-    /**
-     * Duplicates this BoundingRectangle instance.
-     *
-     * @param {BoundingRectangle} [result] The object onto which to store the result.
-     * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
-     */
-    BoundingRectangle.prototype.clone = function(result) {
-        return BoundingRectangle.clone(this, result);
-    };
-
-    /**
-     * Determines if this rectangle intersects with another.
-     *
-     * @param {BoundingRectangle} right A rectangle to check for intersection.
-     * @returns {Intersect} <code>Intersect.INTESECTING</code> if the rectangles intersect, <code>Intersect.OUTSIDE</code> otherwise.
-     */
-    BoundingRectangle.prototype.intersect = function(right) {
-        return BoundingRectangle.intersect(this, right);
-    };
-
-    /**
-     * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {BoundingRectangle} [right] The right hand side BoundingRectangle.
-     * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
-     */
-    BoundingRectangle.prototype.equals = function(right) {
-        return BoundingRectangle.equals(this, right);
-    };
-export default BoundingRectangle;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1298
Source/Core/BoundingSphere.js


+ 0 - 858
Source/Core/BoxGeometry.js

@@ -1,858 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import PrimitiveType from './PrimitiveType.js';
-import VertexFormat from './VertexFormat.js';
-
-    var diffScratch = new Cartesian3();
-
-    /**
-     * Describes a cube centered at the origin.
-     *
-     * @alias BoxGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.
-     * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     *
-     * @see BoxGeometry.fromDimensions
-     * @see BoxGeometry.createGeometry
-     * @see Packable
-     *
-     * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}
-     *
-     * @example
-     * var box = new Cesium.BoxGeometry({
-     *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
-     *   maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
-     *   minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
-     * });
-     * var geometry = Cesium.BoxGeometry.createGeometry(box);
-     */
-    function BoxGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var min = options.minimum;
-        var max = options.maximum;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('min', min);
-        Check.typeOf.object('max', max);
-        if (defined(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute.TOP) {
-            throw new DeveloperError('GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.');
-        }
-        //>>includeEnd('debug');
-
-        var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);
-
-        this._minimum = Cartesian3.clone(min);
-        this._maximum = Cartesian3.clone(max);
-        this._vertexFormat = vertexFormat;
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createBoxGeometry';
-    }
-
-    /**
-     * Creates a cube centered at the origin given its dimensions.
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     * @returns {BoxGeometry}
-     *
-     * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.
-     *
-     *
-     * @example
-     * var box = Cesium.BoxGeometry.fromDimensions({
-     *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
-     *   dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
-     * });
-     * var geometry = Cesium.BoxGeometry.createGeometry(box);
-     *
-     * @see BoxGeometry.createGeometry
-     */
-    BoxGeometry.fromDimensions = function(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var dimensions = options.dimensions;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('dimensions', dimensions);
-        Check.typeOf.number.greaterThanOrEquals('dimensions.x', dimensions.x, 0);
-        Check.typeOf.number.greaterThanOrEquals('dimensions.y', dimensions.y, 0);
-        Check.typeOf.number.greaterThanOrEquals('dimensions.z', dimensions.z, 0);
-        //>>includeEnd('debug');
-
-        var corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());
-
-        return new BoxGeometry({
-            minimum : Cartesian3.negate(corner, new Cartesian3()),
-            maximum : corner,
-            vertexFormat : options.vertexFormat,
-            offsetAttribute: options.offsetAttribute
-        });
-    };
-
-    /**
-     * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
-     *
-     * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.
-     * @returns {BoxGeometry}
-     *
-     *
-     *
-     * @example
-     * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
-     *      -72.0, 40.0,
-     *      -70.0, 35.0,
-     *      -75.0, 30.0,
-     *      -70.0, 30.0,
-     *      -68.0, 40.0
-     * ]));
-     * var box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
-     *
-     * @see BoxGeometry.createGeometry
-     */
-    BoxGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('boundingBox', boundingBox);
-        //>>includeEnd('debug');
-
-        return new BoxGeometry({
-            minimum : boundingBox.minimum,
-            maximum : boundingBox.maximum
-        });
-    };
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    BoxGeometry.packedLength = 2 * Cartesian3.packedLength + VertexFormat.packedLength + 1;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {BoxGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    BoxGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        Cartesian3.pack(value._minimum, array, startingIndex);
-        Cartesian3.pack(value._maximum, array, startingIndex + Cartesian3.packedLength);
-        VertexFormat.pack(value._vertexFormat, array, startingIndex + 2 * Cartesian3.packedLength);
-        array[startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchMin = new Cartesian3();
-    var scratchMax = new Cartesian3();
-    var scratchVertexFormat = new VertexFormat();
-    var scratchOptions = {
-        minimum: scratchMin,
-        maximum: scratchMax,
-        vertexFormat: scratchVertexFormat,
-        offsetAttribute : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {BoxGeometry} [result] The object into which to store the result.
-     * @returns {BoxGeometry} The modified result parameter or a new BoxGeometry instance if one was not provided.
-     */
-    BoxGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var min = Cartesian3.unpack(array, startingIndex, scratchMin);
-        var max = Cartesian3.unpack(array, startingIndex + Cartesian3.packedLength, scratchMax);
-        var vertexFormat = VertexFormat.unpack(array, startingIndex + 2 * Cartesian3.packedLength, scratchVertexFormat);
-        var offsetAttribute = array[startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength];
-
-        if (!defined(result)) {
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new BoxGeometry(scratchOptions);
-        }
-
-        result._minimum = Cartesian3.clone(min, result._minimum);
-        result._maximum = Cartesian3.clone(max, result._maximum);
-        result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {BoxGeometry} boxGeometry A description of the box.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    BoxGeometry.createGeometry = function(boxGeometry) {
-        var min = boxGeometry._minimum;
-        var max = boxGeometry._maximum;
-        var vertexFormat = boxGeometry._vertexFormat;
-
-        if (Cartesian3.equals(min, max)) {
-            return;
-        }
-
-        var attributes = new GeometryAttributes();
-        var indices;
-        var positions;
-
-        if (vertexFormat.position &&
-                (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent)) {
-            if (vertexFormat.position) {
-                // 8 corner points.  Duplicated 3 times each for each incident edge/face.
-                positions = new Float64Array(6 * 4 * 3);
-
-                // +z face
-                positions[0]  = min.x;
-                positions[1]  = min.y;
-                positions[2]  = max.z;
-                positions[3]  = max.x;
-                positions[4]  = min.y;
-                positions[5]  = max.z;
-                positions[6]  = max.x;
-                positions[7]  = max.y;
-                positions[8]  = max.z;
-                positions[9]  = min.x;
-                positions[10] = max.y;
-                positions[11] = max.z;
-
-                // -z face
-                positions[12] = min.x;
-                positions[13] = min.y;
-                positions[14] = min.z;
-                positions[15] = max.x;
-                positions[16] = min.y;
-                positions[17] = min.z;
-                positions[18] = max.x;
-                positions[19] = max.y;
-                positions[20] = min.z;
-                positions[21] = min.x;
-                positions[22] = max.y;
-                positions[23] = min.z;
-
-                // +x face
-                positions[24] = max.x;
-                positions[25] = min.y;
-                positions[26] = min.z;
-                positions[27] = max.x;
-                positions[28] = max.y;
-                positions[29] = min.z;
-                positions[30] = max.x;
-                positions[31] = max.y;
-                positions[32] = max.z;
-                positions[33] = max.x;
-                positions[34] = min.y;
-                positions[35] = max.z;
-
-                // -x face
-                positions[36] = min.x;
-                positions[37] = min.y;
-                positions[38] = min.z;
-                positions[39] = min.x;
-                positions[40] = max.y;
-                positions[41] = min.z;
-                positions[42] = min.x;
-                positions[43] = max.y;
-                positions[44] = max.z;
-                positions[45] = min.x;
-                positions[46] = min.y;
-                positions[47] = max.z;
-
-                // +y face
-                positions[48] = min.x;
-                positions[49] = max.y;
-                positions[50] = min.z;
-                positions[51] = max.x;
-                positions[52] = max.y;
-                positions[53] = min.z;
-                positions[54] = max.x;
-                positions[55] = max.y;
-                positions[56] = max.z;
-                positions[57] = min.x;
-                positions[58] = max.y;
-                positions[59] = max.z;
-
-                // -y face
-                positions[60] = min.x;
-                positions[61] = min.y;
-                positions[62] = min.z;
-                positions[63] = max.x;
-                positions[64] = min.y;
-                positions[65] = min.z;
-                positions[66] = max.x;
-                positions[67] = min.y;
-                positions[68] = max.z;
-                positions[69] = min.x;
-                positions[70] = min.y;
-                positions[71] = max.z;
-
-                attributes.position = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.DOUBLE,
-                    componentsPerAttribute : 3,
-                    values : positions
-                });
-            }
-
-            if (vertexFormat.normal) {
-                var normals = new Float32Array(6 * 4 * 3);
-
-                // +z face
-                normals[0]  = 0.0;
-                normals[1]  = 0.0;
-                normals[2]  = 1.0;
-                normals[3]  = 0.0;
-                normals[4]  = 0.0;
-                normals[5]  = 1.0;
-                normals[6]  = 0.0;
-                normals[7]  = 0.0;
-                normals[8]  = 1.0;
-                normals[9]  = 0.0;
-                normals[10] = 0.0;
-                normals[11] = 1.0;
-
-                // -z face
-                normals[12] = 0.0;
-                normals[13] = 0.0;
-                normals[14] = -1.0;
-                normals[15] = 0.0;
-                normals[16] = 0.0;
-                normals[17] = -1.0;
-                normals[18] = 0.0;
-                normals[19] = 0.0;
-                normals[20] = -1.0;
-                normals[21] = 0.0;
-                normals[22] = 0.0;
-                normals[23] = -1.0;
-
-                // +x face
-                normals[24] = 1.0;
-                normals[25] = 0.0;
-                normals[26] = 0.0;
-                normals[27] = 1.0;
-                normals[28] = 0.0;
-                normals[29] = 0.0;
-                normals[30] = 1.0;
-                normals[31] = 0.0;
-                normals[32] = 0.0;
-                normals[33] = 1.0;
-                normals[34] = 0.0;
-                normals[35] = 0.0;
-
-                // -x face
-                normals[36] = -1.0;
-                normals[37] = 0.0;
-                normals[38] = 0.0;
-                normals[39] = -1.0;
-                normals[40] = 0.0;
-                normals[41] = 0.0;
-                normals[42] = -1.0;
-                normals[43] = 0.0;
-                normals[44] = 0.0;
-                normals[45] = -1.0;
-                normals[46] = 0.0;
-                normals[47] = 0.0;
-
-                // +y face
-                normals[48] = 0.0;
-                normals[49] = 1.0;
-                normals[50] = 0.0;
-                normals[51] = 0.0;
-                normals[52] = 1.0;
-                normals[53] = 0.0;
-                normals[54] = 0.0;
-                normals[55] = 1.0;
-                normals[56] = 0.0;
-                normals[57] = 0.0;
-                normals[58] = 1.0;
-                normals[59] = 0.0;
-
-                // -y face
-                normals[60] = 0.0;
-                normals[61] = -1.0;
-                normals[62] = 0.0;
-                normals[63] = 0.0;
-                normals[64] = -1.0;
-                normals[65] = 0.0;
-                normals[66] = 0.0;
-                normals[67] = -1.0;
-                normals[68] = 0.0;
-                normals[69] = 0.0;
-                normals[70] = -1.0;
-                normals[71] = 0.0;
-
-                attributes.normal = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : normals
-                });
-            }
-
-            if (vertexFormat.st) {
-                var texCoords = new Float32Array(6 * 4 * 2);
-
-                // +z face
-                texCoords[0]  = 0.0;
-                texCoords[1]  = 0.0;
-                texCoords[2]  = 1.0;
-                texCoords[3]  = 0.0;
-                texCoords[4]  = 1.0;
-                texCoords[5]  = 1.0;
-                texCoords[6]  = 0.0;
-                texCoords[7]  = 1.0;
-
-                // -z face
-                texCoords[8]  = 1.0;
-                texCoords[9]  = 0.0;
-                texCoords[10] = 0.0;
-                texCoords[11] = 0.0;
-                texCoords[12] = 0.0;
-                texCoords[13] = 1.0;
-                texCoords[14] = 1.0;
-                texCoords[15] = 1.0;
-
-                //+x face
-                texCoords[16] = 0.0;
-                texCoords[17] = 0.0;
-                texCoords[18] = 1.0;
-                texCoords[19] = 0.0;
-                texCoords[20] = 1.0;
-                texCoords[21] = 1.0;
-                texCoords[22] = 0.0;
-                texCoords[23] = 1.0;
-
-                // -x face
-                texCoords[24] = 1.0;
-                texCoords[25] = 0.0;
-                texCoords[26] = 0.0;
-                texCoords[27] = 0.0;
-                texCoords[28] = 0.0;
-                texCoords[29] = 1.0;
-                texCoords[30] = 1.0;
-                texCoords[31] = 1.0;
-
-                // +y face
-                texCoords[32] = 1.0;
-                texCoords[33] = 0.0;
-                texCoords[34] = 0.0;
-                texCoords[35] = 0.0;
-                texCoords[36] = 0.0;
-                texCoords[37] = 1.0;
-                texCoords[38] = 1.0;
-                texCoords[39] = 1.0;
-
-                // -y face
-                texCoords[40] = 0.0;
-                texCoords[41] = 0.0;
-                texCoords[42] = 1.0;
-                texCoords[43] = 0.0;
-                texCoords[44] = 1.0;
-                texCoords[45] = 1.0;
-                texCoords[46] = 0.0;
-                texCoords[47] = 1.0;
-
-                attributes.st = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 2,
-                    values : texCoords
-                });
-            }
-
-            if (vertexFormat.tangent) {
-                var tangents = new Float32Array(6 * 4 * 3);
-
-                // +z face
-                tangents[0]  = 1.0;
-                tangents[1]  = 0.0;
-                tangents[2]  = 0.0;
-                tangents[3]  = 1.0;
-                tangents[4]  = 0.0;
-                tangents[5]  = 0.0;
-                tangents[6]  = 1.0;
-                tangents[7]  = 0.0;
-                tangents[8]  = 0.0;
-                tangents[9]  = 1.0;
-                tangents[10] = 0.0;
-                tangents[11] = 0.0;
-
-                // -z face
-                tangents[12] = -1.0;
-                tangents[13] = 0.0;
-                tangents[14] = 0.0;
-                tangents[15] = -1.0;
-                tangents[16] = 0.0;
-                tangents[17] = 0.0;
-                tangents[18] = -1.0;
-                tangents[19] = 0.0;
-                tangents[20] = 0.0;
-                tangents[21] = -1.0;
-                tangents[22] = 0.0;
-                tangents[23] = 0.0;
-
-                // +x face
-                tangents[24] = 0.0;
-                tangents[25] = 1.0;
-                tangents[26] = 0.0;
-                tangents[27] = 0.0;
-                tangents[28] = 1.0;
-                tangents[29] = 0.0;
-                tangents[30] = 0.0;
-                tangents[31] = 1.0;
-                tangents[32] = 0.0;
-                tangents[33] = 0.0;
-                tangents[34] = 1.0;
-                tangents[35] = 0.0;
-
-                // -x face
-                tangents[36] = 0.0;
-                tangents[37] = -1.0;
-                tangents[38] = 0.0;
-                tangents[39] = 0.0;
-                tangents[40] = -1.0;
-                tangents[41] = 0.0;
-                tangents[42] = 0.0;
-                tangents[43] = -1.0;
-                tangents[44] = 0.0;
-                tangents[45] = 0.0;
-                tangents[46] = -1.0;
-                tangents[47] = 0.0;
-
-                // +y face
-                tangents[48] = -1.0;
-                tangents[49] = 0.0;
-                tangents[50] = 0.0;
-                tangents[51] = -1.0;
-                tangents[52] = 0.0;
-                tangents[53] = 0.0;
-                tangents[54] = -1.0;
-                tangents[55] = 0.0;
-                tangents[56] = 0.0;
-                tangents[57] = -1.0;
-                tangents[58] = 0.0;
-                tangents[59] = 0.0;
-
-                // -y face
-                tangents[60] = 1.0;
-                tangents[61] = 0.0;
-                tangents[62] = 0.0;
-                tangents[63] = 1.0;
-                tangents[64] = 0.0;
-                tangents[65] = 0.0;
-                tangents[66] = 1.0;
-                tangents[67] = 0.0;
-                tangents[68] = 0.0;
-                tangents[69] = 1.0;
-                tangents[70] = 0.0;
-                tangents[71] = 0.0;
-
-                attributes.tangent = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : tangents
-                });
-            }
-
-            if (vertexFormat.bitangent) {
-                var bitangents = new Float32Array(6 * 4 * 3);
-
-                // +z face
-                bitangents[0] = 0.0;
-                bitangents[1] = 1.0;
-                bitangents[2] = 0.0;
-                bitangents[3] = 0.0;
-                bitangents[4] = 1.0;
-                bitangents[5] = 0.0;
-                bitangents[6] = 0.0;
-                bitangents[7] = 1.0;
-                bitangents[8] = 0.0;
-                bitangents[9] = 0.0;
-                bitangents[10] = 1.0;
-                bitangents[11] = 0.0;
-
-                // -z face
-                bitangents[12] = 0.0;
-                bitangents[13] = 1.0;
-                bitangents[14] = 0.0;
-                bitangents[15] = 0.0;
-                bitangents[16] = 1.0;
-                bitangents[17] = 0.0;
-                bitangents[18] = 0.0;
-                bitangents[19] = 1.0;
-                bitangents[20] = 0.0;
-                bitangents[21] = 0.0;
-                bitangents[22] = 1.0;
-                bitangents[23] = 0.0;
-
-                // +x face
-                bitangents[24] = 0.0;
-                bitangents[25] = 0.0;
-                bitangents[26] = 1.0;
-                bitangents[27] = 0.0;
-                bitangents[28] = 0.0;
-                bitangents[29] = 1.0;
-                bitangents[30] = 0.0;
-                bitangents[31] = 0.0;
-                bitangents[32] = 1.0;
-                bitangents[33] = 0.0;
-                bitangents[34] = 0.0;
-                bitangents[35] = 1.0;
-
-                // -x face
-                bitangents[36] = 0.0;
-                bitangents[37] = 0.0;
-                bitangents[38] = 1.0;
-                bitangents[39] = 0.0;
-                bitangents[40] = 0.0;
-                bitangents[41] = 1.0;
-                bitangents[42] = 0.0;
-                bitangents[43] = 0.0;
-                bitangents[44] = 1.0;
-                bitangents[45] = 0.0;
-                bitangents[46] = 0.0;
-                bitangents[47] = 1.0;
-
-                // +y face
-                bitangents[48] = 0.0;
-                bitangents[49] = 0.0;
-                bitangents[50] = 1.0;
-                bitangents[51] = 0.0;
-                bitangents[52] = 0.0;
-                bitangents[53] = 1.0;
-                bitangents[54] = 0.0;
-                bitangents[55] = 0.0;
-                bitangents[56] = 1.0;
-                bitangents[57] = 0.0;
-                bitangents[58] = 0.0;
-                bitangents[59] = 1.0;
-
-                // -y face
-                bitangents[60] = 0.0;
-                bitangents[61] = 0.0;
-                bitangents[62] = 1.0;
-                bitangents[63] = 0.0;
-                bitangents[64] = 0.0;
-                bitangents[65] = 1.0;
-                bitangents[66] = 0.0;
-                bitangents[67] = 0.0;
-                bitangents[68] = 1.0;
-                bitangents[69] = 0.0;
-                bitangents[70] = 0.0;
-                bitangents[71] = 1.0;
-
-                attributes.bitangent = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : bitangents
-                });
-            }
-
-            // 12 triangles:  6 faces, 2 triangles each.
-            indices = new Uint16Array(6 * 2 * 3);
-
-            // +z face
-            indices[0] = 0;
-            indices[1] = 1;
-            indices[2] = 2;
-            indices[3] = 0;
-            indices[4] = 2;
-            indices[5] = 3;
-
-            // -z face
-            indices[6] = 4 + 2;
-            indices[7] = 4 + 1;
-            indices[8] = 4 + 0;
-            indices[9] = 4 + 3;
-            indices[10] = 4 + 2;
-            indices[11] = 4 + 0;
-
-            // +x face
-            indices[12] = 8 + 0;
-            indices[13] = 8 + 1;
-            indices[14] = 8 + 2;
-            indices[15] = 8 + 0;
-            indices[16] = 8 + 2;
-            indices[17] = 8 + 3;
-
-            // -x face
-            indices[18] = 12 + 2;
-            indices[19] = 12 + 1;
-            indices[20] = 12 + 0;
-            indices[21] = 12 + 3;
-            indices[22] = 12 + 2;
-            indices[23] = 12 + 0;
-
-            // +y face
-            indices[24] = 16 + 2;
-            indices[25] = 16 + 1;
-            indices[26] = 16 + 0;
-            indices[27] = 16 + 3;
-            indices[28] = 16 + 2;
-            indices[29] = 16 + 0;
-
-            // -y face
-            indices[30] = 20 + 0;
-            indices[31] = 20 + 1;
-            indices[32] = 20 + 2;
-            indices[33] = 20 + 0;
-            indices[34] = 20 + 2;
-            indices[35] = 20 + 3;
-        } else {
-            // Positions only - no need to duplicate corner points
-            positions = new Float64Array(8 * 3);
-
-            positions[0] = min.x;
-            positions[1] = min.y;
-            positions[2] = min.z;
-            positions[3] = max.x;
-            positions[4] = min.y;
-            positions[5] = min.z;
-            positions[6] = max.x;
-            positions[7] = max.y;
-            positions[8] = min.z;
-            positions[9] = min.x;
-            positions[10] = max.y;
-            positions[11] = min.z;
-            positions[12] = min.x;
-            positions[13] = min.y;
-            positions[14] = max.z;
-            positions[15] = max.x;
-            positions[16] = min.y;
-            positions[17] = max.z;
-            positions[18] = max.x;
-            positions[19] = max.y;
-            positions[20] = max.z;
-            positions[21] = min.x;
-            positions[22] = max.y;
-            positions[23] = max.z;
-
-            attributes.position = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : positions
-            });
-
-            // 12 triangles:  6 faces, 2 triangles each.
-            indices = new Uint16Array(6 * 2 * 3);
-
-            // plane z = corner.Z
-            indices[0] = 4;
-            indices[1] = 5;
-            indices[2] = 6;
-            indices[3] = 4;
-            indices[4] = 6;
-            indices[5] = 7;
-
-            // plane z = -corner.Z
-            indices[6] = 1;
-            indices[7] = 0;
-            indices[8] = 3;
-            indices[9] = 1;
-            indices[10] = 3;
-            indices[11] = 2;
-
-            // plane x = corner.X
-            indices[12] = 1;
-            indices[13] = 6;
-            indices[14] = 5;
-            indices[15] = 1;
-            indices[16] = 2;
-            indices[17] = 6;
-
-            // plane y = corner.Y
-            indices[18] = 2;
-            indices[19] = 3;
-            indices[20] = 7;
-            indices[21] = 2;
-            indices[22] = 7;
-            indices[23] = 6;
-
-            // plane x = -corner.X
-            indices[24] = 3;
-            indices[25] = 0;
-            indices[26] = 4;
-            indices[27] = 3;
-            indices[28] = 4;
-            indices[29] = 7;
-
-            // plane y = -corner.Y
-            indices[30] = 0;
-            indices[31] = 1;
-            indices[32] = 5;
-            indices[33] = 0;
-            indices[34] = 5;
-            indices[35] = 4;
-        }
-
-        var diff = Cartesian3.subtract(max, min, diffScratch);
-        var radius = Cartesian3.magnitude(diff) * 0.5;
-
-        if (defined(boxGeometry._offsetAttribute)) {
-            var length = positions.length;
-            var applyOffset = new Uint8Array(length / 3);
-            var offsetValue = boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-            arrayFill(applyOffset, offsetValue);
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values: applyOffset
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.TRIANGLES,
-            boundingSphere : new BoundingSphere(Cartesian3.ZERO, radius),
-            offsetAttribute : boxGeometry._offsetAttribute
-        });
-    };
-
-    var unitBoxGeometry;
-
-    /**
-     * Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.
-     * @returns {Geometry} The computed vertices and indices.
-     *
-     * @private
-     */
-    BoxGeometry.getUnitBox = function() {
-        if (!defined(unitBoxGeometry)) {
-            unitBoxGeometry = BoxGeometry.createGeometry(BoxGeometry.fromDimensions({
-                dimensions : new Cartesian3(1.0, 1.0, 1.0),
-                vertexFormat : VertexFormat.POSITION_ONLY
-            }));
-        }
-        return unitBoxGeometry;
-    };
-export default BoxGeometry;

+ 0 - 301
Source/Core/BoxOutlineGeometry.js

@@ -1,301 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import PrimitiveType from './PrimitiveType.js';
-
-    var diffScratch = new Cartesian3();
-
-    /**
-     * A description of the outline of a cube centered at the origin.
-     *
-     * @alias BoxOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.
-     * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
-     *
-     * @see BoxOutlineGeometry.fromDimensions
-     * @see BoxOutlineGeometry.createGeometry
-     * @see Packable
-     *
-     * @example
-     * var box = new Cesium.BoxOutlineGeometry({
-     *   maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
-     *   minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
-     * });
-     * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
-     */
-    function BoxOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var min = options.minimum;
-        var max = options.maximum;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('min', min);
-        Check.typeOf.object('max', max);
-        if (defined(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute.TOP) {
-            throw new DeveloperError('GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.');
-        }
-        //>>includeEnd('debug');
-
-        this._min = Cartesian3.clone(min);
-        this._max = Cartesian3.clone(max);
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createBoxOutlineGeometry';
-    }
-
-    /**
-     * Creates an outline of a cube centered at the origin given its dimensions.
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the <code>Cartesian3</code>, respectively.
-     * @returns {BoxOutlineGeometry}
-     *
-     * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.
-     *
-     *
-     * @example
-     * var box = Cesium.BoxOutlineGeometry.fromDimensions({
-     *   dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
-     * });
-     * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
-     *
-     * @see BoxOutlineGeometry.createGeometry
-     */
-    BoxOutlineGeometry.fromDimensions = function(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var dimensions = options.dimensions;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('dimensions', dimensions);
-        Check.typeOf.number.greaterThanOrEquals('dimensions.x', dimensions.x, 0);
-        Check.typeOf.number.greaterThanOrEquals('dimensions.y', dimensions.y, 0);
-        Check.typeOf.number.greaterThanOrEquals('dimensions.z', dimensions.z, 0);
-        //>>includeEnd('debug');
-
-        var corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());
-
-        return new BoxOutlineGeometry({
-            minimum : Cartesian3.negate(corner, new Cartesian3()),
-            maximum : corner,
-            offsetAttribute: options.offsetAttribute
-        });
-    };
-
-    /**
-     * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
-     *
-     * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.
-     * @returns {BoxOutlineGeometry}
-     *
-     *
-     *
-     * @example
-     * var aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
-     *      -72.0, 40.0,
-     *      -70.0, 35.0,
-     *      -75.0, 30.0,
-     *      -70.0, 30.0,
-     *      -68.0, 40.0
-     * ]));
-     * var box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
-     *
-     *  @see BoxOutlineGeometry.createGeometry
-     */
-    BoxOutlineGeometry.fromAxisAlignedBoundingBox = function(boundingBox) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('boundindBox', boundingBox);
-        //>>includeEnd('debug');
-
-        return new BoxOutlineGeometry({
-            minimum : boundingBox.minimum,
-            maximum : boundingBox.maximum
-        });
-    };
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    BoxOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 1;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {BoxOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    BoxOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        Cartesian3.pack(value._min, array, startingIndex);
-        Cartesian3.pack(value._max, array, startingIndex + Cartesian3.packedLength);
-        array[startingIndex + (Cartesian3.packedLength * 2)] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchMin = new Cartesian3();
-    var scratchMax = new Cartesian3();
-    var scratchOptions = {
-        minimum : scratchMin,
-        maximum : scratchMax,
-        offsetAttribute : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {BoxOutlineGeometry} [result] The object into which to store the result.
-     * @returns {BoxOutlineGeometry} The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
-     */
-    BoxOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var min = Cartesian3.unpack(array, startingIndex, scratchMin);
-        var max = Cartesian3.unpack(array, startingIndex + Cartesian3.packedLength, scratchMax);
-        var offsetAttribute = array[startingIndex + Cartesian3.packedLength * 2];
-
-        if (!defined(result)) {
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new BoxOutlineGeometry(scratchOptions);
-        }
-
-        result._min = Cartesian3.clone(min, result._min);
-        result._max = Cartesian3.clone(max, result._max);
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {BoxOutlineGeometry} boxGeometry A description of the box outline.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    BoxOutlineGeometry.createGeometry = function(boxGeometry) {
-        var min = boxGeometry._min;
-        var max = boxGeometry._max;
-
-        if (Cartesian3.equals(min, max)) {
-            return;
-        }
-
-        var attributes = new GeometryAttributes();
-        var indices = new Uint16Array(12 * 2);
-        var positions = new Float64Array(8 * 3);
-
-        positions[0] = min.x;
-        positions[1] = min.y;
-        positions[2] = min.z;
-        positions[3] = max.x;
-        positions[4] = min.y;
-        positions[5] = min.z;
-        positions[6] = max.x;
-        positions[7] = max.y;
-        positions[8] = min.z;
-        positions[9] = min.x;
-        positions[10] = max.y;
-        positions[11] = min.z;
-
-        positions[12] = min.x;
-        positions[13] = min.y;
-        positions[14] = max.z;
-        positions[15] = max.x;
-        positions[16] = min.y;
-        positions[17] = max.z;
-        positions[18] = max.x;
-        positions[19] = max.y;
-        positions[20] = max.z;
-        positions[21] = min.x;
-        positions[22] = max.y;
-        positions[23] = max.z;
-
-        attributes.position = new GeometryAttribute({
-            componentDatatype : ComponentDatatype.DOUBLE,
-            componentsPerAttribute : 3,
-            values : positions
-        });
-
-        // top
-        indices[0] = 4;
-        indices[1] = 5;
-        indices[2] = 5;
-        indices[3] = 6;
-        indices[4] = 6;
-        indices[5] = 7;
-        indices[6] = 7;
-        indices[7] = 4;
-
-        // bottom
-        indices[8] = 0;
-        indices[9] = 1;
-        indices[10] = 1;
-        indices[11] = 2;
-        indices[12] = 2;
-        indices[13] = 3;
-        indices[14] = 3;
-        indices[15] = 0;
-
-        // left
-        indices[16] = 0;
-        indices[17] = 4;
-        indices[18] = 1;
-        indices[19] = 5;
-
-        //right
-        indices[20] = 2;
-        indices[21] = 6;
-        indices[22] = 3;
-        indices[23] = 7;
-
-        var diff = Cartesian3.subtract(max, min, diffScratch);
-        var radius = Cartesian3.magnitude(diff) * 0.5;
-
-        if (defined(boxGeometry._offsetAttribute)) {
-            var length = positions.length;
-            var applyOffset = new Uint8Array(length / 3);
-            var offsetValue = boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-            arrayFill(applyOffset, offsetValue);
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values: applyOffset
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.LINES,
-            boundingSphere : new BoundingSphere(Cartesian3.ZERO, radius),
-            offsetAttribute : boxGeometry._offsetAttribute
-        });
-    };
-export default BoxOutlineGeometry;

+ 0 - 735
Source/Core/Cartesian2.js

@@ -1,735 +0,0 @@
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
-import CesiumMath from './Math.js';
-
-    /**
-     * A 2D Cartesian point.
-     * @alias Cartesian2
-     * @constructor
-     *
-     * @param {Number} [x=0.0] The X component.
-     * @param {Number} [y=0.0] The Y component.
-     *
-     * @see Cartesian3
-     * @see Cartesian4
-     * @see Packable
-     */
-    function Cartesian2(x, y) {
-        /**
-         * The X component.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.x = defaultValue(x, 0.0);
-
-        /**
-         * The Y component.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.y = defaultValue(y, 0.0);
-    }
-
-    /**
-     * Creates a Cartesian2 instance from x and y coordinates.
-     *
-     * @param {Number} x The x coordinate.
-     * @param {Number} y The y coordinate.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
-     */
-    Cartesian2.fromElements = function(x, y, result) {
-        if (!defined(result)) {
-            return new Cartesian2(x, y);
-        }
-
-        result.x = x;
-        result.y = y;
-        return result;
-    };
-
-    /**
-     * Duplicates a Cartesian2 instance.
-     *
-     * @param {Cartesian2} cartesian The Cartesian to duplicate.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
-     */
-    Cartesian2.clone = function(cartesian, result) {
-        if (!defined(cartesian)) {
-            return undefined;
-        }
-        if (!defined(result)) {
-            return new Cartesian2(cartesian.x, cartesian.y);
-        }
-
-        result.x = cartesian.x;
-        result.y = cartesian.y;
-        return result;
-    };
-
-    /**
-     * Creates a Cartesian2 instance from an existing Cartesian3.  This simply takes the
-     * x and y properties of the Cartesian3 and drops z.
-     * @function
-     *
-     * @param {Cartesian3} cartesian The Cartesian3 instance to create a Cartesian2 instance from.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
-     */
-    Cartesian2.fromCartesian3 = Cartesian2.clone;
-
-    /**
-     * Creates a Cartesian2 instance from an existing Cartesian4.  This simply takes the
-     * x and y properties of the Cartesian4 and drops z and w.
-     * @function
-     *
-     * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian2 instance from.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
-     */
-    Cartesian2.fromCartesian4 = Cartesian2.clone;
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    Cartesian2.packedLength = 2;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {Cartesian2} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    Cartesian2.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        array[startingIndex++] = value.x;
-        array[startingIndex] = value.y;
-
-        return array;
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {Cartesian2} [result] The object into which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
-     */
-    Cartesian2.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        if (!defined(result)) {
-            result = new Cartesian2();
-        }
-        result.x = array[startingIndex++];
-        result.y = array[startingIndex];
-        return result;
-    };
-
-    /**
-     * Flattens an array of Cartesian2s into and array of components.
-     *
-     * @param {Cartesian2[]} array The array of cartesians to pack.
-     * @param {Number[]} [result] The array onto which to store the result.
-     * @returns {Number[]} The packed array.
-     */
-    Cartesian2.packArray = function(array, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        var length = array.length;
-        if (!defined(result)) {
-            result = new Array(length * 2);
-        } else {
-            result.length = length * 2;
-        }
-
-        for (var i = 0; i < length; ++i) {
-            Cartesian2.pack(array[i], result, i * 2);
-        }
-        return result;
-    };
-
-    /**
-     * Unpacks an array of cartesian components into and array of Cartesian2s.
-     *
-     * @param {Number[]} array The array of components to unpack.
-     * @param {Cartesian2[]} [result] The array onto which to store the result.
-     * @returns {Cartesian2[]} The unpacked array.
-     */
-    Cartesian2.unpackArray = function(array, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        var length = array.length;
-        if (!defined(result)) {
-            result = new Array(length / 2);
-        } else {
-            result.length = length / 2;
-        }
-
-        for (var i = 0; i < length; i += 2) {
-            var index = i / 2;
-            result[index] = Cartesian2.unpack(array, i, result[index]);
-        }
-        return result;
-    };
-
-    /**
-     * Creates a Cartesian2 from two consecutive elements in an array.
-     * @function
-     *
-     * @param {Number[]} array The array whose two consecutive elements correspond to the x and y components, respectively.
-     * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
-     *
-     * @example
-     * // Create a Cartesian2 with (1.0, 2.0)
-     * var v = [1.0, 2.0];
-     * var p = Cesium.Cartesian2.fromArray(v);
-     *
-     * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
-     * var v2 = [0.0, 0.0, 1.0, 2.0];
-     * var p2 = Cesium.Cartesian2.fromArray(v2, 2);
-     */
-    Cartesian2.fromArray = Cartesian2.unpack;
-
-    /**
-     * Computes the value of the maximum component for the supplied Cartesian.
-     *
-     * @param {Cartesian2} cartesian The cartesian to use.
-     * @returns {Number} The value of the maximum component.
-     */
-    Cartesian2.maximumComponent = function(cartesian) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        return Math.max(cartesian.x, cartesian.y);
-    };
-
-    /**
-     * Computes the value of the minimum component for the supplied Cartesian.
-     *
-     * @param {Cartesian2} cartesian The cartesian to use.
-     * @returns {Number} The value of the minimum component.
-     */
-    Cartesian2.minimumComponent = function(cartesian) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        return Math.min(cartesian.x, cartesian.y);
-    };
-
-    /**
-     * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
-     *
-     * @param {Cartesian2} first A cartesian to compare.
-     * @param {Cartesian2} second A cartesian to compare.
-     * @param {Cartesian2} result The object into which to store the result.
-     * @returns {Cartesian2} A cartesian with the minimum components.
-     */
-    Cartesian2.minimumByComponent = function(first, second, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('first', first);
-        Check.typeOf.object('second', second);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = Math.min(first.x, second.x);
-        result.y = Math.min(first.y, second.y);
-
-        return result;
-    };
-
-    /**
-     * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
-     *
-     * @param {Cartesian2} first A cartesian to compare.
-     * @param {Cartesian2} second A cartesian to compare.
-     * @param {Cartesian2} result The object into which to store the result.
-     * @returns {Cartesian2} A cartesian with the maximum components.
-     */
-    Cartesian2.maximumByComponent = function(first, second, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('first', first);
-        Check.typeOf.object('second', second);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = Math.max(first.x, second.x);
-        result.y = Math.max(first.y, second.y);
-        return result;
-    };
-
-    /**
-     * Computes the provided Cartesian's squared magnitude.
-     *
-     * @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.
-     * @returns {Number} The squared magnitude.
-     */
-    Cartesian2.magnitudeSquared = function(cartesian) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        return cartesian.x * cartesian.x + cartesian.y * cartesian.y;
-    };
-
-    /**
-     * Computes the Cartesian's magnitude (length).
-     *
-     * @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.
-     * @returns {Number} The magnitude.
-     */
-    Cartesian2.magnitude = function(cartesian) {
-        return Math.sqrt(Cartesian2.magnitudeSquared(cartesian));
-    };
-
-    var distanceScratch = new Cartesian2();
-
-    /**
-     * Computes the distance between two points.
-     *
-     * @param {Cartesian2} left The first point to compute the distance from.
-     * @param {Cartesian2} right The second point to compute the distance to.
-     * @returns {Number} The distance between two points.
-     *
-     * @example
-     * // Returns 1.0
-     * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
-     */
-    Cartesian2.distance = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        Cartesian2.subtract(left, right, distanceScratch);
-        return Cartesian2.magnitude(distanceScratch);
-    };
-
-    /**
-     * Computes the squared distance between two points.  Comparing squared distances
-     * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
-     *
-     * @param {Cartesian2} left The first point to compute the distance from.
-     * @param {Cartesian2} right The second point to compute the distance to.
-     * @returns {Number} The distance between two points.
-     *
-     * @example
-     * // Returns 4.0, not 2.0
-     * var d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
-     */
-    Cartesian2.distanceSquared = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        Cartesian2.subtract(left, right, distanceScratch);
-        return Cartesian2.magnitudeSquared(distanceScratch);
-    };
-
-    /**
-     * Computes the normalized form of the supplied Cartesian.
-     *
-     * @param {Cartesian2} cartesian The Cartesian to be normalized.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.normalize = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        var magnitude = Cartesian2.magnitude(cartesian);
-
-        result.x = cartesian.x / magnitude;
-        result.y = cartesian.y / magnitude;
-
-        //>>includeStart('debug', pragmas.debug);
-        if (isNaN(result.x) || isNaN(result.y)) {
-            throw new DeveloperError('normalized result is not a number');
-        }
-        //>>includeEnd('debug');
-
-        return result;
-    };
-
-    /**
-     * Computes the dot (scalar) product of two Cartesians.
-     *
-     * @param {Cartesian2} left The first Cartesian.
-     * @param {Cartesian2} right The second Cartesian.
-     * @returns {Number} The dot product.
-     */
-    Cartesian2.dot = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        return left.x * right.x + left.y * right.y;
-    };
-
-    /**
-     * Computes the componentwise product of two Cartesians.
-     *
-     * @param {Cartesian2} left The first Cartesian.
-     * @param {Cartesian2} right The second Cartesian.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.multiplyComponents = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x * right.x;
-        result.y = left.y * right.y;
-        return result;
-    };
-
-    /**
-     * Computes the componentwise quotient of two Cartesians.
-     *
-     * @param {Cartesian2} left The first Cartesian.
-     * @param {Cartesian2} right The second Cartesian.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.divideComponents = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x / right.x;
-        result.y = left.y / right.y;
-        return result;
-    };
-
-    /**
-     * Computes the componentwise sum of two Cartesians.
-     *
-     * @param {Cartesian2} left The first Cartesian.
-     * @param {Cartesian2} right The second Cartesian.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.add = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x + right.x;
-        result.y = left.y + right.y;
-        return result;
-    };
-
-    /**
-     * Computes the componentwise difference of two Cartesians.
-     *
-     * @param {Cartesian2} left The first Cartesian.
-     * @param {Cartesian2} right The second Cartesian.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.subtract = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x - right.x;
-        result.y = left.y - right.y;
-        return result;
-    };
-
-    /**
-     * Multiplies the provided Cartesian componentwise by the provided scalar.
-     *
-     * @param {Cartesian2} cartesian The Cartesian to be scaled.
-     * @param {Number} scalar The scalar to multiply with.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.multiplyByScalar = function(cartesian, scalar, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.number('scalar', scalar);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = cartesian.x * scalar;
-        result.y = cartesian.y * scalar;
-        return result;
-    };
-
-    /**
-     * Divides the provided Cartesian componentwise by the provided scalar.
-     *
-     * @param {Cartesian2} cartesian The Cartesian to be divided.
-     * @param {Number} scalar The scalar to divide by.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.divideByScalar = function(cartesian, scalar, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.number('scalar', scalar);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = cartesian.x / scalar;
-        result.y = cartesian.y / scalar;
-        return result;
-    };
-
-    /**
-     * Negates the provided Cartesian.
-     *
-     * @param {Cartesian2} cartesian The Cartesian to be negated.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.negate = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = -cartesian.x;
-        result.y = -cartesian.y;
-        return result;
-    };
-
-    /**
-     * Computes the absolute value of the provided Cartesian.
-     *
-     * @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.abs = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = Math.abs(cartesian.x);
-        result.y = Math.abs(cartesian.y);
-        return result;
-    };
-
-    var lerpScratch = new Cartesian2();
-    /**
-     * Computes the linear interpolation or extrapolation at t using the provided cartesians.
-     *
-     * @param {Cartesian2} start The value corresponding to t at 0.0.
-     * @param {Cartesian2} end The value corresponding to t at 1.0.
-     * @param {Number} t The point along t at which to interpolate.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter.
-     */
-    Cartesian2.lerp = function(start, end, t, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('start', start);
-        Check.typeOf.object('end', end);
-        Check.typeOf.number('t', t);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        Cartesian2.multiplyByScalar(end, t, lerpScratch);
-        result = Cartesian2.multiplyByScalar(start, 1.0 - t, result);
-        return Cartesian2.add(lerpScratch, result, result);
-    };
-
-    var angleBetweenScratch = new Cartesian2();
-    var angleBetweenScratch2 = new Cartesian2();
-    /**
-     * Returns the angle, in radians, between the provided Cartesians.
-     *
-     * @param {Cartesian2} left The first Cartesian.
-     * @param {Cartesian2} right The second Cartesian.
-     * @returns {Number} The angle between the Cartesians.
-     */
-    Cartesian2.angleBetween = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        Cartesian2.normalize(left, angleBetweenScratch);
-        Cartesian2.normalize(right, angleBetweenScratch2);
-        return CesiumMath.acosClamped(Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2));
-    };
-
-    var mostOrthogonalAxisScratch = new Cartesian2();
-    /**
-     * Returns the axis that is most orthogonal to the provided Cartesian.
-     *
-     * @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.
-     * @param {Cartesian2} result The object onto which to store the result.
-     * @returns {Cartesian2} The most orthogonal axis.
-     */
-    Cartesian2.mostOrthogonalAxis = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);
-        Cartesian2.abs(f, f);
-
-        if (f.x <= f.y) {
-            result = Cartesian2.clone(Cartesian2.UNIT_X, result);
-        } else {
-            result = Cartesian2.clone(Cartesian2.UNIT_Y, result);
-        }
-
-        return result;
-    };
-
-    /**
-     * Compares the provided Cartesians componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Cartesian2} [left] The first Cartesian.
-     * @param {Cartesian2} [right] The second Cartesian.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    Cartesian2.equals = function(left, right) {
-        return (left === right) ||
-               ((defined(left)) &&
-                (defined(right)) &&
-                (left.x === right.x) &&
-                (left.y === right.y));
-    };
-
-    /**
-     * @private
-     */
-    Cartesian2.equalsArray = function(cartesian, array, offset) {
-        return cartesian.x === array[offset] &&
-               cartesian.y === array[offset + 1];
-    };
-
-    /**
-     * Compares the provided Cartesians componentwise and returns
-     * <code>true</code> if they pass an absolute or relative tolerance test,
-     * <code>false</code> otherwise.
-     *
-     * @param {Cartesian2} [left] The first Cartesian.
-     * @param {Cartesian2} [right] The second Cartesian.
-     * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
-     * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
-     * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
-     */
-    Cartesian2.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
-        return (left === right) ||
-               (defined(left) &&
-                defined(right) &&
-                CesiumMath.equalsEpsilon(left.x, right.x, relativeEpsilon, absoluteEpsilon) &&
-                CesiumMath.equalsEpsilon(left.y, right.y, relativeEpsilon, absoluteEpsilon));
-    };
-
-    /**
-     * An immutable Cartesian2 instance initialized to (0.0, 0.0).
-     *
-     * @type {Cartesian2}
-     * @constant
-     */
-    Cartesian2.ZERO = freezeObject(new Cartesian2(0.0, 0.0));
-
-    /**
-     * An immutable Cartesian2 instance initialized to (1.0, 0.0).
-     *
-     * @type {Cartesian2}
-     * @constant
-     */
-    Cartesian2.UNIT_X = freezeObject(new Cartesian2(1.0, 0.0));
-
-    /**
-     * An immutable Cartesian2 instance initialized to (0.0, 1.0).
-     *
-     * @type {Cartesian2}
-     * @constant
-     */
-    Cartesian2.UNIT_Y = freezeObject(new Cartesian2(0.0, 1.0));
-
-    /**
-     * Duplicates this Cartesian2 instance.
-     *
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
-     */
-    Cartesian2.prototype.clone = function(result) {
-        return Cartesian2.clone(this, result);
-    };
-
-    /**
-     * Compares this Cartesian against the provided Cartesian componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Cartesian2} [right] The right hand side Cartesian.
-     * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
-     */
-    Cartesian2.prototype.equals = function(right) {
-        return Cartesian2.equals(this, right);
-    };
-
-    /**
-     * Compares this Cartesian against the provided Cartesian componentwise and returns
-     * <code>true</code> if they pass an absolute or relative tolerance test,
-     * <code>false</code> otherwise.
-     *
-     * @param {Cartesian2} [right] The right hand side Cartesian.
-     * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
-     * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
-     * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
-     */
-    Cartesian2.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
-        return Cartesian2.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon);
-    };
-
-    /**
-     * Creates a string representing this Cartesian in the format '(x, y)'.
-     *
-     * @returns {String} A string representing the provided Cartesian in the format '(x, y)'.
-     */
-    Cartesian2.prototype.toString = function() {
-        return '(' + this.x + ', ' + this.y + ')';
-    };
-export default Cartesian2;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1081
Source/Core/Cartesian3.js


+ 0 - 899
Source/Core/Cartesian4.js

@@ -1,899 +0,0 @@
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
-import CesiumMath from './Math.js';
-
-    /**
-     * A 4D Cartesian point.
-     * @alias Cartesian4
-     * @constructor
-     *
-     * @param {Number} [x=0.0] The X component.
-     * @param {Number} [y=0.0] The Y component.
-     * @param {Number} [z=0.0] The Z component.
-     * @param {Number} [w=0.0] The W component.
-     *
-     * @see Cartesian2
-     * @see Cartesian3
-     * @see Packable
-     */
-    function Cartesian4(x, y, z, w) {
-        /**
-         * The X component.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.x = defaultValue(x, 0.0);
-
-        /**
-         * The Y component.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.y = defaultValue(y, 0.0);
-
-        /**
-         * The Z component.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.z = defaultValue(z, 0.0);
-
-        /**
-         * The W component.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.w = defaultValue(w, 0.0);
-    }
-
-    /**
-     * Creates a Cartesian4 instance from x, y, z and w coordinates.
-     *
-     * @param {Number} x The x coordinate.
-     * @param {Number} y The y coordinate.
-     * @param {Number} z The z coordinate.
-     * @param {Number} w The w coordinate.
-     * @param {Cartesian4} [result] The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
-     */
-    Cartesian4.fromElements = function(x, y, z, w, result) {
-        if (!defined(result)) {
-            return new Cartesian4(x, y, z, w);
-        }
-
-        result.x = x;
-        result.y = y;
-        result.z = z;
-        result.w = w;
-        return result;
-    };
-
-    /**
-     * Creates a Cartesian4 instance from a {@link Color}. <code>red</code>, <code>green</code>, <code>blue</code>,
-     * and <code>alpha</code> map to <code>x</code>, <code>y</code>, <code>z</code>, and <code>w</code>, respectively.
-     *
-     * @param {Color} color The source color.
-     * @param {Cartesian4} [result] The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
-     */
-    Cartesian4.fromColor = function(color, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('color', color);
-        //>>includeEnd('debug');
-        if (!defined(result)) {
-            return new Cartesian4(color.red, color.green, color.blue, color.alpha);
-        }
-
-        result.x = color.red;
-        result.y = color.green;
-        result.z = color.blue;
-        result.w = color.alpha;
-        return result;
-    };
-
-    /**
-     * Duplicates a Cartesian4 instance.
-     *
-     * @param {Cartesian4} cartesian The Cartesian to duplicate.
-     * @param {Cartesian4} [result] The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
-     */
-    Cartesian4.clone = function(cartesian, result) {
-        if (!defined(cartesian)) {
-            return undefined;
-        }
-
-        if (!defined(result)) {
-            return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
-        }
-
-        result.x = cartesian.x;
-        result.y = cartesian.y;
-        result.z = cartesian.z;
-        result.w = cartesian.w;
-        return result;
-    };
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    Cartesian4.packedLength = 4;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {Cartesian4} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    Cartesian4.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        array[startingIndex++] = value.x;
-        array[startingIndex++] = value.y;
-        array[startingIndex++] = value.z;
-        array[startingIndex] = value.w;
-
-        return array;
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {Cartesian4} [result] The object into which to store the result.
-     * @returns {Cartesian4}  The modified result parameter or a new Cartesian4 instance if one was not provided.
-     */
-    Cartesian4.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        if (!defined(result)) {
-            result = new Cartesian4();
-        }
-        result.x = array[startingIndex++];
-        result.y = array[startingIndex++];
-        result.z = array[startingIndex++];
-        result.w = array[startingIndex];
-        return result;
-    };
-
-    /**
-     * Flattens an array of Cartesian4s into and array of components.
-     *
-     * @param {Cartesian4[]} array The array of cartesians to pack.
-     * @param {Number[]} [result] The array onto which to store the result.
-     * @returns {Number[]} The packed array.
-     */
-    Cartesian4.packArray = function(array, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        var length = array.length;
-        if (!defined(result)) {
-            result = new Array(length * 4);
-        } else {
-            result.length = length * 4;
-        }
-
-        for (var i = 0; i < length; ++i) {
-            Cartesian4.pack(array[i], result, i * 4);
-        }
-        return result;
-    };
-
-    /**
-     * Unpacks an array of cartesian components into and array of Cartesian4s.
-     *
-     * @param {Number[]} array The array of components to unpack.
-     * @param {Cartesian4[]} [result] The array onto which to store the result.
-     * @returns {Cartesian4[]} The unpacked array.
-     */
-    Cartesian4.unpackArray = function(array, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        var length = array.length;
-        if (!defined(result)) {
-            result = new Array(length / 4);
-        } else {
-            result.length = length / 4;
-        }
-
-        for (var i = 0; i < length; i += 4) {
-            var index = i / 4;
-            result[index] = Cartesian4.unpack(array, i, result[index]);
-        }
-        return result;
-    };
-
-    /**
-     * Creates a Cartesian4 from four consecutive elements in an array.
-     * @function
-     *
-     * @param {Number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
-     * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.
-     * @param {Cartesian4} [result] The object onto which to store the result.
-     * @returns {Cartesian4}  The modified result parameter or a new Cartesian4 instance if one was not provided.
-     *
-     * @example
-     * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
-     * var v = [1.0, 2.0, 3.0, 4.0];
-     * var p = Cesium.Cartesian4.fromArray(v);
-     *
-     * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
-     * var v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
-     * var p2 = Cesium.Cartesian4.fromArray(v2, 2);
-     */
-    Cartesian4.fromArray = Cartesian4.unpack;
-
-    /**
-     * Computes the value of the maximum component for the supplied Cartesian.
-     *
-     * @param {Cartesian4} cartesian The cartesian to use.
-     * @returns {Number} The value of the maximum component.
-     */
-    Cartesian4.maximumComponent = function(cartesian) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
-    };
-
-    /**
-     * Computes the value of the minimum component for the supplied Cartesian.
-     *
-     * @param {Cartesian4} cartesian The cartesian to use.
-     * @returns {Number} The value of the minimum component.
-     */
-    Cartesian4.minimumComponent = function(cartesian) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
-    };
-
-    /**
-     * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
-     *
-     * @param {Cartesian4} first A cartesian to compare.
-     * @param {Cartesian4} second A cartesian to compare.
-     * @param {Cartesian4} result The object into which to store the result.
-     * @returns {Cartesian4} A cartesian with the minimum components.
-     */
-    Cartesian4.minimumByComponent = function(first, second, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('first', first);
-        Check.typeOf.object('second', second);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = Math.min(first.x, second.x);
-        result.y = Math.min(first.y, second.y);
-        result.z = Math.min(first.z, second.z);
-        result.w = Math.min(first.w, second.w);
-
-        return result;
-    };
-
-    /**
-     * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
-     *
-     * @param {Cartesian4} first A cartesian to compare.
-     * @param {Cartesian4} second A cartesian to compare.
-     * @param {Cartesian4} result The object into which to store the result.
-     * @returns {Cartesian4} A cartesian with the maximum components.
-     */
-    Cartesian4.maximumByComponent = function(first, second, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('first', first);
-        Check.typeOf.object('second', second);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = Math.max(first.x, second.x);
-        result.y = Math.max(first.y, second.y);
-        result.z = Math.max(first.z, second.z);
-        result.w = Math.max(first.w, second.w);
-
-        return result;
-    };
-
-    /**
-     * Computes the provided Cartesian's squared magnitude.
-     *
-     * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.
-     * @returns {Number} The squared magnitude.
-     */
-    Cartesian4.magnitudeSquared = function(cartesian) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        return cartesian.x * cartesian.x + cartesian.y * cartesian.y + cartesian.z * cartesian.z + cartesian.w * cartesian.w;
-    };
-
-    /**
-     * Computes the Cartesian's magnitude (length).
-     *
-     * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.
-     * @returns {Number} The magnitude.
-     */
-    Cartesian4.magnitude = function(cartesian) {
-        return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));
-    };
-
-    var distanceScratch = new Cartesian4();
-
-    /**
-     * Computes the 4-space distance between two points.
-     *
-     * @param {Cartesian4} left The first point to compute the distance from.
-     * @param {Cartesian4} right The second point to compute the distance to.
-     * @returns {Number} The distance between two points.
-     *
-     * @example
-     * // Returns 1.0
-     * var d = Cesium.Cartesian4.distance(
-     *   new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
-     *   new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
-     */
-    Cartesian4.distance = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        Cartesian4.subtract(left, right, distanceScratch);
-        return Cartesian4.magnitude(distanceScratch);
-    };
-
-    /**
-     * Computes the squared distance between two points.  Comparing squared distances
-     * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
-     *
-     * @param {Cartesian4} left The first point to compute the distance from.
-     * @param {Cartesian4} right The second point to compute the distance to.
-     * @returns {Number} The distance between two points.
-     *
-     * @example
-     * // Returns 4.0, not 2.0
-     * var d = Cesium.Cartesian4.distance(
-     *   new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
-     *   new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
-     */
-    Cartesian4.distanceSquared = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        Cartesian4.subtract(left, right, distanceScratch);
-        return Cartesian4.magnitudeSquared(distanceScratch);
-    };
-
-    /**
-     * Computes the normalized form of the supplied Cartesian.
-     *
-     * @param {Cartesian4} cartesian The Cartesian to be normalized.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.normalize = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        var magnitude = Cartesian4.magnitude(cartesian);
-
-        result.x = cartesian.x / magnitude;
-        result.y = cartesian.y / magnitude;
-        result.z = cartesian.z / magnitude;
-        result.w = cartesian.w / magnitude;
-
-        //>>includeStart('debug', pragmas.debug);
-        if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z) || isNaN(result.w)) {
-            throw new DeveloperError('normalized result is not a number');
-        }
-        //>>includeEnd('debug');
-
-        return result;
-    };
-
-    /**
-     * Computes the dot (scalar) product of two Cartesians.
-     *
-     * @param {Cartesian4} left The first Cartesian.
-     * @param {Cartesian4} right The second Cartesian.
-     * @returns {Number} The dot product.
-     */
-    Cartesian4.dot = function(left, right) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        //>>includeEnd('debug');
-
-        return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;
-    };
-
-    /**
-     * Computes the componentwise product of two Cartesians.
-     *
-     * @param {Cartesian4} left The first Cartesian.
-     * @param {Cartesian4} right The second Cartesian.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.multiplyComponents = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x * right.x;
-        result.y = left.y * right.y;
-        result.z = left.z * right.z;
-        result.w = left.w * right.w;
-        return result;
-    };
-
-    /**
-     * Computes the componentwise quotient of two Cartesians.
-     *
-     * @param {Cartesian4} left The first Cartesian.
-     * @param {Cartesian4} right The second Cartesian.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.divideComponents = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x / right.x;
-        result.y = left.y / right.y;
-        result.z = left.z / right.z;
-        result.w = left.w / right.w;
-        return result;
-    };
-
-    /**
-     * Computes the componentwise sum of two Cartesians.
-     *
-     * @param {Cartesian4} left The first Cartesian.
-     * @param {Cartesian4} right The second Cartesian.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.add = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x + right.x;
-        result.y = left.y + right.y;
-        result.z = left.z + right.z;
-        result.w = left.w + right.w;
-        return result;
-    };
-
-    /**
-     * Computes the componentwise difference of two Cartesians.
-     *
-     * @param {Cartesian4} left The first Cartesian.
-     * @param {Cartesian4} right The second Cartesian.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.subtract = function(left, right, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('left', left);
-        Check.typeOf.object('right', right);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = left.x - right.x;
-        result.y = left.y - right.y;
-        result.z = left.z - right.z;
-        result.w = left.w - right.w;
-        return result;
-    };
-
-    /**
-     * Multiplies the provided Cartesian componentwise by the provided scalar.
-     *
-     * @param {Cartesian4} cartesian The Cartesian to be scaled.
-     * @param {Number} scalar The scalar to multiply with.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.multiplyByScalar = function(cartesian, scalar, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.number('scalar', scalar);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = cartesian.x * scalar;
-        result.y = cartesian.y * scalar;
-        result.z = cartesian.z * scalar;
-        result.w = cartesian.w * scalar;
-        return result;
-    };
-
-    /**
-     * Divides the provided Cartesian componentwise by the provided scalar.
-     *
-     * @param {Cartesian4} cartesian The Cartesian to be divided.
-     * @param {Number} scalar The scalar to divide by.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.divideByScalar = function(cartesian, scalar, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.number('scalar', scalar);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = cartesian.x / scalar;
-        result.y = cartesian.y / scalar;
-        result.z = cartesian.z / scalar;
-        result.w = cartesian.w / scalar;
-        return result;
-    };
-
-    /**
-     * Negates the provided Cartesian.
-     *
-     * @param {Cartesian4} cartesian The Cartesian to be negated.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.negate = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = -cartesian.x;
-        result.y = -cartesian.y;
-        result.z = -cartesian.z;
-        result.w = -cartesian.w;
-        return result;
-    };
-
-    /**
-     * Computes the absolute value of the provided Cartesian.
-     *
-     * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.abs = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        result.x = Math.abs(cartesian.x);
-        result.y = Math.abs(cartesian.y);
-        result.z = Math.abs(cartesian.z);
-        result.w = Math.abs(cartesian.w);
-        return result;
-    };
-
-    var lerpScratch = new Cartesian4();
-    /**
-     * Computes the linear interpolation or extrapolation at t using the provided cartesians.
-     *
-     * @param {Cartesian4} start The value corresponding to t at 0.0.
-     * @param {Cartesian4}end The value corresponding to t at 1.0.
-     * @param {Number} t The point along t at which to interpolate.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter.
-     */
-    Cartesian4.lerp = function(start, end, t, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('start', start);
-        Check.typeOf.object('end', end);
-        Check.typeOf.number('t', t);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        Cartesian4.multiplyByScalar(end, t, lerpScratch);
-        result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);
-        return Cartesian4.add(lerpScratch, result, result);
-    };
-
-    var mostOrthogonalAxisScratch = new Cartesian4();
-    /**
-     * Returns the axis that is most orthogonal to the provided Cartesian.
-     *
-     * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.
-     * @param {Cartesian4} result The object onto which to store the result.
-     * @returns {Cartesian4} The most orthogonal axis.
-     */
-    Cartesian4.mostOrthogonalAxis = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        Check.typeOf.object('result', result);
-        //>>includeEnd('debug');
-
-        var f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch);
-        Cartesian4.abs(f, f);
-
-        if (f.x <= f.y) {
-            if (f.x <= f.z) {
-                if (f.x <= f.w) {
-                    result = Cartesian4.clone(Cartesian4.UNIT_X, result);
-                } else {
-                    result = Cartesian4.clone(Cartesian4.UNIT_W, result);
-                }
-            } else if (f.z <= f.w) {
-                result = Cartesian4.clone(Cartesian4.UNIT_Z, result);
-            } else {
-                result = Cartesian4.clone(Cartesian4.UNIT_W, result);
-            }
-        } else if (f.y <= f.z) {
-            if (f.y <= f.w) {
-                result = Cartesian4.clone(Cartesian4.UNIT_Y, result);
-            } else {
-                result = Cartesian4.clone(Cartesian4.UNIT_W, result);
-            }
-        } else if (f.z <= f.w) {
-            result = Cartesian4.clone(Cartesian4.UNIT_Z, result);
-        } else {
-            result = Cartesian4.clone(Cartesian4.UNIT_W, result);
-        }
-
-        return result;
-    };
-
-    /**
-     * Compares the provided Cartesians componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Cartesian4} [left] The first Cartesian.
-     * @param {Cartesian4} [right] The second Cartesian.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    Cartesian4.equals = function(left, right) {
-        return (left === right) ||
-               ((defined(left)) &&
-                (defined(right)) &&
-                (left.x === right.x) &&
-                (left.y === right.y) &&
-                (left.z === right.z) &&
-                (left.w === right.w));
-    };
-
-    /**
-     * @private
-     */
-    Cartesian4.equalsArray = function(cartesian, array, offset) {
-        return cartesian.x === array[offset] &&
-               cartesian.y === array[offset + 1] &&
-               cartesian.z === array[offset + 2] &&
-               cartesian.w === array[offset + 3];
-    };
-
-    /**
-     * Compares the provided Cartesians componentwise and returns
-     * <code>true</code> if they pass an absolute or relative tolerance test,
-     * <code>false</code> otherwise.
-     *
-     * @param {Cartesian4} [left] The first Cartesian.
-     * @param {Cartesian4} [right] The second Cartesian.
-     * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
-     * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
-     * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
-     */
-    Cartesian4.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
-        return (left === right) ||
-               (defined(left) &&
-                defined(right) &&
-                CesiumMath.equalsEpsilon(left.x, right.x, relativeEpsilon, absoluteEpsilon) &&
-                CesiumMath.equalsEpsilon(left.y, right.y, relativeEpsilon, absoluteEpsilon) &&
-                CesiumMath.equalsEpsilon(left.z, right.z, relativeEpsilon, absoluteEpsilon) &&
-                CesiumMath.equalsEpsilon(left.w, right.w, relativeEpsilon, absoluteEpsilon));
-    };
-
-    /**
-     * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
-     *
-     * @type {Cartesian4}
-     * @constant
-     */
-    Cartesian4.ZERO = freezeObject(new Cartesian4(0.0, 0.0, 0.0, 0.0));
-
-    /**
-     * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
-     *
-     * @type {Cartesian4}
-     * @constant
-     */
-    Cartesian4.UNIT_X = freezeObject(new Cartesian4(1.0, 0.0, 0.0, 0.0));
-
-    /**
-     * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
-     *
-     * @type {Cartesian4}
-     * @constant
-     */
-    Cartesian4.UNIT_Y = freezeObject(new Cartesian4(0.0, 1.0, 0.0, 0.0));
-
-    /**
-     * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
-     *
-     * @type {Cartesian4}
-     * @constant
-     */
-    Cartesian4.UNIT_Z = freezeObject(new Cartesian4(0.0, 0.0, 1.0, 0.0));
-
-    /**
-     * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
-     *
-     * @type {Cartesian4}
-     * @constant
-     */
-    Cartesian4.UNIT_W = freezeObject(new Cartesian4(0.0, 0.0, 0.0, 1.0));
-
-    /**
-     * Duplicates this Cartesian4 instance.
-     *
-     * @param {Cartesian4} [result] The object onto which to store the result.
-     * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
-     */
-    Cartesian4.prototype.clone = function(result) {
-        return Cartesian4.clone(this, result);
-    };
-
-    /**
-     * Compares this Cartesian against the provided Cartesian componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Cartesian4} [right] The right hand side Cartesian.
-     * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
-     */
-    Cartesian4.prototype.equals = function(right) {
-        return Cartesian4.equals(this, right);
-    };
-
-    /**
-     * Compares this Cartesian against the provided Cartesian componentwise and returns
-     * <code>true</code> if they pass an absolute or relative tolerance test,
-     * <code>false</code> otherwise.
-     *
-     * @param {Cartesian4} [right] The right hand side Cartesian.
-     * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
-     * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
-     * @returns {Boolean} <code>true</code> if they are within the provided epsilon, <code>false</code> otherwise.
-     */
-    Cartesian4.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
-        return Cartesian4.equalsEpsilon(this, right, relativeEpsilon, absoluteEpsilon);
-    };
-
-    /**
-     * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
-     *
-     * @returns {String} A string representing the provided Cartesian in the format '(x, y, z, w)'.
-     */
-    Cartesian4.prototype.toString = function() {
-        return '(' + this.x + ', ' + this.y + ', ' + this.z + ', ' + this.w + ')';
-    };
-
-    var scratchFloatArray = new Float32Array(1);
-    var SHIFT_LEFT_8 = 256.0;
-    var SHIFT_LEFT_16 = 65536.0;
-    var SHIFT_LEFT_24 = 16777216.0;
-
-    var SHIFT_RIGHT_8 = 1.0 / SHIFT_LEFT_8;
-    var SHIFT_RIGHT_16 = 1.0 / SHIFT_LEFT_16;
-    var SHIFT_RIGHT_24 = 1.0 / SHIFT_LEFT_24;
-
-    var BIAS = 38.0;
-
-    /**
-     * Packs an arbitrary floating point value to 4 values representable using uint8.
-     *
-     * @param {Number} value A floating point number
-     * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.
-     * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.
-     */
-    Cartesian4.packFloat = function(value, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('value', value);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new Cartesian4();
-        }
-
-        // Force the value to 32 bit precision
-        scratchFloatArray[0] = value;
-        value = scratchFloatArray[0];
-
-        if (value === 0.0) {
-            return Cartesian4.clone(Cartesian4.ZERO, result);
-        }
-
-        var sign = value < 0.0 ? 1.0 : 0.0;
-        var exponent;
-
-        if (!isFinite(value)) {
-            value = 0.1;
-            exponent = BIAS;
-        } else {
-            value = Math.abs(value);
-            exponent = Math.floor(CesiumMath.logBase(value, 10)) + 1.0;
-            value = value / Math.pow(10.0, exponent);
-        }
-
-        var temp = value * SHIFT_LEFT_8;
-        result.x = Math.floor(temp);
-        temp = (temp - result.x) * SHIFT_LEFT_8;
-        result.y = Math.floor(temp);
-        temp = (temp - result.y) * SHIFT_LEFT_8;
-        result.z = Math.floor(temp);
-        result.w = (exponent + BIAS) * 2.0 + sign;
-
-        return result;
-    };
-
-    /**
-     * Unpacks a float packed using Cartesian4.packFloat.
-     *
-     * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.
-     * @returns {Number} The unpacked float.
-     * @private
-     */
-    Cartesian4.unpackFloat = function(packedFloat) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('packedFloat', packedFloat);
-        //>>includeEnd('debug');
-
-        var temp = packedFloat.w / 2.0;
-        var exponent = Math.floor(temp);
-        var sign = (temp - exponent) * 2.0;
-        exponent = exponent - BIAS;
-
-        sign = sign * 2.0 - 1.0;
-        sign = -sign;
-
-        if (exponent >= BIAS) {
-            return sign < 0.0 ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;
-        }
-
-        var unpacked = sign * packedFloat.x * SHIFT_RIGHT_8;
-        unpacked += sign * packedFloat.y * SHIFT_RIGHT_16;
-        unpacked += sign * packedFloat.z * SHIFT_RIGHT_24;
-
-        return unpacked * Math.pow(10.0, exponent);
-    };
-export default Cartesian4;

+ 0 - 266
Source/Core/Cartographic.js

@@ -1,266 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import freezeObject from './freezeObject.js';
-import CesiumMath from './Math.js';
-import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
-
-    /**
-     * A position defined by longitude, latitude, and height.
-     * @alias Cartographic
-     * @constructor
-     *
-     * @param {Number} [longitude=0.0] The longitude, in radians.
-     * @param {Number} [latitude=0.0] The latitude, in radians.
-     * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
-     *
-     * @see Ellipsoid
-     */
-    function Cartographic(longitude, latitude, height) {
-        /**
-         * The longitude, in radians.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.longitude = defaultValue(longitude, 0.0);
-
-        /**
-         * The latitude, in radians.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.latitude = defaultValue(latitude, 0.0);
-
-        /**
-         * The height, in meters, above the ellipsoid.
-         * @type {Number}
-         * @default 0.0
-         */
-        this.height = defaultValue(height, 0.0);
-    }
-
-    /**
-     * Creates a new Cartographic instance from longitude and latitude
-     * specified in radians.
-     *
-     * @param {Number} longitude The longitude, in radians.
-     * @param {Number} latitude The latitude, in radians.
-     * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
-     * @param {Cartographic} [result] The object onto which to store the result.
-     * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
-     */
-    Cartographic.fromRadians = function(longitude, latitude, height, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('longitude', longitude);
-        Check.typeOf.number('latitude', latitude);
-        //>>includeEnd('debug');
-
-        height = defaultValue(height, 0.0);
-
-        if (!defined(result)) {
-            return new Cartographic(longitude, latitude, height);
-        }
-
-        result.longitude = longitude;
-        result.latitude = latitude;
-        result.height = height;
-        return result;
-    };
-
-    /**
-     * Creates a new Cartographic instance from longitude and latitude
-     * specified in degrees.  The values in the resulting object will
-     * be in radians.
-     *
-     * @param {Number} longitude The longitude, in degrees.
-     * @param {Number} latitude The latitude, in degrees.
-     * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
-     * @param {Cartographic} [result] The object onto which to store the result.
-     * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
-     */
-    Cartographic.fromDegrees = function(longitude, latitude, height, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('longitude', longitude);
-        Check.typeOf.number('latitude', latitude);
-        //>>includeEnd('debug');
-        longitude = CesiumMath.toRadians(longitude);
-        latitude = CesiumMath.toRadians(latitude);
-
-        return Cartographic.fromRadians(longitude, latitude, height, result);
-    };
-
-    var cartesianToCartographicN = new Cartesian3();
-    var cartesianToCartographicP = new Cartesian3();
-    var cartesianToCartographicH = new Cartesian3();
-    var wgs84OneOverRadii = new Cartesian3(1.0 / 6378137.0, 1.0 / 6378137.0, 1.0 / 6356752.3142451793);
-    var wgs84OneOverRadiiSquared = new Cartesian3(1.0 / (6378137.0 * 6378137.0), 1.0 / (6378137.0 * 6378137.0), 1.0 / (6356752.3142451793 * 6356752.3142451793));
-    var wgs84CenterToleranceSquared = CesiumMath.EPSILON1;
-
-    /**
-     * Creates a new Cartographic instance from a Cartesian position. The values in the
-     * resulting object will be in radians.
-     *
-     * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
-     * @param {Cartographic} [result] The object onto which to store the result.
-     * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
-     */
-    Cartographic.fromCartesian = function(cartesian, ellipsoid, result) {
-        var oneOverRadii = defined(ellipsoid) ? ellipsoid.oneOverRadii : wgs84OneOverRadii;
-        var oneOverRadiiSquared = defined(ellipsoid) ? ellipsoid.oneOverRadiiSquared : wgs84OneOverRadiiSquared;
-        var centerToleranceSquared = defined(ellipsoid) ? ellipsoid._centerToleranceSquared : wgs84CenterToleranceSquared;
-
-        //`cartesian is required.` is thrown from scaleToGeodeticSurface
-        var p = scaleToGeodeticSurface(cartesian, oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, cartesianToCartographicP);
-
-        if (!defined(p)) {
-            return undefined;
-        }
-
-        var n = Cartesian3.multiplyComponents(p, oneOverRadiiSquared, cartesianToCartographicN);
-        n = Cartesian3.normalize(n, n);
-
-        var h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);
-
-        var longitude = Math.atan2(n.y, n.x);
-        var latitude = Math.asin(n.z);
-        var height = CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);
-
-        if (!defined(result)) {
-            return new Cartographic(longitude, latitude, height);
-        }
-        result.longitude = longitude;
-        result.latitude = latitude;
-        result.height = height;
-        return result;
-    };
-
-    /**
-     * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
-     * object should be in radians.
-     *
-     * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The position
-     */
-    Cartographic.toCartesian = function(cartographic, ellipsoid, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartographic', cartographic);
-        //>>includeEnd('debug');
-
-        return Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, cartographic.height, ellipsoid, result);
-    };
-
-    /**
-     * Duplicates a Cartographic instance.
-     *
-     * @param {Cartographic} cartographic The cartographic to duplicate.
-     * @param {Cartographic} [result] The object onto which to store the result.
-     * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
-     */
-    Cartographic.clone = function(cartographic, result) {
-        if (!defined(cartographic)) {
-            return undefined;
-        }
-        if (!defined(result)) {
-            return new Cartographic(cartographic.longitude, cartographic.latitude, cartographic.height);
-        }
-        result.longitude = cartographic.longitude;
-        result.latitude = cartographic.latitude;
-        result.height = cartographic.height;
-        return result;
-    };
-
-    /**
-     * Compares the provided cartographics componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Cartographic} [left] The first cartographic.
-     * @param {Cartographic} [right] The second cartographic.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    Cartographic.equals = function(left, right) {
-        return (left === right) ||
-                ((defined(left)) &&
-                 (defined(right)) &&
-                 (left.longitude === right.longitude) &&
-                 (left.latitude === right.latitude) &&
-                 (left.height === right.height));
-    };
-
-    /**
-     * Compares the provided cartographics componentwise and returns
-     * <code>true</code> if they are within the provided epsilon,
-     * <code>false</code> otherwise.
-     *
-     * @param {Cartographic} [left] The first cartographic.
-     * @param {Cartographic} [right] The second cartographic.
-     * @param {Number} epsilon The epsilon to use for equality testing.
-     * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
-     */
-    Cartographic.equalsEpsilon = function(left, right, epsilon) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('epsilon', epsilon);
-        //>>includeEnd('debug');
-
-        return (left === right) ||
-               ((defined(left)) &&
-                (defined(right)) &&
-                (Math.abs(left.longitude - right.longitude) <= epsilon) &&
-                (Math.abs(left.latitude - right.latitude) <= epsilon) &&
-                (Math.abs(left.height - right.height) <= epsilon));
-    };
-
-    /**
-     * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
-     *
-     * @type {Cartographic}
-     * @constant
-     */
-    Cartographic.ZERO = freezeObject(new Cartographic(0.0, 0.0, 0.0));
-
-    /**
-     * Duplicates this instance.
-     *
-     * @param {Cartographic} [result] The object onto which to store the result.
-     * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
-     */
-    Cartographic.prototype.clone = function(result) {
-        return Cartographic.clone(this, result);
-    };
-
-    /**
-     * Compares the provided against this cartographic componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Cartographic} [right] The second cartographic.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    Cartographic.prototype.equals = function(right) {
-        return Cartographic.equals(this, right);
-    };
-
-    /**
-     * Compares the provided against this cartographic componentwise and returns
-     * <code>true</code> if they are within the provided epsilon,
-     * <code>false</code> otherwise.
-     *
-     * @param {Cartographic} [right] The second cartographic.
-     * @param {Number} epsilon The epsilon to use for equality testing.
-     * @returns {Boolean} <code>true</code> if left and right are within the provided epsilon, <code>false</code> otherwise.
-     */
-    Cartographic.prototype.equalsEpsilon = function(right, epsilon) {
-        return Cartographic.equalsEpsilon(this, right, epsilon);
-    };
-
-    /**
-     * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
-     *
-     * @returns {String} A string representing the provided cartographic in the format '(longitude, latitude, height)'.
-     */
-    Cartographic.prototype.toString = function() {
-        return '(' + this.longitude + ', ' + this.latitude + ', ' + this.height + ')';
-    };
-export default Cartographic;

+ 0 - 56
Source/Core/CartographicGeocoderService.js

@@ -1,56 +0,0 @@
-import when from '../ThirdParty/when.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-
-    /**
-     * Geocodes queries containing longitude and latitude coordinates and an optional height.
-     * Query format: `longitude latitude (height)` with longitude/latitude in degrees and height in meters.
-     *
-     * @alias CartographicGeocoderService
-     * @constructor
-     */
-    function CartographicGeocoderService() {
-    }
-
-    /**
-     * @function
-     *
-     * @param {String} query The query to be sent to the geocoder service
-     * @returns {Promise<GeocoderService~Result[]>}
-     */
-    CartographicGeocoderService.prototype.geocode = function(query) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.string('query', query);
-        //>>includeEnd('debug');
-
-        var splitQuery = query.match(/[^\s,\n]+/g);
-        if ((splitQuery.length === 2) || (splitQuery.length === 3)) {
-            var longitude = +splitQuery[0];
-            var latitude = +splitQuery[1];
-            var height = (splitQuery.length === 3) ? +splitQuery[2] : 300.0;
-
-            if (isNaN(longitude) && isNaN(latitude)) {
-                var coordTest = /^(\d+.?\d*)([nsew])/i;
-                for (var i = 0; i < splitQuery.length; ++i) {
-                    var splitCoord = splitQuery[i].match(coordTest);
-                    if (coordTest.test(splitQuery[i]) && splitCoord.length === 3) {
-                        if (/^[ns]/i.test(splitCoord[2])) {
-                            latitude = (/^[n]/i.test(splitCoord[2])) ? +splitCoord[1] : -splitCoord[1];
-                        } else if (/^[ew]/i.test(splitCoord[2])) {
-                            longitude = (/^[e]/i.test(splitCoord[2])) ? +splitCoord[1] : -splitCoord[1];
-                        }
-                    }
-                }
-            }
-
-            if (!isNaN(longitude) && !isNaN(latitude) && !isNaN(height)) {
-                var result = {
-                    displayName: query,
-                    destination: Cartesian3.fromDegrees(longitude, latitude, height)
-                };
-                return when.resolve([result]);
-            }
-        }
-        return when.resolve([]);
-    };
-export default CartographicGeocoderService;

+ 0 - 290
Source/Core/CatmullRomSpline.js

@@ -1,290 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Cartesian4 from './Cartesian4.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import HermiteSpline from './HermiteSpline.js';
-import Matrix4 from './Matrix4.js';
-import Spline from './Spline.js';
-
-    var scratchTimeVec = new Cartesian4();
-    var scratchTemp0 = new Cartesian3();
-    var scratchTemp1 = new Cartesian3();
-
-    function createEvaluateFunction(spline) {
-        var points = spline.points;
-        var times = spline.times;
-
-        if (points.length < 3) {
-            var t0 = times[0];
-            var invSpan = 1.0 / (times[1] - t0);
-
-            var p0 = points[0];
-            var p1 = points[1];
-
-            return function(time, result) {
-                if (!defined(result)){
-                    result = new Cartesian3();
-                }
-                var u = (time - t0) * invSpan;
-                return Cartesian3.lerp(p0, p1, u, result);
-            };
-        }
-
-        return function(time, result) {
-            if (!defined(result)) {
-                result = new Cartesian3();
-            }
-            var i = spline._lastTimeIndex = spline.findTimeInterval(time, spline._lastTimeIndex);
-            var u = (time - times[i]) / (times[i + 1] - times[i]);
-
-            var timeVec = scratchTimeVec;
-            timeVec.z = u;
-            timeVec.y = u * u;
-            timeVec.x = timeVec.y * u;
-            timeVec.w = 1.0;
-
-            var p0;
-            var p1;
-            var p2;
-            var p3;
-            var coefs;
-
-            if (i === 0) {
-                p0 = points[0];
-                p1 = points[1];
-                p2 = spline.firstTangent;
-
-                p3 = Cartesian3.subtract(points[2], p0, scratchTemp0);
-                Cartesian3.multiplyByScalar(p3, 0.5, p3);
-
-                coefs = Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix, timeVec, timeVec);
-            } else if (i === points.length - 2) {
-                p0 = points[i];
-                p1 = points[i + 1];
-                p3 = spline.lastTangent;
-
-                p2 = Cartesian3.subtract(p1, points[i - 1], scratchTemp0);
-                Cartesian3.multiplyByScalar(p2, 0.5, p2);
-
-                coefs = Matrix4.multiplyByVector(HermiteSpline.hermiteCoefficientMatrix, timeVec, timeVec);
-            } else {
-                p0 = points[i - 1];
-                p1 = points[i];
-                p2 = points[i + 1];
-                p3 = points[i + 2];
-                coefs = Matrix4.multiplyByVector(CatmullRomSpline.catmullRomCoefficientMatrix, timeVec, timeVec);
-            }
-            result = Cartesian3.multiplyByScalar(p0, coefs.x, result);
-            Cartesian3.multiplyByScalar(p1, coefs.y, scratchTemp1);
-            Cartesian3.add(result, scratchTemp1, result);
-            Cartesian3.multiplyByScalar(p2, coefs.z, scratchTemp1);
-            Cartesian3.add(result, scratchTemp1, result);
-            Cartesian3.multiplyByScalar(p3, coefs.w, scratchTemp1);
-            return Cartesian3.add(result, scratchTemp1, result);
-        };
-    }
-
-    var firstTangentScratch = new Cartesian3();
-    var lastTangentScratch = new Cartesian3();
-
-    /**
-     * A Catmull-Rom spline is a cubic spline where the tangent at control points,
-     * except the first and last, are computed using the previous and next control points.
-     * Catmull-Rom splines are in the class C<sup>1</sup>.
-     *
-     * @alias CatmullRomSpline
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Number[]} options.times An array of strictly increasing, unit-less, floating-point times at each point.
-     *                The values are in no way connected to the clock time. They are the parameterization for the curve.
-     * @param {Cartesian3[]} options.points The array of {@link Cartesian3} control points.
-     * @param {Cartesian3} [options.firstTangent] The tangent of the curve at the first control point.
-     *                     If the tangent is not given, it will be estimated.
-     * @param {Cartesian3} [options.lastTangent] The tangent of the curve at the last control point.
-     *                     If the tangent is not given, it will be estimated.
-     *
-     * @exception {DeveloperError} points.length must be greater than or equal to 2.
-     * @exception {DeveloperError} times.length must be equal to points.length.
-     *
-     *
-     * @example
-     * // spline above the earth from Philadelphia to Los Angeles
-     * var spline = new Cesium.CatmullRomSpline({
-     *     times : [ 0.0, 1.5, 3.0, 4.5, 6.0 ],
-     *     points : [
-     *         new Cesium.Cartesian3(1235398.0, -4810983.0, 4146266.0),
-     *         new Cesium.Cartesian3(1372574.0, -5345182.0, 4606657.0),
-     *         new Cesium.Cartesian3(-757983.0, -5542796.0, 4514323.0),
-     *         new Cesium.Cartesian3(-2821260.0, -5248423.0, 4021290.0),
-     *         new Cesium.Cartesian3(-2539788.0, -4724797.0, 3620093.0)
-     *     ]
-     * });
-     *
-     * var p0 = spline.evaluate(times[i]);         // equal to positions[i]
-     * var p1 = spline.evaluate(times[i] + delta); // interpolated value when delta < times[i + 1] - times[i]
-     *
-     * @see HermiteSpline
-     * @see LinearSpline
-     * @see QuaternionSpline
-     * @see WeightSpline
-     */
-    function CatmullRomSpline(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var points = options.points;
-        var times = options.times;
-        var firstTangent = options.firstTangent;
-        var lastTangent = options.lastTangent;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('points', points);
-        Check.defined('times', times);
-        Check.typeOf.number.greaterThanOrEquals('points.length', points.length, 2);
-        Check.typeOf.number.equals('times.length', 'points.length', times.length, points.length);
-        //>>includeEnd('debug');
-
-        if (points.length > 2) {
-            if (!defined(firstTangent)) {
-                firstTangent = firstTangentScratch;
-                Cartesian3.multiplyByScalar(points[1], 2.0, firstTangent);
-                Cartesian3.subtract(firstTangent, points[2], firstTangent);
-                Cartesian3.subtract(firstTangent, points[0], firstTangent);
-                Cartesian3.multiplyByScalar(firstTangent, 0.5, firstTangent);
-            }
-
-            if (!defined(lastTangent)) {
-                var n = points.length - 1;
-                lastTangent = lastTangentScratch;
-                Cartesian3.multiplyByScalar(points[n - 1], 2.0, lastTangent);
-                Cartesian3.subtract(points[n], lastTangent, lastTangent);
-                Cartesian3.add(lastTangent, points[n - 2], lastTangent);
-                Cartesian3.multiplyByScalar(lastTangent, 0.5, lastTangent);
-            }
-        }
-
-        this._times = times;
-        this._points = points;
-        this._firstTangent = Cartesian3.clone(firstTangent);
-        this._lastTangent = Cartesian3.clone(lastTangent);
-
-        this._evaluateFunction = createEvaluateFunction(this);
-        this._lastTimeIndex = 0;
-    }
-
-    defineProperties(CatmullRomSpline.prototype, {
-        /**
-         * An array of times for the control points.
-         *
-         * @memberof CatmullRomSpline.prototype
-         *
-         * @type {Number[]}
-         * @readonly
-         */
-        times : {
-            get : function() {
-                return this._times;
-            }
-        },
-
-        /**
-         * An array of {@link Cartesian3} control points.
-         *
-         * @memberof CatmullRomSpline.prototype
-         *
-         * @type {Cartesian3[]}
-         * @readonly
-         */
-        points : {
-            get : function() {
-                return this._points;
-            }
-        },
-
-        /**
-         * The tangent at the first control point.
-         *
-         * @memberof CatmullRomSpline.prototype
-         *
-         * @type {Cartesian3}
-         * @readonly
-         */
-        firstTangent : {
-            get : function() {
-                return this._firstTangent;
-            }
-        },
-
-        /**
-         * The tangent at the last control point.
-         *
-         * @memberof CatmullRomSpline.prototype
-         *
-         * @type {Cartesian3}
-         * @readonly
-         */
-        lastTangent : {
-            get : function() {
-                return this._lastTangent;
-            }
-        }
-    });
-
-    /**
-     * @private
-     */
-    CatmullRomSpline.catmullRomCoefficientMatrix = new Matrix4(
-            -0.5,  1.0, -0.5,  0.0,
-             1.5, -2.5,  0.0,  1.0,
-            -1.5,  2.0,  0.5,  0.0,
-             0.5, -0.5,  0.0,  0.0);
-
-    /**
-     * Finds an index <code>i</code> in <code>times</code> such that the parameter
-     * <code>time</code> is in the interval <code>[times[i], times[i + 1]]</code>.
-     * @function
-     *
-     * @param {Number} time The time.
-     * @returns {Number} The index for the element at the start of the interval.
-     *
-     * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>
-     *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element
-     *                             in the array <code>times</code>.
-     */
-    CatmullRomSpline.prototype.findTimeInterval = Spline.prototype.findTimeInterval;
-
-    /**
-     * Wraps the given time to the period covered by the spline.
-     * @function
-     *
-     * @param {Number} time The time.
-     * @return {Number} The time, wrapped around to the updated animation.
-     */
-    CatmullRomSpline.prototype.wrapTime = Spline.prototype.wrapTime;
-
-    /**
-     * Clamps the given time to the period covered by the spline.
-     * @function
-     *
-     * @param {Number} time The time.
-     * @return {Number} The time, clamped to the animation period.
-     */
-    CatmullRomSpline.prototype.clampTime = Spline.prototype.clampTime;
-
-    /**
-     * Evaluates the curve at a given time.
-     *
-     * @param {Number} time The time at which to evaluate the curve.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter or a new instance of the point on the curve at the given time.
-     *
-     * @exception {DeveloperError} time must be in the range <code>[t<sub>0</sub>, t<sub>n</sub>]</code>, where <code>t<sub>0</sub></code>
-     *                             is the first element in the array <code>times</code> and <code>t<sub>n</sub></code> is the last element
-     *                             in the array <code>times</code>.
-     */
-    CatmullRomSpline.prototype.evaluate = function(time, result) {
-        return this._evaluateFunction(time, result);
-    };
-export default CatmullRomSpline;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1044
Source/Core/CesiumTerrainProvider.js


+ 0 - 178
Source/Core/Check.js

@@ -1,178 +0,0 @@
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * Contains functions for checking that supplied arguments are of a specified type
-     * or meet specified conditions
-     * @private
-     */
-    var Check = {};
-
-    /**
-     * Contains type checking functions, all using the typeof operator
-     */
-    Check.typeOf = {};
-
-    function getUndefinedErrorMessage(name) {
-        return name + ' is required, actual value was undefined';
-    }
-
-    function getFailedTypeErrorMessage(actual, expected, name) {
-        return 'Expected ' + name + ' to be typeof ' + expected + ', actual typeof was ' + actual;
-    }
-
-    /**
-     * Throws if test is not defined
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value that is to be checked
-     * @exception {DeveloperError} test must be defined
-     */
-    Check.defined = function (name, test) {
-        if (!defined(test)) {
-            throw new DeveloperError(getUndefinedErrorMessage(name));
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'function'
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @exception {DeveloperError} test must be typeof 'function'
-     */
-    Check.typeOf.func = function (name, test) {
-        if (typeof test !== 'function') {
-            throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'function', name));
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'string'
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @exception {DeveloperError} test must be typeof 'string'
-     */
-    Check.typeOf.string = function (name, test) {
-        if (typeof test !== 'string') {
-            throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'string', name));
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'number'
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @exception {DeveloperError} test must be typeof 'number'
-     */
-    Check.typeOf.number = function (name, test) {
-        if (typeof test !== 'number') {
-            throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'number', name));
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'number' and less than limit
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @param {Number} limit The limit value to compare against
-     * @exception {DeveloperError} test must be typeof 'number' and less than limit
-     */
-    Check.typeOf.number.lessThan = function (name, test, limit) {
-        Check.typeOf.number(name, test);
-        if (test >= limit) {
-            throw new DeveloperError('Expected ' + name + ' to be less than ' + limit + ', actual value was ' + test);
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'number' and less than or equal to limit
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @param {Number} limit The limit value to compare against
-     * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit
-     */
-    Check.typeOf.number.lessThanOrEquals = function (name, test, limit) {
-        Check.typeOf.number(name, test);
-        if (test > limit) {
-            throw new DeveloperError('Expected ' + name + ' to be less than or equal to ' + limit + ', actual value was ' + test);
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'number' and greater than limit
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @param {Number} limit The limit value to compare against
-     * @exception {DeveloperError} test must be typeof 'number' and greater than limit
-     */
-    Check.typeOf.number.greaterThan = function (name, test, limit) {
-        Check.typeOf.number(name, test);
-        if (test <= limit) {
-            throw new DeveloperError('Expected ' + name + ' to be greater than ' + limit + ', actual value was ' + test);
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'number' and greater than or equal to limit
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @param {Number} limit The limit value to compare against
-     * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit
-     */
-    Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) {
-        Check.typeOf.number(name, test);
-        if (test < limit) {
-            throw new DeveloperError('Expected ' + name + ' to be greater than or equal to' + limit + ', actual value was ' + test);
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'object'
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @exception {DeveloperError} test must be typeof 'object'
-     */
-    Check.typeOf.object = function (name, test) {
-        if (typeof test !== 'object') {
-            throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'object', name));
-        }
-    };
-
-    /**
-     * Throws if test is not typeof 'boolean'
-     *
-     * @param {String} name The name of the variable being tested
-     * @param {*} test The value to test
-     * @exception {DeveloperError} test must be typeof 'boolean'
-     */
-    Check.typeOf.bool = function (name, test) {
-        if (typeof test !== 'boolean') {
-            throw new DeveloperError(getFailedTypeErrorMessage(typeof test, 'boolean', name));
-        }
-    };
-
-    /**
-     * Throws if test1 and test2 is not typeof 'number' and not equal in value
-     *
-     * @param {String} name1 The name of the first variable being tested
-     * @param {String} name2 The name of the second variable being tested against
-     * @param {*} test1 The value to test
-     * @param {*} test2 The value to test against
-     * @exception {DeveloperError} test1 and test2 should be type of 'number' and be equal in value
-     */
-    Check.typeOf.number.equals = function (name1, name2, test1, test2) {
-        Check.typeOf.number(name1, test1);
-        Check.typeOf.number(name2, test2);
-        if (test1 !== test2) {
-            throw new DeveloperError(name1 + ' must be equal to ' + name2 + ', the actual values are ' + test1 + ' and ' + test2);
-        }
-    };
-export default Check;

+ 0 - 187
Source/Core/CircleGeometry.js

@@ -1,187 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import EllipseGeometry from './EllipseGeometry.js';
-import Ellipsoid from './Ellipsoid.js';
-import VertexFormat from './VertexFormat.js';
-
-    /**
-     * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
-     *
-     * @alias CircleGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.center The circle's center point in the fixed frame.
-     * @param {Number} options.radius The radius in meters.
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.
-     * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.
-     * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.
-     * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
-     *
-     * @exception {DeveloperError} radius must be greater than zero.
-     * @exception {DeveloperError} granularity must be greater than zero.
-     *
-     * @see CircleGeometry.createGeometry
-     * @see Packable
-     *
-     * @example
-     * // Create a circle.
-     * var circle = new Cesium.CircleGeometry({
-     *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
-     *   radius : 100000.0
-     * });
-     * var geometry = Cesium.CircleGeometry.createGeometry(circle);
-     */
-    function CircleGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var radius = options.radius;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('radius', radius);
-        //>>includeEnd('debug');
-
-        var ellipseGeometryOptions = {
-            center : options.center,
-            semiMajorAxis : radius,
-            semiMinorAxis : radius,
-            ellipsoid : options.ellipsoid,
-            height : options.height,
-            extrudedHeight : options.extrudedHeight,
-            granularity : options.granularity,
-            vertexFormat : options.vertexFormat,
-            stRotation : options.stRotation,
-            shadowVolume: options.shadowVolume
-        };
-        this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions);
-        this._workerName = 'createCircleGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    CircleGeometry.packedLength = EllipseGeometry.packedLength;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CircleGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CircleGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        //>>includeEnd('debug');
-        return EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex);
-    };
-
-    var scratchEllipseGeometry = new EllipseGeometry({
-        center : new Cartesian3(),
-        semiMajorAxis : 1.0,
-        semiMinorAxis : 1.0
-    });
-    var scratchOptions = {
-        center : new Cartesian3(),
-        radius : undefined,
-        ellipsoid : Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),
-        height : undefined,
-        extrudedHeight : undefined,
-        granularity : undefined,
-        vertexFormat : new VertexFormat(),
-        stRotation : undefined,
-        semiMajorAxis : undefined,
-        semiMinorAxis : undefined,
-        shadowVolume: undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CircleGeometry} [result] The object into which to store the result.
-     * @returns {CircleGeometry} The modified result parameter or a new CircleGeometry instance if one was not provided.
-     */
-    CircleGeometry.unpack = function(array, startingIndex, result) {
-        var ellipseGeometry = EllipseGeometry.unpack(array, startingIndex, scratchEllipseGeometry);
-        scratchOptions.center = Cartesian3.clone(ellipseGeometry._center, scratchOptions.center);
-        scratchOptions.ellipsoid = Ellipsoid.clone(ellipseGeometry._ellipsoid, scratchOptions.ellipsoid);
-        scratchOptions.height = ellipseGeometry._height;
-        scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;
-        scratchOptions.granularity = ellipseGeometry._granularity;
-        scratchOptions.vertexFormat = VertexFormat.clone(ellipseGeometry._vertexFormat, scratchOptions.vertexFormat);
-        scratchOptions.stRotation = ellipseGeometry._stRotation;
-        scratchOptions.shadowVolume = ellipseGeometry._shadowVolume;
-
-        if (!defined(result)) {
-            scratchOptions.radius = ellipseGeometry._semiMajorAxis;
-            return new CircleGeometry(scratchOptions);
-        }
-
-        scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;
-        scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;
-        result._ellipseGeometry = new EllipseGeometry(scratchOptions);
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CircleGeometry} circleGeometry A description of the circle.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CircleGeometry.createGeometry = function(circleGeometry) {
-        return EllipseGeometry.createGeometry(circleGeometry._ellipseGeometry);
-    };
-
-    /**
-     * @private
-     */
-    CircleGeometry.createShadowVolume = function(circleGeometry, minHeightFunc, maxHeightFunc) {
-        var granularity = circleGeometry._ellipseGeometry._granularity;
-        var ellipsoid = circleGeometry._ellipseGeometry._ellipsoid;
-
-        var minHeight = minHeightFunc(granularity, ellipsoid);
-        var maxHeight = maxHeightFunc(granularity, ellipsoid);
-
-        return new CircleGeometry({
-            center : circleGeometry._ellipseGeometry._center,
-            radius : circleGeometry._ellipseGeometry._semiMajorAxis,
-            ellipsoid : ellipsoid,
-            stRotation : circleGeometry._ellipseGeometry._stRotation,
-            granularity : granularity,
-            extrudedHeight : minHeight,
-            height : maxHeight,
-            vertexFormat : VertexFormat.POSITION_ONLY,
-            shadowVolume: true
-        });
-    };
-
-    defineProperties(CircleGeometry.prototype, {
-        /**
-         * @private
-         */
-        rectangle : {
-            get : function() {
-                return this._ellipseGeometry.rectangle;
-            }
-        },
-        /**
-         * For remapping texture coordinates when rendering CircleGeometries as GroundPrimitives.
-         * @private
-         */
-        textureCoordinateRotationPoints : {
-            get : function() {
-                return this._ellipseGeometry.textureCoordinateRotationPoints;
-            }
-        }
-    });
-export default CircleGeometry;

+ 0 - 135
Source/Core/CircleOutlineGeometry.js

@@ -1,135 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import EllipseOutlineGeometry from './EllipseOutlineGeometry.js';
-import Ellipsoid from './Ellipsoid.js';
-
-    /**
-     * A description of the outline of a circle on the ellipsoid.
-     *
-     * @alias CircleOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.center The circle's center point in the fixed frame.
-     * @param {Number} options.radius The radius in meters.
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.
-     * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.
-     * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.
-     * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.
-     * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.
-     *
-     * @exception {DeveloperError} radius must be greater than zero.
-     * @exception {DeveloperError} granularity must be greater than zero.
-     *
-     * @see CircleOutlineGeometry.createGeometry
-     * @see Packable
-     *
-     * @example
-     * // Create a circle.
-     * var circle = new Cesium.CircleOutlineGeometry({
-     *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
-     *   radius : 100000.0
-     * });
-     * var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
-     */
-    function CircleOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var radius = options.radius;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('radius', radius);
-        //>>includeEnd('debug');
-
-        var ellipseGeometryOptions = {
-            center : options.center,
-            semiMajorAxis : radius,
-            semiMinorAxis : radius,
-            ellipsoid : options.ellipsoid,
-            height : options.height,
-            extrudedHeight : options.extrudedHeight,
-            granularity : options.granularity,
-            numberOfVerticalLines : options.numberOfVerticalLines
-        };
-        this._ellipseGeometry = new EllipseOutlineGeometry(ellipseGeometryOptions);
-        this._workerName = 'createCircleOutlineGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    CircleOutlineGeometry.packedLength = EllipseOutlineGeometry.packedLength;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CircleOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CircleOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        //>>includeEnd('debug');
-        return EllipseOutlineGeometry.pack(value._ellipseGeometry, array, startingIndex);
-    };
-
-    var scratchEllipseGeometry = new EllipseOutlineGeometry({
-        center : new Cartesian3(),
-        semiMajorAxis : 1.0,
-        semiMinorAxis : 1.0
-    });
-    var scratchOptions = {
-        center : new Cartesian3(),
-        radius : undefined,
-        ellipsoid : Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),
-        height : undefined,
-        extrudedHeight : undefined,
-        granularity : undefined,
-        numberOfVerticalLines : undefined,
-        semiMajorAxis : undefined,
-        semiMinorAxis : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CircleOutlineGeometry} [result] The object into which to store the result.
-     * @returns {CircleOutlineGeometry} The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
-     */
-    CircleOutlineGeometry.unpack = function(array, startingIndex, result) {
-        var ellipseGeometry = EllipseOutlineGeometry.unpack(array, startingIndex, scratchEllipseGeometry);
-        scratchOptions.center = Cartesian3.clone(ellipseGeometry._center, scratchOptions.center);
-        scratchOptions.ellipsoid = Ellipsoid.clone(ellipseGeometry._ellipsoid, scratchOptions.ellipsoid);
-        scratchOptions.height = ellipseGeometry._height;
-        scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;
-        scratchOptions.granularity = ellipseGeometry._granularity;
-        scratchOptions.numberOfVerticalLines = ellipseGeometry._numberOfVerticalLines;
-
-        if (!defined(result)) {
-            scratchOptions.radius = ellipseGeometry._semiMajorAxis;
-            return new CircleOutlineGeometry(scratchOptions);
-        }
-
-        scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;
-        scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;
-        result._ellipseGeometry = new EllipseOutlineGeometry(scratchOptions);
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CircleOutlineGeometry} circleGeometry A description of the circle.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CircleOutlineGeometry.createGeometry = function(circleGeometry) {
-        return EllipseOutlineGeometry.createGeometry(circleGeometry._ellipseGeometry);
-    };
-export default CircleOutlineGeometry;

+ 0 - 305
Source/Core/Clock.js

@@ -1,305 +0,0 @@
-import ClockRange from './ClockRange.js';
-import ClockStep from './ClockStep.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Event from './Event.js';
-import getTimestamp from './getTimestamp.js';
-import JulianDate from './JulianDate.js';
-
-    /**
-     * A simple clock for keeping track of simulated time.
-     *
-     * @alias Clock
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {JulianDate} [options.startTime] The start time of the clock.
-     * @param {JulianDate} [options.stopTime] The stop time of the clock.
-     * @param {JulianDate} [options.currentTime] The current time.
-     * @param {Number} [options.multiplier=1.0] Determines how much time advances when {@link Clock#tick} is called, negative values allow for advancing backwards.
-     * @param {ClockStep} [options.clockStep=ClockStep.SYSTEM_CLOCK_MULTIPLIER] Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
-     * @param {ClockRange} [options.clockRange=ClockRange.UNBOUNDED] Determines how the clock should behave when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
-     * @param {Boolean} [options.canAnimate=true] Indicates whether {@link Clock#tick} can advance time.  This could be false if data is being buffered, for example.  The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
-     * @param {Boolean} [options.shouldAnimate=false] Indicates whether {@link Clock#tick} should attempt to advance time.  The clock will only tick when both {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
-     *
-     * @exception {DeveloperError} startTime must come before stopTime.
-     *
-     *
-     * @example
-     * // Create a clock that loops on Christmas day 2013 and runs in real-time.
-     * var clock = new Cesium.Clock({
-     *    startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
-     *    currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
-     *    stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
-     *    clockRange : Cesium.ClockRange.LOOP_STOP,
-     *    clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
-     * });
-     *
-     * @see ClockStep
-     * @see ClockRange
-     * @see JulianDate
-     */
-    function Clock(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var currentTime = options.currentTime;
-        var startTime = options.startTime;
-        var stopTime = options.stopTime;
-
-        if (!defined(currentTime)) {
-            // if not specified, current time is the start time,
-            // or if that is not specified, 1 day before the stop time,
-            // or if that is not specified, then now.
-            if (defined(startTime)) {
-                currentTime = JulianDate.clone(startTime);
-            } else if (defined(stopTime)) {
-                currentTime = JulianDate.addDays(stopTime, -1.0, new JulianDate());
-            } else {
-                currentTime = JulianDate.now();
-            }
-        } else {
-            currentTime = JulianDate.clone(currentTime);
-        }
-
-        if (!defined(startTime)) {
-            // if not specified, start time is the current time
-            // (as determined above)
-            startTime = JulianDate.clone(currentTime);
-        } else {
-            startTime = JulianDate.clone(startTime);
-        }
-
-        if (!defined(stopTime)) {
-            // if not specified, stop time is 1 day after the start time
-            // (as determined above)
-            stopTime = JulianDate.addDays(startTime, 1.0, new JulianDate());
-        } else {
-            stopTime = JulianDate.clone(stopTime);
-        }
-
-        //>>includeStart('debug', pragmas.debug);
-        if (JulianDate.greaterThan(startTime, stopTime)) {
-            throw new DeveloperError('startTime must come before stopTime.');
-        }
-        //>>includeEnd('debug');
-
-        /**
-         * The start time of the clock.
-         * @type {JulianDate}
-         */
-        this.startTime = startTime;
-
-        /**
-         * The stop time of the clock.
-         * @type {JulianDate}
-         */
-        this.stopTime = stopTime;
-
-        /**
-         * Determines how the clock should behave when
-         * {@link Clock#startTime} or {@link Clock#stopTime}
-         * is reached.
-         * @type {ClockRange}
-         * @default {@link ClockRange.UNBOUNDED}
-         */
-        this.clockRange = defaultValue(options.clockRange, ClockRange.UNBOUNDED);
-
-        /**
-         * Indicates whether {@link Clock#tick} can advance time.  This could be false if data is being buffered,
-         * for example.  The clock will only advance time when both
-         * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
-         * @type {Boolean}
-         * @default true
-         */
-        this.canAnimate = defaultValue(options.canAnimate, true);
-
-        /**
-         * An {@link Event} that is fired whenever {@link Clock#tick} is called.
-         * @type {Event}
-         */
-        this.onTick = new Event();
-        /**
-         * An {@link Event} that is fired whenever {@link Clock#stopTime} is reached.
-         * @type {Event}
-         */
-        this.onStop = new Event();
-
-        this._currentTime = undefined;
-        this._multiplier = undefined;
-        this._clockStep = undefined;
-        this._shouldAnimate = undefined;
-        this._lastSystemTime = getTimestamp();
-
-        // set values using the property setters to
-        // make values consistent.
-
-        this.currentTime = currentTime;
-        this.multiplier = defaultValue(options.multiplier, 1.0);
-        this.shouldAnimate = defaultValue(options.shouldAnimate, false);
-        this.clockStep = defaultValue(options.clockStep, ClockStep.SYSTEM_CLOCK_MULTIPLIER);
-    }
-
-    defineProperties(Clock.prototype, {
-        /**
-         * The current time.
-         * Changing this property will change
-         * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
-         * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
-         * @memberof Clock.prototype
-         * @type {JulianDate}
-         */
-        currentTime : {
-            get : function() {
-                return this._currentTime;
-            },
-            set : function(value) {
-                if (JulianDate.equals(this._currentTime, value)) {
-                    return;
-                }
-
-                if (this._clockStep === ClockStep.SYSTEM_CLOCK) {
-                    this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;
-                }
-
-                this._currentTime = value;
-            }
-        },
-
-        /**
-         * Gets or sets how much time advances when {@link Clock#tick} is called. Negative values allow for advancing backwards.
-         * If {@link Clock#clockStep} is set to {@link ClockStep.TICK_DEPENDENT}, this is the number of seconds to advance.
-         * If {@link Clock#clockStep} is set to {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}, this value is multiplied by the
-         * elapsed system time since the last call to {@link Clock#tick}.
-         * Changing this property will change
-         * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
-         * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
-         * @memberof Clock.prototype
-         * @type {Number}
-         * @default 1.0
-         */
-        multiplier : {
-            get : function() {
-                return this._multiplier;
-            },
-            set : function(value) {
-                if (this._multiplier === value) {
-                    return;
-                }
-
-                if (this._clockStep === ClockStep.SYSTEM_CLOCK) {
-                    this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;
-                }
-
-                this._multiplier = value;
-            }
-        },
-
-        /**
-         * Determines if calls to {@link Clock#tick} are frame dependent or system clock dependent.
-         * Changing this property to {@link ClockStep.SYSTEM_CLOCK} will set
-         * {@link Clock#multiplier} to 1.0, {@link Clock#shouldAnimate} to true, and
-         * {@link Clock#currentTime} to the current system clock time.
-         * @memberof Clock.prototype
-         * @type ClockStep
-         * @default {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}
-         */
-        clockStep : {
-            get : function() {
-                return this._clockStep;
-            },
-            set : function(value) {
-                if (value === ClockStep.SYSTEM_CLOCK) {
-                    this._multiplier = 1.0;
-                    this._shouldAnimate = true;
-                    this._currentTime = JulianDate.now();
-                }
-
-                this._clockStep = value;
-            }
-        },
-
-        /**
-         * Indicates whether {@link Clock#tick} should attempt to advance time.
-         * The clock will only advance time when both
-         * {@link Clock#canAnimate} and {@link Clock#shouldAnimate} are true.
-         * Changing this property will change
-         * {@link Clock#clockStep} from {@link ClockStep.SYSTEM_CLOCK} to
-         * {@link ClockStep.SYSTEM_CLOCK_MULTIPLIER}.
-         * @memberof Clock.prototype
-         * @type {Boolean}
-         * @default false
-         */
-        shouldAnimate : {
-            get : function() {
-                return this._shouldAnimate;
-            },
-            set : function(value) {
-                if (this._shouldAnimate === value) {
-                    return;
-                }
-
-                if (this._clockStep === ClockStep.SYSTEM_CLOCK) {
-                    this._clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;
-                }
-
-                this._shouldAnimate = value;
-            }
-        }
-    });
-
-    /**
-     * Advances the clock from the current time based on the current configuration options.
-     * tick should be called every frame, regardless of whether animation is taking place
-     * or not.  To control animation, use the {@link Clock#shouldAnimate} property.
-     *
-     * @returns {JulianDate} The new value of the {@link Clock#currentTime} property.
-     */
-    Clock.prototype.tick = function() {
-        var currentSystemTime = getTimestamp();
-        var currentTime = JulianDate.clone(this._currentTime);
-
-        if (this.canAnimate && this._shouldAnimate) {
-            var clockStep = this._clockStep;
-            if (clockStep === ClockStep.SYSTEM_CLOCK) {
-                currentTime = JulianDate.now(currentTime);
-            } else {
-                var multiplier = this._multiplier;
-
-                if (clockStep === ClockStep.TICK_DEPENDENT) {
-                    currentTime = JulianDate.addSeconds(currentTime, multiplier, currentTime);
-                } else {
-                    var milliseconds = currentSystemTime - this._lastSystemTime;
-                    currentTime = JulianDate.addSeconds(currentTime, multiplier * (milliseconds / 1000.0), currentTime);
-                }
-
-                var clockRange = this.clockRange;
-                var startTime = this.startTime;
-                var stopTime = this.stopTime;
-
-                if (clockRange === ClockRange.CLAMPED) {
-                    if (JulianDate.lessThan(currentTime, startTime)) {
-                        currentTime = JulianDate.clone(startTime, currentTime);
-                    } else if (JulianDate.greaterThan(currentTime, stopTime)) {
-                        currentTime = JulianDate.clone(stopTime, currentTime);
-                        this.onStop.raiseEvent(this);
-                    }
-                } else if (clockRange === ClockRange.LOOP_STOP) {
-                    if (JulianDate.lessThan(currentTime, startTime)) {
-                        currentTime = JulianDate.clone(startTime, currentTime);
-                    }
-                    while (JulianDate.greaterThan(currentTime, stopTime)) {
-                        currentTime = JulianDate.addSeconds(startTime, JulianDate.secondsDifference(currentTime, stopTime), currentTime);
-                        this.onStop.raiseEvent(this);
-                    }
-                }
-            }
-        }
-
-        this._currentTime = currentTime;
-        this._lastSystemTime = currentSystemTime;
-        this.onTick.raiseEvent(this);
-        return currentTime;
-    };
-export default Clock;

+ 0 - 41
Source/Core/ClockRange.js

@@ -1,41 +0,0 @@
-import freezeObject from './freezeObject.js';
-
-    /**
-     * Constants used by {@link Clock#tick} to determine behavior
-     * when {@link Clock#startTime} or {@link Clock#stopTime} is reached.
-     *
-     * @exports ClockRange
-     *
-     * @see Clock
-     * @see ClockStep
-     */
-    var ClockRange = {
-        /**
-         * {@link Clock#tick} will always advances the clock in its current direction.
-         *
-         * @type {Number}
-         * @constant
-         */
-        UNBOUNDED : 0,
-
-        /**
-         * When {@link Clock#startTime} or {@link Clock#stopTime} is reached,
-         * {@link Clock#tick} will not advance {@link Clock#currentTime} any further.
-         *
-         * @type {Number}
-         * @constant
-         */
-        CLAMPED : 1,
-
-        /**
-         * When {@link Clock#stopTime} is reached, {@link Clock#tick} will advance
-         * {@link Clock#currentTime} to the opposite end of the interval.  When
-         * time is moving backwards, {@link Clock#tick} will not advance past
-         * {@link Clock#startTime}
-         *
-         * @type {Number}
-         * @constant
-         */
-        LOOP_STOP : 2
-    };
-export default freezeObject(ClockRange);

+ 0 - 40
Source/Core/ClockStep.js

@@ -1,40 +0,0 @@
-import freezeObject from './freezeObject.js';
-
-    /**
-     * Constants to determine how much time advances with each call
-     * to {@link Clock#tick}.
-     *
-     * @exports ClockStep
-     *
-     * @see Clock
-     * @see ClockRange
-     */
-    var ClockStep = {
-        /**
-         * {@link Clock#tick} advances the current time by a fixed step,
-         * which is the number of seconds specified by {@link Clock#multiplier}.
-         *
-         * @type {Number}
-         * @constant
-         */
-        TICK_DEPENDENT : 0,
-
-        /**
-         * {@link Clock#tick} advances the current time by the amount of system
-         * time elapsed since the previous call multiplied by {@link Clock#multiplier}.
-         *
-         * @type {Number}
-         * @constant
-         */
-        SYSTEM_CLOCK_MULTIPLIER : 1,
-
-        /**
-         * {@link Clock#tick} sets the clock to the current system time;
-         * ignoring all other settings.
-         *
-         * @type {Number}
-         * @constant
-         */
-        SYSTEM_CLOCK : 2
-    };
-export default freezeObject(ClockStep);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 2173
Source/Core/Color.js


+ 0 - 176
Source/Core/ColorGeometryInstanceAttribute.js

@@ -1,176 +0,0 @@
-import Color from './Color.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * Value and type information for per-instance geometry color.
-     *
-     * @alias ColorGeometryInstanceAttribute
-     * @constructor
-     *
-     * @param {Number} [red=1.0] The red component.
-     * @param {Number} [green=1.0] The green component.
-     * @param {Number} [blue=1.0] The blue component.
-     * @param {Number} [alpha=1.0] The alpha component.
-     *
-     *
-     * @example
-     * var instance = new Cesium.GeometryInstance({
-     *   geometry : Cesium.BoxGeometry.fromDimensions({
-     *     dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
-     *   }),
-     *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
-     *     Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
-     *   id : 'box',
-     *   attributes : {
-     *     color : new Cesium.ColorGeometryInstanceAttribute(red, green, blue, alpha)
-     *   }
-     * });
-     *
-     * @see GeometryInstance
-     * @see GeometryInstanceAttribute
-     */
-    function ColorGeometryInstanceAttribute(red, green, blue, alpha) {
-        red = defaultValue(red, 1.0);
-        green = defaultValue(green, 1.0);
-        blue = defaultValue(blue, 1.0);
-        alpha = defaultValue(alpha, 1.0);
-
-        /**
-         * The values for the attributes stored in a typed array.
-         *
-         * @type Uint8Array
-         *
-         * @default [255, 255, 255, 255]
-         */
-        this.value = new Uint8Array([
-            Color.floatToByte(red),
-            Color.floatToByte(green),
-            Color.floatToByte(blue),
-            Color.floatToByte(alpha)
-        ]);
-    }
-
-    defineProperties(ColorGeometryInstanceAttribute.prototype, {
-        /**
-         * The datatype of each component in the attribute, e.g., individual elements in
-         * {@link ColorGeometryInstanceAttribute#value}.
-         *
-         * @memberof ColorGeometryInstanceAttribute.prototype
-         *
-         * @type {ComponentDatatype}
-         * @readonly
-         *
-         * @default {@link ComponentDatatype.UNSIGNED_BYTE}
-         */
-        componentDatatype : {
-            get : function() {
-                return ComponentDatatype.UNSIGNED_BYTE;
-            }
-        },
-
-        /**
-         * The number of components in the attributes, i.e., {@link ColorGeometryInstanceAttribute#value}.
-         *
-         * @memberof ColorGeometryInstanceAttribute.prototype
-         *
-         * @type {Number}
-         * @readonly
-         *
-         * @default 4
-         */
-        componentsPerAttribute : {
-            get : function() {
-                return 4;
-            }
-        },
-
-        /**
-         * When <code>true</code> and <code>componentDatatype</code> is an integer format,
-         * indicate that the components should be mapped to the range [0, 1] (unsigned)
-         * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
-         *
-         * @memberof ColorGeometryInstanceAttribute.prototype
-         *
-         * @type {Boolean}
-         * @readonly
-         *
-         * @default true
-         */
-        normalize : {
-            get : function() {
-                return true;
-            }
-        }
-    });
-
-    /**
-     * Creates a new {@link ColorGeometryInstanceAttribute} instance given the provided {@link Color}.
-     *
-     * @param {Color} color The color.
-     * @returns {ColorGeometryInstanceAttribute} The new {@link ColorGeometryInstanceAttribute} instance.
-     *
-     * @example
-     * var instance = new Cesium.GeometryInstance({
-     *   geometry : geometry,
-     *   attributes : {
-     *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.CORNFLOWERBLUE),
-     *   }
-     * });
-     */
-    ColorGeometryInstanceAttribute.fromColor = function(color) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(color)) {
-            throw new DeveloperError('color is required.');
-        }
-        //>>includeEnd('debug');
-
-        return new ColorGeometryInstanceAttribute(color.red, color.green, color.blue, color.alpha);
-    };
-
-    /**
-     * Converts a color to a typed array that can be used to assign a color attribute.
-     *
-     * @param {Color} color The color.
-     * @param {Uint8Array} [result] The array to store the result in, if undefined a new instance will be created.
-     *
-     * @returns {Uint8Array} The modified result parameter or a new instance if result was undefined.
-     *
-     * @example
-     * var attributes = primitive.getGeometryInstanceAttributes('an id');
-     * attributes.color = Cesium.ColorGeometryInstanceAttribute.toValue(Cesium.Color.AQUA, attributes.color);
-     */
-    ColorGeometryInstanceAttribute.toValue = function(color, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(color)) {
-            throw new DeveloperError('color is required.');
-        }
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            return new Uint8Array(color.toBytes());
-        }
-        return color.toBytes(result);
-    };
-
-    /**
-     * Compares the provided ColorGeometryInstanceAttributes and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {ColorGeometryInstanceAttribute} [left] The first ColorGeometryInstanceAttribute.
-     * @param {ColorGeometryInstanceAttribute} [right] The second ColorGeometryInstanceAttribute.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    ColorGeometryInstanceAttribute.equals = function(left, right) {
-        return (left === right) ||
-               (defined(left) &&
-                defined(right) &&
-                left.value[0] === right.value[0] &&
-                left.value[1] === right.value[1] &&
-                left.value[2] === right.value[2] &&
-                left.value[3] === right.value[3]);
-    };
-export default ColorGeometryInstanceAttribute;

+ 0 - 321
Source/Core/ComponentDatatype.js

@@ -1,321 +0,0 @@
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
-import WebGLConstants from './WebGLConstants.js';
-
-    /**
-     * WebGL component datatypes.  Components are intrinsics,
-     * which form attributes, which form vertices.
-     *
-     * @exports ComponentDatatype
-     */
-    var ComponentDatatype = {
-        /**
-         * 8-bit signed byte corresponding to <code>gl.BYTE</code> and the type
-         * of an element in <code>Int8Array</code>.
-         *
-         * @type {Number}
-         * @constant
-         */
-        BYTE : WebGLConstants.BYTE,
-
-        /**
-         * 8-bit unsigned byte corresponding to <code>UNSIGNED_BYTE</code> and the type
-         * of an element in <code>Uint8Array</code>.
-         *
-         * @type {Number}
-         * @constant
-         */
-        UNSIGNED_BYTE : WebGLConstants.UNSIGNED_BYTE,
-
-        /**
-         * 16-bit signed short corresponding to <code>SHORT</code> and the type
-         * of an element in <code>Int16Array</code>.
-         *
-         * @type {Number}
-         * @constant
-         */
-        SHORT : WebGLConstants.SHORT,
-
-        /**
-         * 16-bit unsigned short corresponding to <code>UNSIGNED_SHORT</code> and the type
-         * of an element in <code>Uint16Array</code>.
-         *
-         * @type {Number}
-         * @constant
-         */
-        UNSIGNED_SHORT : WebGLConstants.UNSIGNED_SHORT,
-
-        /**
-         * 32-bit signed int corresponding to <code>INT</code> and the type
-         * of an element in <code>Int32Array</code>.
-         *
-         * @memberOf ComponentDatatype
-         *
-         * @type {Number}
-         * @constant
-         */
-        INT : WebGLConstants.INT,
-
-        /**
-         * 32-bit unsigned int corresponding to <code>UNSIGNED_INT</code> and the type
-         * of an element in <code>Uint32Array</code>.
-         *
-         * @memberOf ComponentDatatype
-         *
-         * @type {Number}
-         * @constant
-         */
-        UNSIGNED_INT : WebGLConstants.UNSIGNED_INT,
-
-        /**
-         * 32-bit floating-point corresponding to <code>FLOAT</code> and the type
-         * of an element in <code>Float32Array</code>.
-         *
-         * @type {Number}
-         * @constant
-         */
-        FLOAT : WebGLConstants.FLOAT,
-
-        /**
-         * 64-bit floating-point corresponding to <code>gl.DOUBLE</code> (in Desktop OpenGL;
-         * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
-         * and the type of an element in <code>Float64Array</code>.
-         *
-         * @memberOf ComponentDatatype
-         *
-         * @type {Number}
-         * @constant
-         * @default 0x140A
-         */
-        DOUBLE : WebGLConstants.DOUBLE
-    };
-
-    /**
-     * Returns the size, in bytes, of the corresponding datatype.
-     *
-     * @param {ComponentDatatype} componentDatatype The component datatype to get the size of.
-     * @returns {Number} The size in bytes.
-     *
-     * @exception {DeveloperError} componentDatatype is not a valid value.
-     *
-     * @example
-     * // Returns Int8Array.BYTES_PER_ELEMENT
-     * var size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);
-     */
-    ComponentDatatype.getSizeInBytes = function(componentDatatype){
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(componentDatatype)) {
-            throw new DeveloperError('value is required.');
-        }
-        //>>includeEnd('debug');
-
-        switch (componentDatatype) {
-        case ComponentDatatype.BYTE:
-            return Int8Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.UNSIGNED_BYTE:
-            return Uint8Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.SHORT:
-            return Int16Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.UNSIGNED_SHORT:
-            return Uint16Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.INT:
-            return Int32Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.UNSIGNED_INT:
-            return Uint32Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.FLOAT:
-            return Float32Array.BYTES_PER_ELEMENT;
-        case ComponentDatatype.DOUBLE:
-            return Float64Array.BYTES_PER_ELEMENT;
-        //>>includeStart('debug', pragmas.debug);
-        default:
-            throw new DeveloperError('componentDatatype is not a valid value.');
-        //>>includeEnd('debug');
-        }
-    };
-
-    /**
-     * Gets the {@link ComponentDatatype} for the provided TypedArray instance.
-     *
-     * @param {TypedArray} array The typed array.
-     * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray.
-     */
-    ComponentDatatype.fromTypedArray = function(array) {
-        if (array instanceof Int8Array) {
-            return ComponentDatatype.BYTE;
-        }
-        if (array instanceof Uint8Array) {
-            return ComponentDatatype.UNSIGNED_BYTE;
-        }
-        if (array instanceof Int16Array) {
-            return ComponentDatatype.SHORT;
-        }
-        if (array instanceof Uint16Array) {
-            return ComponentDatatype.UNSIGNED_SHORT;
-        }
-        if (array instanceof Int32Array) {
-            return ComponentDatatype.INT;
-        }
-        if (array instanceof Uint32Array) {
-            return ComponentDatatype.UNSIGNED_INT;
-        }
-        if (array instanceof Float32Array) {
-            return ComponentDatatype.FLOAT;
-        }
-        if (array instanceof Float64Array) {
-            return ComponentDatatype.DOUBLE;
-        }
-    };
-
-    /**
-     * Validates that the provided component datatype is a valid {@link ComponentDatatype}
-     *
-     * @param {ComponentDatatype} componentDatatype The component datatype to validate.
-     * @returns {Boolean} <code>true</code> if the provided component datatype is a valid value; otherwise, <code>false</code>.
-     *
-     * @example
-     * if (!Cesium.ComponentDatatype.validate(componentDatatype)) {
-     *   throw new Cesium.DeveloperError('componentDatatype must be a valid value.');
-     * }
-     */
-    ComponentDatatype.validate = function(componentDatatype) {
-        return defined(componentDatatype) &&
-               (componentDatatype === ComponentDatatype.BYTE ||
-                componentDatatype === ComponentDatatype.UNSIGNED_BYTE ||
-                componentDatatype === ComponentDatatype.SHORT ||
-                componentDatatype === ComponentDatatype.UNSIGNED_SHORT ||
-                componentDatatype === ComponentDatatype.INT ||
-                componentDatatype === ComponentDatatype.UNSIGNED_INT ||
-                componentDatatype === ComponentDatatype.FLOAT ||
-                componentDatatype === ComponentDatatype.DOUBLE);
-    };
-
-    /**
-     * Creates a typed array corresponding to component data type.
-     *
-     * @param {ComponentDatatype} componentDatatype The component data type.
-     * @param {Number|Array} valuesOrLength The length of the array to create or an array.
-     * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array.
-     *
-     * @exception {DeveloperError} componentDatatype is not a valid value.
-     *
-     * @example
-     * // creates a Float32Array with length of 100
-     * var typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);
-     */
-    ComponentDatatype.createTypedArray = function(componentDatatype, valuesOrLength) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(componentDatatype)) {
-            throw new DeveloperError('componentDatatype is required.');
-        }
-        if (!defined(valuesOrLength)) {
-            throw new DeveloperError('valuesOrLength is required.');
-        }
-        //>>includeEnd('debug');
-
-        switch (componentDatatype) {
-        case ComponentDatatype.BYTE:
-            return new Int8Array(valuesOrLength);
-        case ComponentDatatype.UNSIGNED_BYTE:
-            return new Uint8Array(valuesOrLength);
-        case ComponentDatatype.SHORT:
-            return new Int16Array(valuesOrLength);
-        case ComponentDatatype.UNSIGNED_SHORT:
-            return new Uint16Array(valuesOrLength);
-        case ComponentDatatype.INT:
-            return new Int32Array(valuesOrLength);
-        case ComponentDatatype.UNSIGNED_INT:
-            return new Uint32Array(valuesOrLength);
-        case ComponentDatatype.FLOAT:
-            return new Float32Array(valuesOrLength);
-        case ComponentDatatype.DOUBLE:
-            return new Float64Array(valuesOrLength);
-        //>>includeStart('debug', pragmas.debug);
-        default:
-            throw new DeveloperError('componentDatatype is not a valid value.');
-        //>>includeEnd('debug');
-        }
-    };
-
-    /**
-     * Creates a typed view of an array of bytes.
-     *
-     * @param {ComponentDatatype} componentDatatype The type of the view to create.
-     * @param {ArrayBuffer} buffer The buffer storage to use for the view.
-     * @param {Number} [byteOffset] The offset, in bytes, to the first element in the view.
-     * @param {Number} [length] The number of elements in the view.
-     * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array view of the buffer.
-     *
-     * @exception {DeveloperError} componentDatatype is not a valid value.
-     */
-    ComponentDatatype.createArrayBufferView = function(componentDatatype, buffer, byteOffset, length) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(componentDatatype)) {
-            throw new DeveloperError('componentDatatype is required.');
-        }
-        if (!defined(buffer)) {
-            throw new DeveloperError('buffer is required.');
-        }
-        //>>includeEnd('debug');
-
-        byteOffset = defaultValue(byteOffset, 0);
-        length = defaultValue(length, (buffer.byteLength - byteOffset) / ComponentDatatype.getSizeInBytes(componentDatatype));
-
-        switch (componentDatatype) {
-        case ComponentDatatype.BYTE:
-            return new Int8Array(buffer, byteOffset, length);
-        case ComponentDatatype.UNSIGNED_BYTE:
-            return new Uint8Array(buffer, byteOffset, length);
-        case ComponentDatatype.SHORT:
-            return new Int16Array(buffer, byteOffset, length);
-        case ComponentDatatype.UNSIGNED_SHORT:
-            return new Uint16Array(buffer, byteOffset, length);
-        case ComponentDatatype.INT:
-            return new Int32Array(buffer, byteOffset, length);
-        case ComponentDatatype.UNSIGNED_INT:
-            return new Uint32Array(buffer, byteOffset, length);
-        case ComponentDatatype.FLOAT:
-            return new Float32Array(buffer, byteOffset, length);
-        case ComponentDatatype.DOUBLE:
-            return new Float64Array(buffer, byteOffset, length);
-        //>>includeStart('debug', pragmas.debug);
-        default:
-            throw new DeveloperError('componentDatatype is not a valid value.');
-        //>>includeEnd('debug');
-        }
-    };
-
-    /**
-     * Get the ComponentDatatype from its name.
-     *
-     * @param {String} name The name of the ComponentDatatype.
-     * @returns {ComponentDatatype} The ComponentDatatype.
-     *
-     * @exception {DeveloperError} name is not a valid value.
-     */
-    ComponentDatatype.fromName = function(name) {
-        switch (name) {
-            case 'BYTE':
-                return ComponentDatatype.BYTE;
-            case 'UNSIGNED_BYTE':
-                return ComponentDatatype.UNSIGNED_BYTE;
-            case 'SHORT':
-                return ComponentDatatype.SHORT;
-            case 'UNSIGNED_SHORT':
-                return ComponentDatatype.UNSIGNED_SHORT;
-            case 'INT':
-                return ComponentDatatype.INT;
-            case 'UNSIGNED_INT':
-                return ComponentDatatype.UNSIGNED_INT;
-            case 'FLOAT':
-                return ComponentDatatype.FLOAT;
-            case 'DOUBLE':
-                return ComponentDatatype.DOUBLE;
-            //>>includeStart('debug', pragmas.debug);
-            default:
-                throw new DeveloperError('name is not a valid value.');
-            //>>includeEnd('debug');
-        }
-    };
-export default freezeObject(ComponentDatatype);

+ 0 - 90
Source/Core/CompressedTextureBuffer.js

@@ -1,90 +0,0 @@
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-
-    /**
-     * Describes a compressed texture and contains a compressed texture buffer.
-     * @alias CompressedTextureBuffer
-     * @constructor
-     *
-     * @param {PixelFormat} internalFormat The pixel format of the compressed texture.
-     * @param {Number} width The width of the texture.
-     * @param {Number} height The height of the texture.
-     * @param {Uint8Array} buffer The compressed texture buffer.
-     */
-    function CompressedTextureBuffer(internalFormat, width, height, buffer) {
-        this._format = internalFormat;
-        this._width = width;
-        this._height = height;
-        this._buffer =  buffer;
-    }
-
-    defineProperties(CompressedTextureBuffer.prototype, {
-        /**
-         * The format of the compressed texture.
-         * @type PixelFormat
-         * @readonly
-         * @memberof CompressedTextureBuffer.prototype
-         */
-        internalFormat : {
-            get : function() {
-                return this._format;
-            }
-        },
-        /**
-         * The width of the texture.
-         * @type Number
-         * @readonly
-         * @memberof CompressedTextureBuffer.prototype
-         */
-        width : {
-            get : function() {
-                return this._width;
-            }
-        },
-        /**
-         * The height of the texture.
-         * @type Number
-         * @readonly
-         * @memberof CompressedTextureBuffer.prototype
-         */
-        height : {
-            get : function() {
-                return this._height;
-            }
-        },
-        /**
-         * The compressed texture buffer.
-         * @type Uint8Array
-         * @readonly
-         * @memberof CompressedTextureBuffer.prototype
-         */
-        bufferView : {
-            get : function() {
-                return this._buffer;
-            }
-        }
-    });
-
-    /**
-     * Creates a shallow clone of a compressed texture buffer.
-     *
-     * @param {CompressedTextureBuffer} object The compressed texture buffer to be cloned.
-     * @return {CompressedTextureBuffer} A shallow clone of the compressed texture buffer.
-     */
-    CompressedTextureBuffer.clone = function(object) {
-        if (!defined(object)) {
-            return undefined;
-        }
-
-        return new CompressedTextureBuffer(object._format, object._width, object._height, object._buffer);
-    };
-
-    /**
-     * Creates a shallow clone of this compressed texture buffer.
-     *
-     * @return {CompressedTextureBuffer} A shallow clone of the compressed texture buffer.
-     */
-    CompressedTextureBuffer.prototype.clone = function() {
-        return CompressedTextureBuffer.clone(this);
-    };
-export default CompressedTextureBuffer;

+ 0 - 426
Source/Core/CoplanarPolygonGeometry.js

@@ -1,426 +0,0 @@
-import arrayRemoveDuplicates from './arrayRemoveDuplicates.js';
-import BoundingRectangle from './BoundingRectangle.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import CoplanarPolygonGeometryLibrary from './CoplanarPolygonGeometryLibrary.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import Ellipsoid from './Ellipsoid.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryInstance from './GeometryInstance.js';
-import GeometryPipeline from './GeometryPipeline.js';
-import IndexDatatype from './IndexDatatype.js';
-import CesiumMath from './Math.js';
-import Matrix3 from './Matrix3.js';
-import PolygonGeometryLibrary from './PolygonGeometryLibrary.js';
-import PolygonPipeline from './PolygonPipeline.js';
-import PrimitiveType from './PrimitiveType.js';
-import Quaternion from './Quaternion.js';
-import VertexFormat from './VertexFormat.js';
-
-    var scratchPosition = new Cartesian3();
-    var scratchBR = new BoundingRectangle();
-    var stScratch = new Cartesian2();
-    var textureCoordinatesOrigin = new Cartesian2();
-    var scratchNormal = new Cartesian3();
-    var scratchTangent = new Cartesian3();
-    var scratchBitangent = new Cartesian3();
-    var centerScratch = new Cartesian3();
-    var axis1Scratch = new Cartesian3();
-    var axis2Scratch = new Cartesian3();
-    var quaternionScratch = new Quaternion();
-    var textureMatrixScratch = new Matrix3();
-    var tangentRotationScratch = new Matrix3();
-    var surfaceNormalScratch = new Cartesian3();
-
-    function createGeometryFromPolygon(polygon, vertexFormat, boundingRectangle, stRotation, projectPointTo2D, normal, tangent, bitangent) {
-        var positions = polygon.positions;
-        var indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);
-
-        /* If polygon is completely unrenderable, just use the first three vertices */
-        if (indices.length < 3) {
-            indices = [0, 1, 2];
-        }
-
-        var newIndices = IndexDatatype.createTypedArray(positions.length, indices.length);
-        newIndices.set(indices);
-
-        var textureMatrix = textureMatrixScratch;
-        if (stRotation !== 0.0) {
-            var rotation = Quaternion.fromAxisAngle(normal, stRotation, quaternionScratch);
-            textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);
-
-            if (vertexFormat.tangent || vertexFormat.bitangent) {
-                rotation = Quaternion.fromAxisAngle(normal, -stRotation, quaternionScratch);
-                var tangentRotation = Matrix3.fromQuaternion(rotation, tangentRotationScratch);
-
-                tangent = Cartesian3.normalize(Matrix3.multiplyByVector(tangentRotation, tangent, tangent), tangent);
-                if (vertexFormat.bitangent) {
-                    bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent);
-                }
-            }
-        } else {
-            textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);
-        }
-
-        var stOrigin = textureCoordinatesOrigin;
-        if (vertexFormat.st) {
-            stOrigin.x = boundingRectangle.x;
-            stOrigin.y = boundingRectangle.y;
-        }
-
-        var length = positions.length;
-        var size = length * 3;
-        var flatPositions = new Float64Array(size);
-        var normals = vertexFormat.normal ? new Float32Array(size) : undefined;
-        var tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;
-        var bitangents = vertexFormat.bitangent ? new Float32Array(size) : undefined;
-        var textureCoordinates = vertexFormat.st ? new Float32Array(length * 2) : undefined;
-
-        var positionIndex = 0;
-        var normalIndex = 0;
-        var bitangentIndex = 0;
-        var tangentIndex = 0;
-        var stIndex = 0;
-
-        for (var i = 0; i < length; i++) {
-            var position = positions[i];
-            flatPositions[positionIndex++] = position.x;
-            flatPositions[positionIndex++] = position.y;
-            flatPositions[positionIndex++] = position.z;
-
-            if (vertexFormat.st) {
-                var p = Matrix3.multiplyByVector(textureMatrix, position, scratchPosition);
-                var st = projectPointTo2D(p, stScratch);
-                Cartesian2.subtract(st, stOrigin, st);
-
-                var stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
-                var sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);
-                textureCoordinates[stIndex++] = stx;
-                textureCoordinates[stIndex++] = sty;
-            }
-
-            if (vertexFormat.normal) {
-                normals[normalIndex++] = normal.x;
-                normals[normalIndex++] = normal.y;
-                normals[normalIndex++] = normal.z;
-            }
-
-            if (vertexFormat.tangent) {
-                tangents[tangentIndex++] = tangent.x;
-                tangents[tangentIndex++] = tangent.y;
-                tangents[tangentIndex++] = tangent.z;
-            }
-
-            if (vertexFormat.bitangent) {
-                bitangents[bitangentIndex++] = bitangent.x;
-                bitangents[bitangentIndex++] = bitangent.y;
-                bitangents[bitangentIndex++] = bitangent.z;
-            }
-        }
-
-        var attributes = new GeometryAttributes();
-
-        if (vertexFormat.position) {
-            attributes.position = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : flatPositions
-            });
-        }
-
-        if (vertexFormat.normal) {
-            attributes.normal = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 3,
-                values : normals
-            });
-        }
-
-        if (vertexFormat.tangent) {
-            attributes.tangent = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 3,
-                values : tangents
-            });
-        }
-
-        if (vertexFormat.bitangent) {
-            attributes.bitangent = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 3,
-                values : bitangents
-            });
-        }
-
-        if (vertexFormat.st) {
-            attributes.st = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 2,
-                values : textureCoordinates
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : newIndices,
-            primitiveType : PrimitiveType.TRIANGLES
-        });
-    }
-
-    /**
-     * A description of a polygon composed of arbitrary coplanar positions.
-     *
-     * @alias CoplanarPolygonGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
-     * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
-     *
-     * @example
-     * var polygon = new Cesium.CoplanarPolygonGeometry({
-     *   positions : Cesium.Cartesian3.fromDegreesArrayHeights([
-     *      -90.0, 30.0, 0.0,
-     *      -90.0, 30.0, 1000.0,
-     *      -80.0, 30.0, 1000.0,
-     *      -80.0, 30.0, 0.0
-     *   ])
-     * });
-     * var geometry = Cesium.CoplanarPolygonGeometry.createGeometry(polygon);
-     *
-     * @see CoplanarPolygonGeometry.createGeometry
-     */
-    function CoplanarPolygonGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var polygonHierarchy = options.polygonHierarchy;
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('options.polygonHierarchy', polygonHierarchy);
-        //>>includeEnd('debug');
-
-        var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);
-        this._vertexFormat = VertexFormat.clone(vertexFormat);
-        this._polygonHierarchy = polygonHierarchy;
-        this._stRotation = defaultValue(options.stRotation, 0.0);
-        this._ellipsoid = Ellipsoid.clone(defaultValue(options.ellipsoid, Ellipsoid.WGS84));
-        this._workerName = 'createCoplanarPolygonGeometry';
-
-        /**
-         * The number of elements used to pack the object into an array.
-         * @type {Number}
-         */
-        this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + VertexFormat.packedLength + Ellipsoid.packedLength + 2;
-    }
-
-    /**
-     * A description of a coplanar polygon from an array of positions.
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
-     * @returns {CoplanarPolygonGeometry}
-     *
-     * @example
-     * // create a polygon from points
-     * var polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
-     *   positions : Cesium.Cartesian3.fromDegreesArray([
-     *     -72.0, 40.0,
-     *     -70.0, 35.0,
-     *     -75.0, 30.0,
-     *     -70.0, 30.0,
-     *     -68.0, 40.0
-     *   ])
-     * });
-     * var geometry = Cesium.PolygonGeometry.createGeometry(polygon);
-     *
-     * @see PolygonGeometry#createGeometry
-     */
-    CoplanarPolygonGeometry.fromPositions = function(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('options.positions', options.positions);
-        //>>includeEnd('debug');
-
-        var newOptions = {
-            polygonHierarchy : {
-                positions : options.positions
-            },
-            vertexFormat : options.vertexFormat,
-            stRotation : options.stRotation,
-            ellipsoid : options.ellipsoid
-        };
-        return new CoplanarPolygonGeometry(newOptions);
-    };
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CoplanarPolygonGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CoplanarPolygonGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(value._polygonHierarchy, array, startingIndex);
-
-        Ellipsoid.pack(value._ellipsoid, array, startingIndex);
-        startingIndex += Ellipsoid.packedLength;
-
-        VertexFormat.pack(value._vertexFormat, array, startingIndex);
-        startingIndex += VertexFormat.packedLength;
-
-        array[startingIndex++] = value._stRotation;
-        array[startingIndex] = value.packedLength;
-
-        return array;
-    };
-
-    var scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);
-    var scratchVertexFormat = new VertexFormat();
-    var scratchOptions = {
-        polygonHierarchy : {}
-    };
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CoplanarPolygonGeometry} [result] The object into which to store the result.
-     * @returns {CoplanarPolygonGeometry} The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
-     */
-    CoplanarPolygonGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(array, startingIndex);
-        startingIndex = polygonHierarchy.startingIndex;
-        delete polygonHierarchy.startingIndex;
-
-        var ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
-        startingIndex += Ellipsoid.packedLength;
-
-        var vertexFormat = VertexFormat.unpack(array, startingIndex, scratchVertexFormat);
-        startingIndex += VertexFormat.packedLength;
-
-        var stRotation = array[startingIndex++];
-        var packedLength = array[startingIndex];
-
-        if (!defined(result)) {
-            result = new CoplanarPolygonGeometry(scratchOptions);
-        }
-
-        result._polygonHierarchy = polygonHierarchy;
-        result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);
-        result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);
-        result._stRotation = stRotation;
-        result.packedLength = packedLength;
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CoplanarPolygonGeometry} polygonGeometry A description of the polygon.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CoplanarPolygonGeometry.createGeometry = function(polygonGeometry) {
-        var vertexFormat = polygonGeometry._vertexFormat;
-        var polygonHierarchy = polygonGeometry._polygonHierarchy;
-        var stRotation = polygonGeometry._stRotation;
-
-        var outerPositions = polygonHierarchy.positions;
-        outerPositions = arrayRemoveDuplicates(outerPositions, Cartesian3.equalsEpsilon, true);
-        if (outerPositions.length < 3) {
-            return;
-        }
-
-        var normal = scratchNormal;
-        var tangent = scratchTangent;
-        var bitangent = scratchBitangent;
-        var axis1 = axis1Scratch;
-        var axis2 = axis2Scratch;
-
-        var validGeometry = CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(outerPositions, centerScratch, axis1, axis2);
-        if (!validGeometry) {
-            return undefined;
-        }
-
-        normal = Cartesian3.cross(axis1, axis2, normal);
-        normal = Cartesian3.normalize(normal, normal);
-
-        if (!Cartesian3.equalsEpsilon(centerScratch, Cartesian3.ZERO, CesiumMath.EPSILON6)) {
-            var surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(centerScratch, surfaceNormalScratch);
-            if (Cartesian3.dot(normal, surfaceNormal) < 0) {
-                normal = Cartesian3.negate(normal, normal);
-                axis1 = Cartesian3.negate(axis1, axis1);
-            }
-        }
-
-        var projectPoints = CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(centerScratch, axis1, axis2);
-        var projectPoint = CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(centerScratch, axis1, axis2);
-
-        if (vertexFormat.tangent) {
-            tangent = Cartesian3.clone(axis1, tangent);
-        }
-        if (vertexFormat.bitangent) {
-            bitangent = Cartesian3.clone(axis2, bitangent);
-        }
-
-        var results = PolygonGeometryLibrary.polygonsFromHierarchy(polygonHierarchy, projectPoints, false);
-        var hierarchy = results.hierarchy;
-        var polygons = results.polygons;
-
-        if (hierarchy.length === 0) {
-            return;
-        }
-        outerPositions = hierarchy[0].outerRing;
-
-        var boundingSphere = BoundingSphere.fromPoints(outerPositions);
-        var boundingRectangle = PolygonGeometryLibrary.computeBoundingRectangle(normal, projectPoint, outerPositions, stRotation, scratchBR);
-
-        var geometries = [];
-        for (var i = 0; i < polygons.length; i++) {
-            var geometryInstance = new GeometryInstance({
-                geometry : createGeometryFromPolygon(polygons[i], vertexFormat, boundingRectangle, stRotation, projectPoint, normal, tangent, bitangent)
-            });
-
-            geometries.push(geometryInstance);
-        }
-
-        var geometry = GeometryPipeline.combineInstances(geometries)[0];
-        geometry.attributes.position.values = new Float64Array(geometry.attributes.position.values);
-        geometry.indices = IndexDatatype.createTypedArray(geometry.attributes.position.values.length / 3, geometry.indices);
-
-        var attributes = geometry.attributes;
-        if (!vertexFormat.position) {
-            delete attributes.position;
-        }
-        return new Geometry({
-            attributes : attributes,
-            indices : geometry.indices,
-            primitiveType : geometry.primitiveType,
-            boundingSphere : boundingSphere
-        });
-    };
-export default CoplanarPolygonGeometry;

+ 0 - 107
Source/Core/CoplanarPolygonGeometryLibrary.js

@@ -1,107 +0,0 @@
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import Matrix3 from './Matrix3.js';
-import OrientedBoundingBox from './OrientedBoundingBox.js';
-
-    /**
-     * @private
-     */
-    var CoplanarPolygonGeometryLibrary = {};
-
-    var scratchIntersectionPoint = new Cartesian3();
-    var scratchXAxis = new Cartesian3();
-    var scratchYAxis = new Cartesian3();
-    var scratchZAxis = new Cartesian3();
-    var obbScratch = new OrientedBoundingBox();
-
-    CoplanarPolygonGeometryLibrary.validOutline = function(positions) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('positions', positions);
-        //>>includeEnd('debug');
-
-        var orientedBoundingBox = OrientedBoundingBox.fromPoints(positions, obbScratch);
-        var halfAxes = orientedBoundingBox.halfAxes;
-        var xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);
-        var yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);
-        var zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);
-
-        var xMag = Cartesian3.magnitude(xAxis);
-        var yMag = Cartesian3.magnitude(yAxis);
-        var zMag = Cartesian3.magnitude(zAxis);
-
-        // If all the points are on a line return undefined because we can't draw a polygon
-        return !((xMag === 0 && (yMag === 0 || zMag === 0)) || (yMag === 0 && zMag === 0));
-    };
-
-    // call after removeDuplicates
-    CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function(positions, centerResult, planeAxis1Result, planeAxis2Result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('positions', positions);
-        Check.defined('centerResult', centerResult);
-        Check.defined('planeAxis1Result', planeAxis1Result);
-        Check.defined('planeAxis2Result', planeAxis2Result);
-        //>>includeEnd('debug');
-
-        var orientedBoundingBox = OrientedBoundingBox.fromPoints(positions, obbScratch);
-        var halfAxes = orientedBoundingBox.halfAxes;
-        var xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);
-        var yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);
-        var zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);
-
-        var xMag = Cartesian3.magnitude(xAxis);
-        var yMag = Cartesian3.magnitude(yAxis);
-        var zMag = Cartesian3.magnitude(zAxis);
-        var min = Math.min(xMag, yMag, zMag);
-
-        // If all the points are on a line return undefined because we can't draw a polygon
-        if ((xMag === 0 && (yMag === 0 || zMag === 0)) || (yMag === 0 && zMag === 0)) {
-            return false;
-        }
-
-        var planeAxis1;
-        var planeAxis2;
-
-        if (min === yMag || min === zMag) {
-            planeAxis1 = xAxis;
-        }
-        if (min === xMag) {
-            planeAxis1 = yAxis;
-        } else if (min === zMag) {
-            planeAxis2 = yAxis;
-        }
-        if (min === xMag || min === yMag) {
-            planeAxis2 = zAxis;
-        }
-
-        Cartesian3.normalize(planeAxis1, planeAxis1Result);
-        Cartesian3.normalize(planeAxis2, planeAxis2Result);
-        Cartesian3.clone(orientedBoundingBox.center, centerResult);
-        return true;
-    };
-
-    function projectTo2D(position, center, axis1, axis2, result) {
-        var v = Cartesian3.subtract(position, center, scratchIntersectionPoint);
-        var x = Cartesian3.dot(axis1, v);
-        var y = Cartesian3.dot(axis2, v);
-
-        return Cartesian2.fromElements(x, y, result);
-    }
-
-    CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function(center, axis1, axis2) {
-        return function(positions) {
-            var positionResults = new Array(positions.length);
-            for (var i = 0; i < positions.length; i++) {
-                positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);
-            }
-
-            return positionResults;
-        };
-    };
-
-    CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function(center, axis1, axis2) {
-        return function(position, result) {
-            return projectTo2D(position, center, axis1, axis2, result);
-        };
-    };
-export default CoplanarPolygonGeometryLibrary;

+ 0 - 213
Source/Core/CoplanarPolygonOutlineGeometry.js

@@ -1,213 +0,0 @@
-import arrayRemoveDuplicates from './arrayRemoveDuplicates.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import CoplanarPolygonGeometryLibrary from './CoplanarPolygonGeometryLibrary.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryInstance from './GeometryInstance.js';
-import GeometryPipeline from './GeometryPipeline.js';
-import IndexDatatype from './IndexDatatype.js';
-import PolygonGeometryLibrary from './PolygonGeometryLibrary.js';
-import PrimitiveType from './PrimitiveType.js';
-
-    function createGeometryFromPositions(positions){
-        var length = positions.length;
-        var flatPositions = new Float64Array(length * 3);
-        var indices = IndexDatatype.createTypedArray(length, length * 2);
-
-        var positionIndex = 0;
-        var index = 0;
-
-        for (var i = 0; i < length; i++) {
-            var position = positions[i];
-            flatPositions[positionIndex++] = position.x;
-            flatPositions[positionIndex++] = position.y;
-            flatPositions[positionIndex++] = position.z;
-
-            indices[index++] = i;
-            indices[index++] = (i + 1) % length;
-        }
-
-        var attributes = new GeometryAttributes({
-            position: new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : flatPositions
-            })
-        });
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.LINES
-        });
-    }
-
-    /**
-     * A description of the outline of a polygon composed of arbitrary coplanar positions.
-     *
-     * @alias CoplanarPolygonOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
-     *
-     * @see CoplanarPolygonOutlineGeometry.createGeometry
-     *
-     * @example
-     * var polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
-     *   positions : Cesium.Cartesian3.fromDegreesArrayHeights([
-     *      -90.0, 30.0, 0.0,
-     *      -90.0, 30.0, 1000.0,
-     *      -80.0, 30.0, 1000.0,
-     *      -80.0, 30.0, 0.0
-     *   ])
-     * });
-     * var geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
-     */
-    function CoplanarPolygonOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var polygonHierarchy = options.polygonHierarchy;
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('options.polygonHierarchy', polygonHierarchy);
-        //>>includeEnd('debug');
-
-        this._polygonHierarchy = polygonHierarchy;
-        this._workerName = 'createCoplanarPolygonOutlineGeometry';
-
-        /**
-         * The number of elements used to pack the object into an array.
-         * @type {Number}
-         */
-        this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + 1;
-    }
-
-    /**
-     * A description of a coplanar polygon outline from an array of positions.
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
-     * @returns {CoplanarPolygonOutlineGeometry}
-     */
-    CoplanarPolygonOutlineGeometry.fromPositions = function(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('options.positions', options.positions);
-        //>>includeEnd('debug');
-
-        var newOptions = {
-            polygonHierarchy : {
-                positions : options.positions
-            }
-        };
-        return new CoplanarPolygonOutlineGeometry(newOptions);
-    };
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CoplanarPolygonOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CoplanarPolygonOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(value._polygonHierarchy, array, startingIndex);
-
-        array[startingIndex] = value.packedLength;
-
-        return array;
-    };
-
-    var scratchOptions = {
-        polygonHierarchy : {}
-    };
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CoplanarPolygonOutlineGeometry} [result] The object into which to store the result.
-     * @returns {CoplanarPolygonOutlineGeometry} The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
-     */
-    CoplanarPolygonOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(array, startingIndex);
-        startingIndex = polygonHierarchy.startingIndex;
-        delete polygonHierarchy.startingIndex;
-        var packedLength = array[startingIndex];
-
-        if (!defined(result)) {
-            result = new CoplanarPolygonOutlineGeometry(scratchOptions);
-        }
-
-        result._polygonHierarchy = polygonHierarchy;
-        result.packedLength = packedLength;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CoplanarPolygonOutlineGeometry} polygonGeometry A description of the polygon.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CoplanarPolygonOutlineGeometry.createGeometry = function(polygonGeometry) {
-        var polygonHierarchy = polygonGeometry._polygonHierarchy;
-
-        var outerPositions = polygonHierarchy.positions;
-        outerPositions = arrayRemoveDuplicates(outerPositions, Cartesian3.equalsEpsilon, true);
-        if (outerPositions.length < 3) {
-            return;
-        }
-        var isValid = CoplanarPolygonGeometryLibrary.validOutline(outerPositions);
-        if (!isValid) {
-            return undefined;
-        }
-
-        var polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(polygonHierarchy, false);
-
-        if (polygons.length === 0) {
-            return undefined;
-        }
-
-        var geometries = [];
-
-        for (var i = 0; i < polygons.length; i++) {
-            var geometryInstance = new GeometryInstance({
-                geometry : createGeometryFromPositions(polygons[i])
-            });
-            geometries.push(geometryInstance);
-        }
-
-        var geometry = GeometryPipeline.combineInstances(geometries)[0];
-        var boundingSphere = BoundingSphere.fromPoints(polygonHierarchy.positions);
-
-        return new Geometry({
-            attributes : geometry.attributes,
-            indices : geometry.indices,
-            primitiveType : geometry.primitiveType,
-            boundingSphere : boundingSphere
-        });
-    };
-export default CoplanarPolygonOutlineGeometry;

+ 0 - 39
Source/Core/CornerType.js

@@ -1,39 +0,0 @@
-import freezeObject from './freezeObject.js';
-
-    /**
-     * Style options for corners.
-     *
-     * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo}
-     * demonstrates the three corner types, as used by {@link CorridorGraphics}.
-     *
-     * @exports CornerType
-     */
-    var CornerType = {
-        /**
-         * <img src="Images/CornerTypeRounded.png" style="vertical-align: middle;" width="186" height="189" />
-         *
-         * Corner has a smooth edge.
-         * @type {Number}
-         * @constant
-         */
-        ROUNDED : 0,
-
-        /**
-         * <img src="Images/CornerTypeMitered.png" style="vertical-align: middle;" width="186" height="189" />
-         *
-         * Corner point is the intersection of adjacent edges.
-         * @type {Number}
-         * @constant
-         */
-        MITERED : 1,
-
-        /**
-         * <img src="Images/CornerTypeBeveled.png" style="vertical-align: middle;" width="186" height="189" />
-         *
-         * Corner is clipped.
-         * @type {Number}
-         * @constant
-         */
-        BEVELED : 2
-    };
-export default freezeObject(CornerType);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1094
Source/Core/CorridorGeometry.js


+ 0 - 300
Source/Core/CorridorGeometryLibrary.js

@@ -1,300 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import CornerType from './CornerType.js';
-import defined from './defined.js';
-import CesiumMath from './Math.js';
-import Matrix3 from './Matrix3.js';
-import PolylinePipeline from './PolylinePipeline.js';
-import PolylineVolumeGeometryLibrary from './PolylineVolumeGeometryLibrary.js';
-import Quaternion from './Quaternion.js';
-
-    /**
-     * @private
-     */
-    var CorridorGeometryLibrary = {};
-
-    var scratch1 = new Cartesian3();
-    var scratch2 = new Cartesian3();
-    var scratch3 = new Cartesian3();
-    var scratch4 = new Cartesian3();
-
-    var scaleArray2 = [new Cartesian3(), new Cartesian3()];
-
-    var cartesian1 = new Cartesian3();
-    var cartesian2 = new Cartesian3();
-    var cartesian3 = new Cartesian3();
-    var cartesian4 = new Cartesian3();
-    var cartesian5 = new Cartesian3();
-    var cartesian6 = new Cartesian3();
-    var cartesian7 = new Cartesian3();
-    var cartesian8 = new Cartesian3();
-    var cartesian9 = new Cartesian3();
-    var cartesian10 = new Cartesian3();
-
-    var quaterion = new Quaternion();
-    var rotMatrix = new Matrix3();
-    function computeRoundCorner(cornerPoint, startPoint, endPoint, cornerType, leftIsOutside) {
-        var angle = Cartesian3.angleBetween(Cartesian3.subtract(startPoint, cornerPoint, scratch1), Cartesian3.subtract(endPoint, cornerPoint, scratch2));
-        var granularity = (cornerType === CornerType.BEVELED) ? 1 : Math.ceil(angle / CesiumMath.toRadians(5)) + 1;
-
-        var size = granularity * 3;
-        var array = new Array(size);
-
-        array[size - 3] = endPoint.x;
-        array[size - 2] = endPoint.y;
-        array[size - 1] = endPoint.z;
-
-        var m;
-        if (leftIsOutside) {
-            m = Matrix3.fromQuaternion(Quaternion.fromAxisAngle(Cartesian3.negate(cornerPoint, scratch1), angle / granularity, quaterion), rotMatrix);
-        } else {
-            m = Matrix3.fromQuaternion(Quaternion.fromAxisAngle(cornerPoint, angle / granularity, quaterion), rotMatrix);
-        }
-
-        var index = 0;
-        startPoint = Cartesian3.clone(startPoint, scratch1);
-        for (var i = 0; i < granularity; i++) {
-            startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);
-            array[index++] = startPoint.x;
-            array[index++] = startPoint.y;
-            array[index++] = startPoint.z;
-        }
-
-        return array;
-    }
-
-    function addEndCaps(calculatedPositions) {
-        var cornerPoint = cartesian1;
-        var startPoint = cartesian2;
-        var endPoint = cartesian3;
-
-        var leftEdge = calculatedPositions[1];
-        startPoint = Cartesian3.fromArray(calculatedPositions[1], leftEdge.length - 3, startPoint);
-        endPoint = Cartesian3.fromArray(calculatedPositions[0], 0, endPoint);
-        cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);
-        var firstEndCap = computeRoundCorner(cornerPoint, startPoint, endPoint, CornerType.ROUNDED, false);
-
-        var length = calculatedPositions.length - 1;
-        var rightEdge = calculatedPositions[length - 1];
-        leftEdge = calculatedPositions[length];
-        startPoint = Cartesian3.fromArray(rightEdge, rightEdge.length - 3, startPoint);
-        endPoint = Cartesian3.fromArray(leftEdge, 0, endPoint);
-        cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);
-        var lastEndCap = computeRoundCorner(cornerPoint, startPoint, endPoint, CornerType.ROUNDED, false);
-
-        return [firstEndCap, lastEndCap];
-    }
-
-    function computeMiteredCorner(position, leftCornerDirection, lastPoint, leftIsOutside) {
-        var cornerPoint = scratch1;
-        if (leftIsOutside) {
-            cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);
-        } else {
-            leftCornerDirection = Cartesian3.negate(leftCornerDirection, leftCornerDirection);
-            cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);
-        }
-        return [cornerPoint.x, cornerPoint.y, cornerPoint.z, lastPoint.x, lastPoint.y, lastPoint.z];
-    }
-
-    function addShiftedPositions(positions, left, scalar, calculatedPositions) {
-        var rightPositions = new Array(positions.length);
-        var leftPositions = new Array(positions.length);
-        var scaledLeft = Cartesian3.multiplyByScalar(left, scalar, scratch1);
-        var scaledRight = Cartesian3.negate(scaledLeft, scratch2);
-        var rightIndex = 0;
-        var leftIndex = positions.length - 1;
-
-        for (var i = 0; i < positions.length; i += 3) {
-            var pos = Cartesian3.fromArray(positions, i, scratch3);
-            var rightPos = Cartesian3.add(pos, scaledRight, scratch4);
-            rightPositions[rightIndex++] = rightPos.x;
-            rightPositions[rightIndex++] = rightPos.y;
-            rightPositions[rightIndex++] = rightPos.z;
-
-            var leftPos = Cartesian3.add(pos, scaledLeft, scratch4);
-            leftPositions[leftIndex--] = leftPos.z;
-            leftPositions[leftIndex--] = leftPos.y;
-            leftPositions[leftIndex--] = leftPos.x;
-        }
-        calculatedPositions.push(rightPositions, leftPositions);
-
-        return calculatedPositions;
-    }
-
-    /**
-     * @private
-     */
-    CorridorGeometryLibrary.addAttribute = function(attribute, value, front, back) {
-        var x = value.x;
-        var y = value.y;
-        var z = value.z;
-        if (defined(front)) {
-            attribute[front] = x;
-            attribute[front + 1] = y;
-            attribute[front + 2] = z;
-        }
-        if (defined(back)) {
-            attribute[back] = z;
-            attribute[back - 1] = y;
-            attribute[back - 2] = x;
-        }
-    };
-
-    var scratchForwardProjection = new Cartesian3();
-    var scratchBackwardProjection = new Cartesian3();
-
-    /**
-     * @private
-     */
-    CorridorGeometryLibrary.computePositions = function(params) {
-        var granularity = params.granularity;
-        var positions = params.positions;
-        var ellipsoid = params.ellipsoid;
-        var width = params.width / 2;
-        var cornerType = params.cornerType;
-        var saveAttributes = params.saveAttributes;
-        var normal = cartesian1;
-        var forward = cartesian2;
-        var backward = cartesian3;
-        var left = cartesian4;
-        var cornerDirection = cartesian5;
-        var startPoint = cartesian6;
-        var previousPos = cartesian7;
-        var rightPos = cartesian8;
-        var leftPos = cartesian9;
-        var center = cartesian10;
-        var calculatedPositions = [];
-        var calculatedLefts = (saveAttributes) ? [] : undefined;
-        var calculatedNormals = (saveAttributes) ? [] : undefined;
-        var position = positions[0]; //add first point
-        var nextPosition = positions[1];
-
-        forward = Cartesian3.normalize(Cartesian3.subtract(nextPosition, position, forward), forward);
-        normal = ellipsoid.geodeticSurfaceNormal(position, normal);
-        left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left);
-        if (saveAttributes) {
-            calculatedLefts.push(left.x, left.y, left.z);
-            calculatedNormals.push(normal.x, normal.y, normal.z);
-        }
-        previousPos = Cartesian3.clone(position, previousPos);
-        position = nextPosition;
-        backward = Cartesian3.negate(forward, backward);
-
-        var subdividedPositions;
-        var corners = [];
-        var i;
-        var length = positions.length;
-        for (i = 1; i < length - 1; i++) { // add middle points and corners
-            normal = ellipsoid.geodeticSurfaceNormal(position, normal);
-            nextPosition = positions[i + 1];
-            forward = Cartesian3.normalize(Cartesian3.subtract(nextPosition, position, forward), forward);
-            cornerDirection = Cartesian3.normalize(Cartesian3.add(forward, backward, cornerDirection), cornerDirection);
-
-            var forwardProjection = Cartesian3.multiplyByScalar(normal, Cartesian3.dot(forward, normal), scratchForwardProjection);
-            Cartesian3.subtract(forward, forwardProjection, forwardProjection);
-            Cartesian3.normalize(forwardProjection, forwardProjection);
-
-            var backwardProjection = Cartesian3.multiplyByScalar(normal, Cartesian3.dot(backward, normal), scratchBackwardProjection);
-            Cartesian3.subtract(backward, backwardProjection, backwardProjection);
-            Cartesian3.normalize(backwardProjection, backwardProjection);
-
-            var doCorner = !CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, CesiumMath.EPSILON7);
-
-            if (doCorner) {
-                cornerDirection = Cartesian3.cross(cornerDirection, normal, cornerDirection);
-                cornerDirection = Cartesian3.cross(normal, cornerDirection, cornerDirection);
-                cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);
-                var scalar = width / Math.max(0.25, Cartesian3.magnitude(Cartesian3.cross(cornerDirection, backward, scratch1)));
-                var leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(forward, backward, position, ellipsoid);
-                cornerDirection = Cartesian3.multiplyByScalar(cornerDirection, scalar, cornerDirection);
-                if (leftIsOutside) {
-                    rightPos = Cartesian3.add(position, cornerDirection, rightPos);
-                    center = Cartesian3.add(rightPos, Cartesian3.multiplyByScalar(left, width, center), center);
-                    leftPos = Cartesian3.add(rightPos, Cartesian3.multiplyByScalar(left, width * 2, leftPos), leftPos);
-                    scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);
-                    scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);
-                    subdividedPositions = PolylinePipeline.generateArc({
-                        positions: scaleArray2,
-                        granularity: granularity,
-                        ellipsoid: ellipsoid
-                    });
-                    calculatedPositions = addShiftedPositions(subdividedPositions, left, width, calculatedPositions);
-                    if (saveAttributes) {
-                        calculatedLefts.push(left.x, left.y, left.z);
-                        calculatedNormals.push(normal.x, normal.y, normal.z);
-                    }
-                    startPoint = Cartesian3.clone(leftPos, startPoint);
-                    left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left);
-                    leftPos = Cartesian3.add(rightPos, Cartesian3.multiplyByScalar(left, width * 2, leftPos), leftPos);
-                    previousPos = Cartesian3.add(rightPos, Cartesian3.multiplyByScalar(left, width, previousPos), previousPos);
-                    if (cornerType === CornerType.ROUNDED || cornerType === CornerType.BEVELED) {
-                        corners.push({
-                            leftPositions : computeRoundCorner(rightPos, startPoint, leftPos, cornerType, leftIsOutside)
-                        });
-                    } else {
-                        corners.push({
-                            leftPositions : computeMiteredCorner(position, Cartesian3.negate(cornerDirection, cornerDirection), leftPos, leftIsOutside)
-                        });
-                    }
-                } else {
-                    leftPos = Cartesian3.add(position, cornerDirection, leftPos);
-                    center = Cartesian3.add(leftPos, Cartesian3.negate(Cartesian3.multiplyByScalar(left, width, center), center), center);
-                    rightPos = Cartesian3.add(leftPos, Cartesian3.negate(Cartesian3.multiplyByScalar(left, width * 2, rightPos), rightPos), rightPos);
-                    scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);
-                    scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);
-                    subdividedPositions = PolylinePipeline.generateArc({
-                        positions: scaleArray2,
-                        granularity: granularity,
-                        ellipsoid: ellipsoid
-                    });
-                    calculatedPositions = addShiftedPositions(subdividedPositions, left, width, calculatedPositions);
-                    if (saveAttributes) {
-                        calculatedLefts.push(left.x, left.y, left.z);
-                        calculatedNormals.push(normal.x, normal.y, normal.z);
-                    }
-                    startPoint = Cartesian3.clone(rightPos, startPoint);
-                    left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left);
-                    rightPos = Cartesian3.add(leftPos, Cartesian3.negate(Cartesian3.multiplyByScalar(left, width * 2, rightPos), rightPos), rightPos);
-                    previousPos = Cartesian3.add(leftPos, Cartesian3.negate(Cartesian3.multiplyByScalar(left, width, previousPos), previousPos), previousPos);
-                    if (cornerType === CornerType.ROUNDED || cornerType === CornerType.BEVELED) {
-                        corners.push({
-                            rightPositions : computeRoundCorner(leftPos, startPoint, rightPos, cornerType, leftIsOutside)
-                        });
-                    } else {
-                        corners.push({
-                            rightPositions : computeMiteredCorner(position, cornerDirection, rightPos, leftIsOutside)
-                        });
-                    }
-                }
-                backward = Cartesian3.negate(forward, backward);
-            }
-            position = nextPosition;
-        }
-
-        normal = ellipsoid.geodeticSurfaceNormal(position, normal);
-        scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);
-        scaleArray2[1] = Cartesian3.clone(position, scaleArray2[1]);
-        subdividedPositions = PolylinePipeline.generateArc({
-            positions: scaleArray2,
-            granularity: granularity,
-            ellipsoid: ellipsoid
-        });
-        calculatedPositions = addShiftedPositions(subdividedPositions, left, width, calculatedPositions);
-        if (saveAttributes) {
-            calculatedLefts.push(left.x, left.y, left.z);
-            calculatedNormals.push(normal.x, normal.y, normal.z);
-        }
-
-        var endPositions;
-        if (cornerType === CornerType.ROUNDED) {
-            endPositions = addEndCaps(calculatedPositions);
-        }
-
-        return {
-            positions : calculatedPositions,
-            corners : corners,
-            lefts : calculatedLefts,
-            normals : calculatedNormals,
-            endPositions : endPositions
-        };
-    };
-export default CorridorGeometryLibrary;

+ 0 - 531
Source/Core/CorridorOutlineGeometry.js

@@ -1,531 +0,0 @@
-import arrayFill from './arrayFill.js';
-import arrayRemoveDuplicates from './arrayRemoveDuplicates.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import CornerType from './CornerType.js';
-import CorridorGeometryLibrary from './CorridorGeometryLibrary.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import Ellipsoid from './Ellipsoid.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import IndexDatatype from './IndexDatatype.js';
-import CesiumMath from './Math.js';
-import PolygonPipeline from './PolygonPipeline.js';
-import PrimitiveType from './PrimitiveType.js';
-
-    var cartesian1 = new Cartesian3();
-    var cartesian2 = new Cartesian3();
-    var cartesian3 = new Cartesian3();
-
-    function scaleToSurface(positions, ellipsoid) {
-        for (var i = 0; i < positions.length; i++) {
-            positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
-        }
-        return positions;
-    }
-
-    function combine(computedPositions, cornerType) {
-        var wallIndices = [];
-        var positions = computedPositions.positions;
-        var corners = computedPositions.corners;
-        var endPositions = computedPositions.endPositions;
-        var attributes = new GeometryAttributes();
-        var corner;
-        var leftCount = 0;
-        var rightCount = 0;
-        var i;
-        var indicesLength = 0;
-        var length;
-        for (i = 0; i < positions.length; i += 2) {
-            length = positions[i].length - 3;
-            leftCount += length; //subtracting 3 to account for duplicate points at corners
-            indicesLength += length / 3 * 4;
-            rightCount += positions[i + 1].length - 3;
-        }
-        leftCount += 3; //add back count for end positions
-        rightCount += 3;
-        for (i = 0; i < corners.length; i++) {
-            corner = corners[i];
-            var leftSide = corners[i].leftPositions;
-            if (defined(leftSide)) {
-                length = leftSide.length;
-                leftCount += length;
-                indicesLength += length / 3 * 2;
-            } else {
-                length = corners[i].rightPositions.length;
-                rightCount += length;
-                indicesLength += length / 3 * 2;
-            }
-        }
-
-        var addEndPositions = defined(endPositions);
-        var endPositionLength;
-        if (addEndPositions) {
-            endPositionLength = endPositions[0].length - 3;
-            leftCount += endPositionLength;
-            rightCount += endPositionLength;
-            endPositionLength /= 3;
-            indicesLength += endPositionLength * 4;
-        }
-        var size = leftCount + rightCount;
-        var finalPositions = new Float64Array(size);
-        var front = 0;
-        var back = size - 1;
-        var UL, LL, UR, LR;
-        var rightPos, leftPos;
-        var halfLength = endPositionLength / 2;
-
-        var indices = IndexDatatype.createTypedArray(size / 3, indicesLength + 4);
-        var index = 0;
-
-        indices[index++] = front / 3;
-        indices[index++] = (back - 2) / 3;
-        if (addEndPositions) { // add rounded end
-            wallIndices.push(front / 3);
-            leftPos = cartesian1;
-            rightPos = cartesian2;
-            var firstEndPositions = endPositions[0];
-            for (i = 0; i < halfLength; i++) {
-                leftPos = Cartesian3.fromArray(firstEndPositions, (halfLength - 1 - i) * 3, leftPos);
-                rightPos = Cartesian3.fromArray(firstEndPositions, (halfLength + i) * 3, rightPos);
-                CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
-                CorridorGeometryLibrary.addAttribute(finalPositions, leftPos, undefined, back);
-
-                LL = front / 3;
-                LR = LL + 1;
-                UL = (back - 2) / 3;
-                UR = UL - 1;
-                indices[index++] = UL;
-                indices[index++] = UR;
-                indices[index++] = LL;
-                indices[index++] = LR;
-
-                front += 3;
-                back -= 3;
-            }
-        }
-
-        var posIndex = 0;
-        var rightEdge = positions[posIndex++]; //add first two edges
-        var leftEdge = positions[posIndex++];
-        finalPositions.set(rightEdge, front);
-        finalPositions.set(leftEdge, back - leftEdge.length + 1);
-
-        length = leftEdge.length - 3;
-        wallIndices.push(front / 3, (back - 2) / 3);
-        for (i = 0; i < length; i += 3) {
-            LL = front / 3;
-            LR = LL + 1;
-            UL = (back - 2) / 3;
-            UR = UL - 1;
-            indices[index++] = UL;
-            indices[index++] = UR;
-            indices[index++] = LL;
-            indices[index++] = LR;
-
-            front += 3;
-            back -= 3;
-        }
-
-        for (i = 0; i < corners.length; i++) {
-            var j;
-            corner = corners[i];
-            var l = corner.leftPositions;
-            var r = corner.rightPositions;
-            var start;
-            var outsidePoint = cartesian3;
-            if (defined(l)) {
-                back -= 3;
-                start = UR;
-                wallIndices.push(LR);
-                for (j = 0; j < l.length / 3; j++) {
-                    outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);
-                    indices[index++] = start - j - 1;
-                    indices[index++] = start - j;
-                    CorridorGeometryLibrary.addAttribute(finalPositions, outsidePoint, undefined, back);
-                    back -= 3;
-                }
-                wallIndices.push(start - Math.floor(l.length / 6));
-                if (cornerType === CornerType.BEVELED) {
-                    wallIndices.push((back - 2) / 3 + 1);
-                }
-                front += 3;
-            } else {
-                front += 3;
-                start = LR;
-                wallIndices.push(UR);
-                for (j = 0; j < r.length / 3; j++) {
-                    outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);
-                    indices[index++] = start + j;
-                    indices[index++] = start + j + 1;
-                    CorridorGeometryLibrary.addAttribute(finalPositions, outsidePoint, front);
-                    front += 3;
-                }
-                wallIndices.push(start + Math.floor(r.length / 6));
-                if (cornerType === CornerType.BEVELED) {
-                    wallIndices.push(front / 3 - 1);
-                }
-                back -= 3;
-            }
-            rightEdge = positions[posIndex++];
-            leftEdge = positions[posIndex++];
-            rightEdge.splice(0, 3); //remove duplicate points added by corner
-            leftEdge.splice(leftEdge.length - 3, 3);
-            finalPositions.set(rightEdge, front);
-            finalPositions.set(leftEdge, back - leftEdge.length + 1);
-            length = leftEdge.length - 3;
-
-            for (j = 0; j < leftEdge.length; j += 3) {
-                LR = front / 3;
-                LL = LR - 1;
-                UR = (back - 2) / 3;
-                UL = UR + 1;
-                indices[index++] = UL;
-                indices[index++] = UR;
-                indices[index++] = LL;
-                indices[index++] = LR;
-                front += 3;
-                back -= 3;
-            }
-            front -= 3;
-            back += 3;
-            wallIndices.push(front / 3, (back - 2) / 3);
-        }
-
-        if (addEndPositions) { // add rounded end
-            front += 3;
-            back -= 3;
-            leftPos = cartesian1;
-            rightPos = cartesian2;
-            var lastEndPositions = endPositions[1];
-            for (i = 0; i < halfLength; i++) {
-                leftPos = Cartesian3.fromArray(lastEndPositions, (endPositionLength - i - 1) * 3, leftPos);
-                rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
-                CorridorGeometryLibrary.addAttribute(finalPositions, leftPos, undefined, back);
-                CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
-
-                LR = front / 3;
-                LL = LR - 1;
-                UR = (back - 2) / 3;
-                UL = UR + 1;
-                indices[index++] = UL;
-                indices[index++] = UR;
-                indices[index++] = LL;
-                indices[index++] = LR;
-
-                front += 3;
-                back -= 3;
-            }
-
-            wallIndices.push(front / 3);
-        } else {
-            wallIndices.push(front / 3, (back - 2) / 3);
-        }
-        indices[index++] = front / 3;
-        indices[index++] = (back - 2) / 3;
-
-        attributes.position = new GeometryAttribute({
-            componentDatatype : ComponentDatatype.DOUBLE,
-            componentsPerAttribute : 3,
-            values : finalPositions
-        });
-
-        return {
-            attributes : attributes,
-            indices : indices,
-            wallIndices : wallIndices
-        };
-    }
-
-    function computePositionsExtruded(params) {
-        var ellipsoid = params.ellipsoid;
-        var computedPositions = CorridorGeometryLibrary.computePositions(params);
-        var attr = combine(computedPositions, params.cornerType);
-        var wallIndices = attr.wallIndices;
-        var height = params.height;
-        var extrudedHeight = params.extrudedHeight;
-        var attributes = attr.attributes;
-        var indices = attr.indices;
-        var positions = attributes.position.values;
-        var length = positions.length;
-        var extrudedPositions = new Float64Array(length);
-        extrudedPositions.set(positions);
-        var newPositions = new Float64Array(length * 2);
-
-        positions = PolygonPipeline.scaleToGeodeticHeight(positions, height, ellipsoid);
-        extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(extrudedPositions, extrudedHeight, ellipsoid);
-        newPositions.set(positions);
-        newPositions.set(extrudedPositions, length);
-        attributes.position.values = newPositions;
-
-        length /= 3;
-        if (defined(params.offsetAttribute)) {
-            var applyOffset = new Uint8Array(length * 2);
-            if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {
-                applyOffset = arrayFill(applyOffset, 1, 0, length);
-            } else {
-                var applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-                applyOffset = arrayFill(applyOffset, applyOffsetValue);
-            }
-
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values: applyOffset
-            });
-        }
-
-        var i;
-        var iLength = indices.length;
-        var newIndices = IndexDatatype.createTypedArray(newPositions.length / 3, (iLength + wallIndices.length) * 2);
-        newIndices.set(indices);
-        var index = iLength;
-        for (i = 0; i < iLength; i += 2) { // bottom indices
-            var v0 = indices[i];
-            var v1 = indices[i + 1];
-            newIndices[index++] = v0 + length;
-            newIndices[index++] = v1 + length;
-        }
-
-        var UL, LL;
-        for (i = 0; i < wallIndices.length; i++) { //wall indices
-            UL = wallIndices[i];
-            LL = UL + length;
-            newIndices[index++] = UL;
-            newIndices[index++] = LL;
-        }
-
-        return {
-            attributes : attributes,
-            indices : newIndices
-        };
-    }
-
-    /**
-     * A description of a corridor outline.
-     *
-     * @alias CorridorOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.
-     * @param {Number} options.width The distance between the edges of the corridor outline.
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
-     * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
-     * @param {Number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.
-     * @param {Number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.
-     * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
-     *
-     * @see CorridorOutlineGeometry.createGeometry
-     *
-     * @example
-     * var corridor = new Cesium.CorridorOutlineGeometry({
-     *   positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
-     *   width : 100000
-     * });
-     */
-    function CorridorOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        var positions = options.positions;
-        var width = options.width;
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('options.positions', positions);
-        Check.typeOf.number('options.width', width);
-        //>>includeEnd('debug');
-
-        var height = defaultValue(options.height, 0.0);
-        var extrudedHeight = defaultValue(options.extrudedHeight, height);
-
-        this._positions = positions;
-        this._ellipsoid = Ellipsoid.clone(defaultValue(options.ellipsoid, Ellipsoid.WGS84));
-        this._width = width;
-        this._height = Math.max(height, extrudedHeight);
-        this._extrudedHeight = Math.min(height, extrudedHeight);
-        this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);
-        this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE);
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createCorridorOutlineGeometry';
-
-        /**
-         * The number of elements used to pack the object into an array.
-         * @type {Number}
-         */
-        this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + 6;
-    }
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CorridorOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.typeOf.object('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var positions = value._positions;
-        var length = positions.length;
-        array[startingIndex++] = length;
-
-        for (var i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {
-            Cartesian3.pack(positions[i], array, startingIndex);
-        }
-
-        Ellipsoid.pack(value._ellipsoid, array, startingIndex);
-        startingIndex += Ellipsoid.packedLength;
-
-        array[startingIndex++] = value._width;
-        array[startingIndex++] = value._height;
-        array[startingIndex++] = value._extrudedHeight;
-        array[startingIndex++] = value._cornerType;
-        array[startingIndex++] = value._granularity;
-        array[startingIndex] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);
-    var scratchOptions = {
-        positions : undefined,
-        ellipsoid : scratchEllipsoid,
-        width : undefined,
-        height : undefined,
-        extrudedHeight : undefined,
-        cornerType : undefined,
-        granularity : undefined,
-        offsetAttribute: undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CorridorOutlineGeometry} [result] The object into which to store the result.
-     * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
-     */
-    CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var length = array[startingIndex++];
-        var positions = new Array(length);
-
-        for (var i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {
-            positions[i] = Cartesian3.unpack(array, startingIndex);
-        }
-
-        var ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
-        startingIndex += Ellipsoid.packedLength;
-
-        var width = array[startingIndex++];
-        var height = array[startingIndex++];
-        var extrudedHeight = array[startingIndex++];
-        var cornerType = array[startingIndex++];
-        var granularity = array[startingIndex++];
-        var offsetAttribute = array[startingIndex];
-
-        if (!defined(result)) {
-            scratchOptions.positions = positions;
-            scratchOptions.width = width;
-            scratchOptions.height = height;
-            scratchOptions.extrudedHeight = extrudedHeight;
-            scratchOptions.cornerType = cornerType;
-            scratchOptions.granularity = granularity;
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new CorridorOutlineGeometry(scratchOptions);
-        }
-
-        result._positions = positions;
-        result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);
-        result._width = width;
-        result._height = height;
-        result._extrudedHeight = extrudedHeight;
-        result._cornerType = cornerType;
-        result._granularity = granularity;
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
-        var positions = corridorOutlineGeometry._positions;
-        var width = corridorOutlineGeometry._width;
-        var ellipsoid = corridorOutlineGeometry._ellipsoid;
-
-        positions = scaleToSurface(positions, ellipsoid);
-        var cleanPositions = arrayRemoveDuplicates(positions, Cartesian3.equalsEpsilon);
-
-        if ((cleanPositions.length < 2) || (width <= 0)) {
-            return;
-        }
-
-        var height = corridorOutlineGeometry._height;
-        var extrudedHeight = corridorOutlineGeometry._extrudedHeight;
-        var extrude = !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);
-
-        var params = {
-            ellipsoid : ellipsoid,
-            positions : cleanPositions,
-            width : width,
-            cornerType : corridorOutlineGeometry._cornerType,
-            granularity : corridorOutlineGeometry._granularity,
-            saveAttributes : false
-        };
-        var attr;
-        if (extrude) {
-            params.height = height;
-            params.extrudedHeight = extrudedHeight;
-            params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
-            attr = computePositionsExtruded(params);
-        } else {
-            var computedPositions = CorridorGeometryLibrary.computePositions(params);
-            attr = combine(computedPositions, params.cornerType);
-            attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(attr.attributes.position.values, height, ellipsoid);
-
-            if (defined(corridorOutlineGeometry._offsetAttribute)) {
-                var length = attr.attributes.position.values.length;
-                var applyOffset = new Uint8Array(length / 3);
-                var offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-                arrayFill(applyOffset, offsetValue);
-                attr.attributes.applyOffset = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                    componentsPerAttribute : 1,
-                    values: applyOffset
-                });
-            }
-        }
-        var attributes = attr.attributes;
-        var boundingSphere = BoundingSphere.fromVertices(attributes.position.values, undefined, 3);
-
-        return new Geometry({
-            attributes : attributes,
-            indices : attr.indices,
-            primitiveType : PrimitiveType.LINES,
-            boundingSphere : boundingSphere,
-            offsetAttribute : corridorOutlineGeometry._offsetAttribute
-        });
-    };
-export default CorridorOutlineGeometry;

+ 0 - 161
Source/Core/Credit.js

@@ -1,161 +0,0 @@
-import DOMPurify from '../ThirdParty/purify.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-
-    var nextCreditId = 0;
-    var creditToId = {};
-
-    /**
-     * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
-     * @param {String} html An string representing an html code snippet
-     * @param {Boolean} [showOnScreen=false] If true, the credit will be visible in the main credit container.  Otherwise, it will appear in a popover
-     *
-     * @alias Credit
-     * @constructor
-     *
-     * @exception {DeveloperError} html is required.
-     *
-     * @example
-     * //Create a credit with a tooltip, image and link
-     * var credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
-     */
-    function Credit(html, showOnScreen) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.string('html', html);
-        //>>includeEnd('debug');
-        var id;
-        var key = html;
-
-        if (defined(creditToId[key])) {
-            id = creditToId[key];
-        } else {
-            id = nextCreditId++;
-            creditToId[key] = id;
-        }
-
-        showOnScreen = defaultValue(showOnScreen, false);
-
-        // Credits are immutable so generate an id to use to optimize equal()
-        this._id = id;
-        this._html = html;
-        this._showOnScreen = showOnScreen;
-        this._element = undefined;
-    }
-
-    defineProperties(Credit.prototype, {
-        /**
-         * The credit content
-         * @memberof Credit.prototype
-         * @type {String}
-         * @readonly
-         */
-        html : {
-            get : function() {
-                return this._html;
-            }
-        },
-
-        /**
-         * @memberof Credit.prototype
-         * @type {Number}
-         * @readonly
-         *
-         * @private
-         */
-        id : {
-            get : function() {
-                return this._id;
-            }
-        },
-
-        /**
-         * Whether the credit should be displayed on screen or in a lightbox
-         * @memberof Credit.prototype
-         * @type {Boolean}
-         * @readonly
-         */
-        showOnScreen : {
-            get : function() {
-                return this._showOnScreen;
-            }
-        },
-
-        /**
-         * Gets the credit element
-         * @memberof Credit.prototype
-         * @type {HTMLElement}
-         * @readonly
-         */
-        element: {
-            get: function() {
-                if (!defined(this._element)) {
-                    var html = DOMPurify.sanitize(this._html);
-
-                    var div = document.createElement('div');
-                    div._creditId = this._id;
-                    div.style.display = 'inline';
-                    div.innerHTML = html;
-
-                    var links = div.querySelectorAll('a');
-                    for (var i = 0; i < links.length; i++) {
-                        links[i].setAttribute('target', '_blank');
-                    }
-
-                    this._element = div;
-                }
-                return this._element;
-            }
-        }
-    });
-
-    /**
-     * Returns true if the credits are equal
-     *
-     * @param {Credit} left The first credit
-     * @param {Credit} right The second credit
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    Credit.equals = function(left, right) {
-        return (left === right) ||
-               ((defined(left)) &&
-                (defined(right)) &&
-                (left._id === right._id));
-    };
-
-    /**
-     * Returns true if the credits are equal
-     *
-     * @param {Credit} credit The credit to compare to.
-     * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise.
-     */
-    Credit.prototype.equals = function(credit) {
-        return Credit.equals(this, credit);
-    };
-
-    /**
-     * @private
-     * @param attribution
-     * @return {Credit}
-     */
-    Credit.getIonCredit = function(attribution) {
-        var showOnScreen = defined(attribution.collapsible) && !attribution.collapsible;
-        var credit = new Credit(attribution.html, showOnScreen);
-
-        credit._isIon = credit.html.indexOf('ion-credit.png') !== -1;
-        return credit;
-    };
-
-    /**
-     * Duplicates a Credit instance.
-     *
-     * @param {Credit} [credit] The Credit to duplicate.
-     * @returns {Credit} A new Credit instance that is a duplicate of the one provided. (Returns undefined if the credit is undefined)
-     */
-    Credit.clone = function(credit) {
-        if (defined(credit)) {
-            return new Credit(credit.html, credit.showOnScreen);
-        }
-    };
-export default Credit;

+ 0 - 232
Source/Core/CubicRealPolynomial.js

@@ -1,232 +0,0 @@
-import DeveloperError from './DeveloperError.js';
-import QuadraticRealPolynomial from './QuadraticRealPolynomial.js';
-
-    /**
-     * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
-     *
-     * @exports CubicRealPolynomial
-     */
-    var CubicRealPolynomial = {};
-
-    /**
-     * Provides the discriminant of the cubic equation from the supplied coefficients.
-     *
-     * @param {Number} a The coefficient of the 3rd order monomial.
-     * @param {Number} b The coefficient of the 2nd order monomial.
-     * @param {Number} c The coefficient of the 1st order monomial.
-     * @param {Number} d The coefficient of the 0th order monomial.
-     * @returns {Number} The value of the discriminant.
-     */
-    CubicRealPolynomial.computeDiscriminant = function(a, b, c, d) {
-        //>>includeStart('debug', pragmas.debug);
-        if (typeof a !== 'number') {
-            throw new DeveloperError('a is a required number.');
-        }
-        if (typeof b !== 'number') {
-            throw new DeveloperError('b is a required number.');
-        }
-        if (typeof c !== 'number') {
-            throw new DeveloperError('c is a required number.');
-        }
-        if (typeof d !== 'number') {
-            throw new DeveloperError('d is a required number.');
-        }
-        //>>includeEnd('debug');
-
-        var a2 = a * a;
-        var b2 = b * b;
-        var c2 = c * c;
-        var d2 = d * d;
-
-        var discriminant = 18.0 * a * b * c * d + b2 * c2 - 27.0 * a2 * d2 - 4.0 * (a * c2 * c + b2 * b * d);
-        return discriminant;
-    };
-
-    function computeRealRoots(a, b, c, d) {
-        var A = a;
-        var B = b / 3.0;
-        var C = c / 3.0;
-        var D = d;
-
-        var AC = A * C;
-        var BD = B * D;
-        var B2 = B * B;
-        var C2 = C * C;
-        var delta1 = A * C - B2;
-        var delta2 = A * D - B * C;
-        var delta3 = B * D - C2;
-
-        var discriminant = 4.0 * delta1 * delta3 - delta2 * delta2;
-        var temp;
-        var temp1;
-
-        if (discriminant < 0.0) {
-            var ABar;
-            var CBar;
-            var DBar;
-
-            if (B2 * BD >= AC * C2) {
-                ABar = A;
-                CBar = delta1;
-                DBar = -2.0 * B * delta1 + A * delta2;
-            } else {
-                ABar = D;
-                CBar = delta3;
-                DBar = -D * delta2 + 2.0 * C * delta3;
-            }
-
-            var s = (DBar < 0.0) ? -1.0 : 1.0; // This is not Math.Sign()!
-            var temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);
-            temp1 = -DBar + temp0;
-
-            var x = temp1 / 2.0;
-            var p = x < 0.0 ? -Math.pow(-x, 1.0 / 3.0) : Math.pow(x, 1.0 / 3.0);
-            var q = (temp1 === temp0) ? -p : -CBar / p;
-
-            temp = (CBar <= 0.0) ? p + q : -DBar / (p * p + q * q + CBar);
-
-            if (B2 * BD >= AC * C2) {
-                return [(temp - B) / A];
-            }
-
-            return [-D / (temp + C)];
-        }
-
-        var CBarA = delta1;
-        var DBarA = -2.0 * B * delta1 + A * delta2;
-
-        var CBarD = delta3;
-        var DBarD = -D * delta2 + 2.0 * C * delta3;
-
-        var squareRootOfDiscriminant = Math.sqrt(discriminant);
-        var halfSquareRootOf3 = Math.sqrt(3.0) / 2.0;
-
-        var theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3.0);
-        temp = 2.0 * Math.sqrt(-CBarA);
-        var cosine = Math.cos(theta);
-        temp1 = temp * cosine;
-        var temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));
-
-        var numeratorLarge = (temp1 + temp3 > 2.0 * B) ? temp1 - B : temp3 - B;
-        var denominatorLarge = A;
-
-        var root1 = numeratorLarge / denominatorLarge;
-
-        theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3.0);
-        temp = 2.0 * Math.sqrt(-CBarD);
-        cosine = Math.cos(theta);
-        temp1 = temp * cosine;
-        temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));
-
-        var numeratorSmall = -D;
-        var denominatorSmall = (temp1 + temp3 < 2.0 * C) ? temp1 + C : temp3 + C;
-
-        var root3 = numeratorSmall / denominatorSmall;
-
-        var E = denominatorLarge * denominatorSmall;
-        var F = -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;
-        var G = numeratorLarge * numeratorSmall;
-
-        var root2 = (C * F - B * G) / (-B * F + C * E);
-
-        if (root1 <= root2) {
-            if (root1 <= root3) {
-                if (root2 <= root3) {
-                    return [root1, root2, root3];
-                }
-                return [root1, root3, root2];
-            }
-            return [root3, root1, root2];
-        }
-        if (root1 <= root3) {
-            return [root2, root1, root3];
-        }
-        if (root2 <= root3) {
-            return [root2, root3, root1];
-        }
-        return [root3, root2, root1];
-    }
-
-    /**
-     * Provides the real valued roots of the cubic polynomial with the provided coefficients.
-     *
-     * @param {Number} a The coefficient of the 3rd order monomial.
-     * @param {Number} b The coefficient of the 2nd order monomial.
-     * @param {Number} c The coefficient of the 1st order monomial.
-     * @param {Number} d The coefficient of the 0th order monomial.
-     * @returns {Number[]} The real valued roots.
-     */
-    CubicRealPolynomial.computeRealRoots = function(a, b, c, d) {
-        //>>includeStart('debug', pragmas.debug);
-        if (typeof a !== 'number') {
-            throw new DeveloperError('a is a required number.');
-        }
-        if (typeof b !== 'number') {
-            throw new DeveloperError('b is a required number.');
-        }
-        if (typeof c !== 'number') {
-            throw new DeveloperError('c is a required number.');
-        }
-        if (typeof d !== 'number') {
-            throw new DeveloperError('d is a required number.');
-        }
-        //>>includeEnd('debug');
-
-        var roots;
-        var ratio;
-        if (a === 0.0) {
-            // Quadratic function: b * x^2 + c * x + d = 0.
-            return QuadraticRealPolynomial.computeRealRoots(b, c, d);
-        } else if (b === 0.0) {
-            if (c === 0.0) {
-                if (d === 0.0) {
-                    // 3rd order monomial: a * x^3 = 0.
-                    return [0.0, 0.0, 0.0];
-                }
-
-                // a * x^3 + d = 0
-                ratio = -d / a;
-                var root = (ratio < 0.0) ? -Math.pow(-ratio, 1.0 / 3.0) : Math.pow(ratio, 1.0 / 3.0);
-                return [root, root, root];
-            } else if (d === 0.0) {
-                // x * (a * x^2 + c) = 0.
-                roots = QuadraticRealPolynomial.computeRealRoots(a, 0, c);
-
-                // Return the roots in ascending order.
-                if (roots.Length === 0) {
-                    return [0.0];
-                }
-                return [roots[0], 0.0, roots[1]];
-            }
-
-            // Deflated cubic polynomial: a * x^3 + c * x + d= 0.
-            return computeRealRoots(a, 0, c, d);
-        } else if (c === 0.0) {
-            if (d === 0.0) {
-                // x^2 * (a * x + b) = 0.
-                ratio = -b / a;
-                if (ratio < 0.0) {
-                    return [ratio, 0.0, 0.0];
-                }
-                return [0.0, 0.0, ratio];
-            }
-            // a * x^3 + b * x^2 + d = 0.
-            return computeRealRoots(a, b, 0, d);
-        } else if (d === 0.0) {
-            // x * (a * x^2 + b * x + c) = 0
-            roots = QuadraticRealPolynomial.computeRealRoots(a, b, c);
-
-            // Return the roots in ascending order.
-            if (roots.length === 0) {
-                return [0.0];
-            } else if (roots[1] <= 0.0) {
-                return [roots[0], roots[1], 0.0];
-            } else if (roots[0] >= 0.0) {
-                return [0.0, roots[0], roots[1]];
-            }
-            return [roots[0], 0.0, roots[1]];
-        }
-
-        return computeRealRoots(a, b, c, d);
-    };
-export default CubicRealPolynomial;

+ 0 - 204
Source/Core/CullingVolume.js

@@ -1,204 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Cartesian4 from './Cartesian4.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Intersect from './Intersect.js';
-import Plane from './Plane.js';
-
-    /**
-     * The culling volume defined by planes.
-     *
-     * @alias CullingVolume
-     * @constructor
-     *
-     * @param {Cartesian4[]} [planes] An array of clipping planes.
-     */
-    function CullingVolume(planes) {
-        /**
-         * Each plane is represented by a Cartesian4 object, where the x, y, and z components
-         * define the unit vector normal to the plane, and the w component is the distance of the
-         * plane from the origin.
-         * @type {Cartesian4[]}
-         * @default []
-         */
-        this.planes = defaultValue(planes, []);
-    }
-
-    var faces = [new Cartesian3(), new Cartesian3(), new Cartesian3()];
-    Cartesian3.clone(Cartesian3.UNIT_X, faces[0]);
-    Cartesian3.clone(Cartesian3.UNIT_Y, faces[1]);
-    Cartesian3.clone(Cartesian3.UNIT_Z, faces[2]);
-
-    var scratchPlaneCenter = new Cartesian3();
-    var scratchPlaneNormal = new Cartesian3();
-    var scratchPlane = new Plane(new Cartesian3(1.0, 0.0, 0.0), 0.0);
-
-    /**
-     * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.
-     * The planes are aligned to the x, y, and z axes in world coordinates.
-     *
-     * @param {BoundingSphere} boundingSphere The bounding sphere used to create the culling volume.
-     * @param {CullingVolume} [result] The object onto which to store the result.
-     * @returns {CullingVolume} The culling volume created from the bounding sphere.
-     */
-    CullingVolume.fromBoundingSphere = function(boundingSphere, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(boundingSphere)) {
-            throw new DeveloperError('boundingSphere is required.');
-        }
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new CullingVolume();
-        }
-
-        var length = faces.length;
-        var planes = result.planes;
-        planes.length = 2 * length;
-
-        var center = boundingSphere.center;
-        var radius = boundingSphere.radius;
-
-        var planeIndex = 0;
-
-        for (var i = 0; i < length; ++i) {
-            var faceNormal = faces[i];
-
-            var plane0 = planes[planeIndex];
-            var plane1 = planes[planeIndex + 1];
-
-            if (!defined(plane0)) {
-                plane0 = planes[planeIndex] = new Cartesian4();
-            }
-            if (!defined(plane1)) {
-                plane1 = planes[planeIndex + 1] = new Cartesian4();
-            }
-
-            Cartesian3.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);
-            Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);
-
-            plane0.x = faceNormal.x;
-            plane0.y = faceNormal.y;
-            plane0.z = faceNormal.z;
-            plane0.w = -Cartesian3.dot(faceNormal, scratchPlaneCenter);
-
-            Cartesian3.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);
-            Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);
-
-            plane1.x = -faceNormal.x;
-            plane1.y = -faceNormal.y;
-            plane1.z = -faceNormal.z;
-            plane1.w = -Cartesian3.dot(Cartesian3.negate(faceNormal, scratchPlaneNormal), scratchPlaneCenter);
-
-            planeIndex += 2;
-        }
-
-        return result;
-    };
-
-    /**
-     * Determines whether a bounding volume intersects the culling volume.
-     *
-     * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.
-     * @returns {Intersect}  Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.
-     */
-    CullingVolume.prototype.computeVisibility = function(boundingVolume) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(boundingVolume)) {
-            throw new DeveloperError('boundingVolume is required.');
-        }
-        //>>includeEnd('debug');
-
-        var planes = this.planes;
-        var intersecting = false;
-        for (var k = 0, len = planes.length; k < len; ++k) {
-            var result = boundingVolume.intersectPlane(Plane.fromCartesian4(planes[k], scratchPlane));
-            if (result === Intersect.OUTSIDE) {
-                return Intersect.OUTSIDE;
-            } else if (result === Intersect.INTERSECTING) {
-                intersecting = true;
-            }
-        }
-
-        return intersecting ? Intersect.INTERSECTING : Intersect.INSIDE;
-    };
-
-    /**
-     * Determines whether a bounding volume intersects the culling volume.
-     *
-     * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.
-     * @param {Number} parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling
-     *                                 volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then
-     *                                 the parent (and therefore this) volume is completely inside plane[planeIndex]
-     *                                 and that plane check can be skipped.
-     * @returns {Number} A plane mask as described above (which can be applied to this boundingVolume's children).
-     *
-     * @private
-     */
-    CullingVolume.prototype.computeVisibilityWithPlaneMask = function(boundingVolume, parentPlaneMask) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(boundingVolume)) {
-            throw new DeveloperError('boundingVolume is required.');
-        }
-        if (!defined(parentPlaneMask)) {
-            throw new DeveloperError('parentPlaneMask is required.');
-        }
-        //>>includeEnd('debug');
-
-        if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
-            // parent is completely outside or completely inside, so this child is as well.
-            return parentPlaneMask;
-        }
-
-        // Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE.
-        // (Because if there are fewer than 31 planes, the upper bits wont be changed.)
-        var mask = CullingVolume.MASK_INSIDE;
-
-        var planes = this.planes;
-        for (var k = 0, len = planes.length; k < len; ++k) {
-            // For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization.
-            var flag = (k < 31) ? (1 << k) : 0;
-            if (k < 31 && (parentPlaneMask & flag) === 0) {
-                // boundingVolume is known to be INSIDE this plane.
-                continue;
-            }
-
-            var result = boundingVolume.intersectPlane(Plane.fromCartesian4(planes[k], scratchPlane));
-            if (result === Intersect.OUTSIDE) {
-                return CullingVolume.MASK_OUTSIDE;
-            } else if (result === Intersect.INTERSECTING) {
-                mask |= flag;
-            }
-        }
-
-        return mask;
-    };
-
-    /**
-     * For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value
-     * represents the case where the object bounding volume is entirely outside the culling volume.
-     *
-     * @type {Number}
-     * @private
-     */
-    CullingVolume.MASK_OUTSIDE = 0xffffffff;
-
-    /**
-     * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value
-     * represents the case where the object bounding volume is entirely inside the culling volume.
-     *
-     * @type {Number}
-     * @private
-     */
-    CullingVolume.MASK_INSIDE = 0x00000000;
-
-    /**
-     * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value
-     * represents the case where the object bounding volume (may) intersect all planes of the culling volume.
-     *
-     * @type {Number}
-     * @private
-     */
-    CullingVolume.MASK_INDETERMINATE = 0x7fffffff;
-export default CullingVolume;

+ 0 - 436
Source/Core/CylinderGeometry.js

@@ -1,436 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import CylinderGeometryLibrary from './CylinderGeometryLibrary.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import IndexDatatype from './IndexDatatype.js';
-import CesiumMath from './Math.js';
-import PrimitiveType from './PrimitiveType.js';
-import VertexFormat from './VertexFormat.js';
-
-    var radiusScratch = new Cartesian2();
-    var normalScratch = new Cartesian3();
-    var bitangentScratch = new Cartesian3();
-    var tangentScratch = new Cartesian3();
-    var positionScratch = new Cartesian3();
-
-    /**
-     * A description of a cylinder.
-     *
-     * @alias CylinderGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Number} options.length The length of the cylinder.
-     * @param {Number} options.topRadius The radius of the top of the cylinder.
-     * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.
-     * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     *
-     * @exception {DeveloperError} options.slices must be greater than or equal to 3.
-     *
-     * @see CylinderGeometry.createGeometry
-     *
-     * @example
-     * // create cylinder geometry
-     * var cylinder = new Cesium.CylinderGeometry({
-     *     length: 200000,
-     *     topRadius: 80000,
-     *     bottomRadius: 200000,
-     * });
-     * var geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
-     */
-    function CylinderGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var length = options.length;
-        var topRadius = options.topRadius;
-        var bottomRadius = options.bottomRadius;
-        var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);
-        var slices = defaultValue(options.slices, 128);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(length)) {
-            throw new DeveloperError('options.length must be defined.');
-        }
-        if (!defined(topRadius)) {
-            throw new DeveloperError('options.topRadius must be defined.');
-        }
-        if (!defined(bottomRadius)) {
-            throw new DeveloperError('options.bottomRadius must be defined.');
-        }
-        if (slices < 3) {
-            throw new DeveloperError('options.slices must be greater than or equal to 3.');
-        }
-        if (defined(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute.TOP) {
-            throw new DeveloperError('GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.');
-        }
-        //>>includeEnd('debug');
-
-        this._length = length;
-        this._topRadius = topRadius;
-        this._bottomRadius = bottomRadius;
-        this._vertexFormat = VertexFormat.clone(vertexFormat);
-        this._slices = slices;
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createCylinderGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    CylinderGeometry.packedLength = VertexFormat.packedLength + 5;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CylinderGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CylinderGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(value)) {
-            throw new DeveloperError('value is required');
-        }
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        VertexFormat.pack(value._vertexFormat, array, startingIndex);
-        startingIndex += VertexFormat.packedLength;
-
-        array[startingIndex++] = value._length;
-        array[startingIndex++] = value._topRadius;
-        array[startingIndex++] = value._bottomRadius;
-        array[startingIndex++] = value._slices;
-        array[startingIndex] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchVertexFormat = new VertexFormat();
-    var scratchOptions = {
-        vertexFormat : scratchVertexFormat,
-        length : undefined,
-        topRadius : undefined,
-        bottomRadius : undefined,
-        slices : undefined,
-        offsetAttribute : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CylinderGeometry} [result] The object into which to store the result.
-     * @returns {CylinderGeometry} The modified result parameter or a new CylinderGeometry instance if one was not provided.
-     */
-    CylinderGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var vertexFormat = VertexFormat.unpack(array, startingIndex, scratchVertexFormat);
-        startingIndex += VertexFormat.packedLength;
-
-        var length = array[startingIndex++];
-        var topRadius = array[startingIndex++];
-        var bottomRadius = array[startingIndex++];
-        var slices = array[startingIndex++];
-        var offsetAttribute = array[startingIndex];
-
-        if (!defined(result)) {
-            scratchOptions.length = length;
-            scratchOptions.topRadius = topRadius;
-            scratchOptions.bottomRadius = bottomRadius;
-            scratchOptions.slices = slices;
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new CylinderGeometry(scratchOptions);
-        }
-
-        result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);
-        result._length = length;
-        result._topRadius = topRadius;
-        result._bottomRadius = bottomRadius;
-        result._slices = slices;
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CylinderGeometry} cylinderGeometry A description of the cylinder.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CylinderGeometry.createGeometry = function(cylinderGeometry) {
-        var length = cylinderGeometry._length;
-        var topRadius = cylinderGeometry._topRadius;
-        var bottomRadius = cylinderGeometry._bottomRadius;
-        var vertexFormat = cylinderGeometry._vertexFormat;
-        var slices = cylinderGeometry._slices;
-
-        if ((length <= 0) || (topRadius < 0) || (bottomRadius < 0) || ((topRadius === 0) && (bottomRadius === 0))) {
-            return;
-        }
-
-        var twoSlices = slices + slices;
-        var threeSlices = slices + twoSlices;
-        var numVertices = twoSlices + twoSlices;
-
-        var positions = CylinderGeometryLibrary.computePositions(length, topRadius, bottomRadius, slices, true);
-
-        var st = (vertexFormat.st) ? new Float32Array(numVertices * 2) : undefined;
-        var normals = (vertexFormat.normal) ? new Float32Array(numVertices * 3) : undefined;
-        var tangents = (vertexFormat.tangent) ? new Float32Array(numVertices * 3) : undefined;
-        var bitangents = (vertexFormat.bitangent) ? new Float32Array(numVertices * 3) : undefined;
-
-        var i;
-        var computeNormal = (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent);
-
-        if (computeNormal) {
-            var computeTangent = (vertexFormat.tangent || vertexFormat.bitangent);
-
-            var normalIndex = 0;
-            var tangentIndex = 0;
-            var bitangentIndex = 0;
-
-            var theta = Math.atan2(bottomRadius - topRadius, length);
-            var normal = normalScratch;
-            normal.z = Math.sin(theta);
-            var normalScale = Math.cos(theta);
-            var tangent = tangentScratch;
-            var bitangent = bitangentScratch;
-
-            for (i = 0; i < slices; i++) {
-                var angle = i / slices * CesiumMath.TWO_PI;
-                var x = normalScale * Math.cos(angle);
-                var y = normalScale * Math.sin(angle);
-                if (computeNormal) {
-                    normal.x = x;
-                    normal.y = y;
-
-                    if (computeTangent) {
-                        tangent = Cartesian3.normalize(Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent), tangent);
-                    }
-
-                    if (vertexFormat.normal) {
-                        normals[normalIndex++] = normal.x;
-                        normals[normalIndex++] = normal.y;
-                        normals[normalIndex++] = normal.z;
-                        normals[normalIndex++] = normal.x;
-                        normals[normalIndex++] = normal.y;
-                        normals[normalIndex++] = normal.z;
-                    }
-
-                    if (vertexFormat.tangent) {
-                        tangents[tangentIndex++] = tangent.x;
-                        tangents[tangentIndex++] = tangent.y;
-                        tangents[tangentIndex++] = tangent.z;
-                        tangents[tangentIndex++] = tangent.x;
-                        tangents[tangentIndex++] = tangent.y;
-                        tangents[tangentIndex++] = tangent.z;
-                    }
-
-                    if (vertexFormat.bitangent) {
-                        bitangent = Cartesian3.normalize(Cartesian3.cross(normal, tangent, bitangent), bitangent);
-                        bitangents[bitangentIndex++] = bitangent.x;
-                        bitangents[bitangentIndex++] = bitangent.y;
-                        bitangents[bitangentIndex++] = bitangent.z;
-                        bitangents[bitangentIndex++] = bitangent.x;
-                        bitangents[bitangentIndex++] = bitangent.y;
-                        bitangents[bitangentIndex++] = bitangent.z;
-                    }
-                }
-            }
-
-            for (i = 0; i < slices; i++) {
-                if (vertexFormat.normal) {
-                    normals[normalIndex++] = 0;
-                    normals[normalIndex++] = 0;
-                    normals[normalIndex++] = -1;
-                }
-                if (vertexFormat.tangent) {
-                    tangents[tangentIndex++] = 1;
-                    tangents[tangentIndex++] = 0;
-                    tangents[tangentIndex++] = 0;
-                }
-                if (vertexFormat.bitangent) {
-                    bitangents[bitangentIndex++] = 0;
-                    bitangents[bitangentIndex++] = -1;
-                    bitangents[bitangentIndex++] = 0;
-                }
-            }
-
-            for (i = 0; i < slices; i++) {
-                if (vertexFormat.normal) {
-                    normals[normalIndex++] = 0;
-                    normals[normalIndex++] = 0;
-                    normals[normalIndex++] = 1;
-                }
-                if (vertexFormat.tangent) {
-                    tangents[tangentIndex++] = 1;
-                    tangents[tangentIndex++] = 0;
-                    tangents[tangentIndex++] = 0;
-                }
-                if (vertexFormat.bitangent) {
-                    bitangents[bitangentIndex++] = 0;
-                    bitangents[bitangentIndex++] = 1;
-                    bitangents[bitangentIndex++] = 0;
-                }
-            }
-        }
-
-        var numIndices = 12 * slices - 12;
-        var indices = IndexDatatype.createTypedArray(numVertices, numIndices);
-        var index = 0;
-        var j = 0;
-        for (i = 0; i < slices - 1; i++) {
-            indices[index++] = j;
-            indices[index++] = j + 2;
-            indices[index++] = j + 3;
-
-            indices[index++] = j;
-            indices[index++] = j + 3;
-            indices[index++] = j + 1;
-
-            j += 2;
-        }
-
-        indices[index++] = twoSlices - 2;
-        indices[index++] = 0;
-        indices[index++] = 1;
-        indices[index++] = twoSlices - 2;
-        indices[index++] = 1;
-        indices[index++] = twoSlices - 1;
-
-        for (i = 1; i < slices - 1; i++) {
-            indices[index++] = twoSlices + i + 1;
-            indices[index++] = twoSlices + i;
-            indices[index++] = twoSlices;
-        }
-
-        for (i = 1; i < slices - 1; i++) {
-            indices[index++] = threeSlices;
-            indices[index++] = threeSlices + i;
-            indices[index++] = threeSlices + i + 1;
-        }
-
-        var textureCoordIndex = 0;
-        if (vertexFormat.st) {
-            var rad = Math.max(topRadius, bottomRadius);
-            for (i = 0; i < numVertices; i++) {
-                var position = Cartesian3.fromArray(positions, i * 3, positionScratch);
-                st[textureCoordIndex++] = (position.x + rad) / (2.0 * rad);
-                st[textureCoordIndex++] = (position.y + rad) / (2.0 * rad);
-            }
-        }
-
-        var attributes = new GeometryAttributes();
-        if (vertexFormat.position) {
-            attributes.position = new GeometryAttribute({
-                componentDatatype: ComponentDatatype.DOUBLE,
-                componentsPerAttribute: 3,
-                values: positions
-            });
-        }
-
-        if (vertexFormat.normal) {
-            attributes.normal = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 3,
-                values : normals
-            });
-        }
-
-        if (vertexFormat.tangent) {
-            attributes.tangent = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 3,
-                values : tangents
-            });
-        }
-
-        if (vertexFormat.bitangent) {
-            attributes.bitangent = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 3,
-                values : bitangents
-            });
-        }
-
-        if (vertexFormat.st) {
-            attributes.st = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.FLOAT,
-                componentsPerAttribute : 2,
-                values : st
-            });
-        }
-
-        radiusScratch.x = length * 0.5;
-        radiusScratch.y = Math.max(bottomRadius, topRadius);
-
-        var boundingSphere = new BoundingSphere(Cartesian3.ZERO, Cartesian2.magnitude(radiusScratch));
-
-        if (defined(cylinderGeometry._offsetAttribute)) {
-            length = positions.length;
-            var applyOffset = new Uint8Array(length / 3);
-            var offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-            arrayFill(applyOffset, offsetValue);
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values: applyOffset
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.TRIANGLES,
-            boundingSphere : boundingSphere,
-            offsetAttribute : cylinderGeometry._offsetAttribute
-        });
-    };
-
-    var unitCylinderGeometry;
-
-    /**
-     * Returns the geometric representation of a unit cylinder, including its vertices, indices, and a bounding sphere.
-     * @returns {Geometry} The computed vertices and indices.
-     *
-     * @private
-     */
-    CylinderGeometry.getUnitCylinder = function() {
-        if (!defined(unitCylinderGeometry)) {
-            unitCylinderGeometry = CylinderGeometry.createGeometry(new CylinderGeometry({
-                topRadius : 1.0,
-                bottomRadius : 1.0,
-                length : 1.0,
-                vertexFormat : VertexFormat.POSITION_ONLY
-            }));
-        }
-        return unitCylinderGeometry;
-    };
-export default CylinderGeometry;

+ 0 - 53
Source/Core/CylinderGeometryLibrary.js

@@ -1,53 +0,0 @@
-import CesiumMath from './Math.js';
-
-    /**
-     * @private
-     */
-    var CylinderGeometryLibrary = {};
-
-    /**
-     * @private
-     */
-    CylinderGeometryLibrary.computePositions = function(length, topRadius, bottomRadius, slices, fill){
-        var topZ = length * 0.5;
-        var bottomZ = -topZ;
-
-        var twoSlice = slices + slices;
-        var size = (fill) ? 2 * twoSlice : twoSlice;
-        var positions = new Float64Array(size*3);
-        var i;
-        var index = 0;
-        var tbIndex = 0;
-        var bottomOffset = (fill) ? twoSlice*3 : 0;
-        var topOffset = (fill) ? (twoSlice + slices)*3 : slices*3;
-
-        for (i = 0; i < slices; i++) {
-            var angle = i / slices * CesiumMath.TWO_PI;
-            var x = Math.cos(angle);
-            var y = Math.sin(angle);
-            var bottomX = x * bottomRadius;
-            var bottomY = y * bottomRadius;
-            var topX = x * topRadius;
-            var topY = y * topRadius;
-
-            positions[tbIndex + bottomOffset] = bottomX;
-            positions[tbIndex + bottomOffset + 1] = bottomY;
-            positions[tbIndex + bottomOffset + 2] = bottomZ;
-
-            positions[tbIndex + topOffset] = topX;
-            positions[tbIndex + topOffset + 1] = topY;
-            positions[tbIndex + topOffset + 2] = topZ;
-            tbIndex += 3;
-            if (fill) {
-                positions[index++] = bottomX;
-                positions[index++] = bottomY;
-                positions[index++] = bottomZ;
-                positions[index++] = topX;
-                positions[index++] = topY;
-                positions[index++] = topZ;
-            }
-        }
-
-        return positions;
-    };
-export default CylinderGeometryLibrary;

+ 0 - 244
Source/Core/CylinderOutlineGeometry.js

@@ -1,244 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import CylinderGeometryLibrary from './CylinderGeometryLibrary.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import IndexDatatype from './IndexDatatype.js';
-import PrimitiveType from './PrimitiveType.js';
-
-    var radiusScratch = new Cartesian2();
-
-    /**
-     * A description of the outline of a cylinder.
-     *
-     * @alias CylinderOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Number} options.length The length of the cylinder.
-     * @param {Number} options.topRadius The radius of the top of the cylinder.
-     * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.
-     * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.
-     * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.
-     *
-     * @exception {DeveloperError} options.length must be greater than 0.
-     * @exception {DeveloperError} options.topRadius must be greater than 0.
-     * @exception {DeveloperError} options.bottomRadius must be greater than 0.
-     * @exception {DeveloperError} bottomRadius and topRadius cannot both equal 0.
-     * @exception {DeveloperError} options.slices must be greater than or equal to 3.
-     *
-     * @see CylinderOutlineGeometry.createGeometry
-     *
-     * @example
-     * // create cylinder geometry
-     * var cylinder = new Cesium.CylinderOutlineGeometry({
-     *     length: 200000,
-     *     topRadius: 80000,
-     *     bottomRadius: 200000,
-     * });
-     * var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
-     */
-    function CylinderOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var length = options.length;
-        var topRadius = options.topRadius;
-        var bottomRadius = options.bottomRadius;
-        var slices = defaultValue(options.slices, 128);
-        var numberOfVerticalLines = Math.max(defaultValue(options.numberOfVerticalLines, 16), 0);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('options.positions', length);
-        Check.typeOf.number('options.topRadius', topRadius);
-        Check.typeOf.number('options.bottomRadius', bottomRadius);
-        Check.typeOf.number.greaterThanOrEquals('options.slices', slices, 3);
-        if (defined(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute.TOP) {
-            throw new DeveloperError('GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.');
-        }
-        //>>includeEnd('debug');
-
-        this._length = length;
-        this._topRadius = topRadius;
-        this._bottomRadius = bottomRadius;
-        this._slices = slices;
-        this._numberOfVerticalLines = numberOfVerticalLines;
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createCylinderOutlineGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    CylinderOutlineGeometry.packedLength = 6;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {CylinderOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    CylinderOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        array[startingIndex++] = value._length;
-        array[startingIndex++] = value._topRadius;
-        array[startingIndex++] = value._bottomRadius;
-        array[startingIndex++] = value._slices;
-        array[startingIndex++] = value._numberOfVerticalLines;
-        array[startingIndex] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchOptions = {
-        length : undefined,
-        topRadius : undefined,
-        bottomRadius : undefined,
-        slices : undefined,
-        numberOfVerticalLines : undefined,
-        offsetAttribute : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {CylinderOutlineGeometry} [result] The object into which to store the result.
-     * @returns {CylinderOutlineGeometry} The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
-     */
-    CylinderOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var length = array[startingIndex++];
-        var topRadius = array[startingIndex++];
-        var bottomRadius = array[startingIndex++];
-        var slices = array[startingIndex++];
-        var numberOfVerticalLines = array[startingIndex++];
-        var offsetAttribute = array[startingIndex];
-
-        if (!defined(result)) {
-            scratchOptions.length = length;
-            scratchOptions.topRadius = topRadius;
-            scratchOptions.bottomRadius = bottomRadius;
-            scratchOptions.slices = slices;
-            scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new CylinderOutlineGeometry(scratchOptions);
-        }
-
-        result._length = length;
-        result._topRadius = topRadius;
-        result._bottomRadius = bottomRadius;
-        result._slices = slices;
-        result._numberOfVerticalLines = numberOfVerticalLines;
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {CylinderOutlineGeometry} cylinderGeometry A description of the cylinder outline.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    CylinderOutlineGeometry.createGeometry = function(cylinderGeometry) {
-        var length = cylinderGeometry._length;
-        var topRadius = cylinderGeometry._topRadius;
-        var bottomRadius = cylinderGeometry._bottomRadius;
-        var slices = cylinderGeometry._slices;
-        var numberOfVerticalLines = cylinderGeometry._numberOfVerticalLines;
-
-        if ((length <= 0) || (topRadius < 0) || (bottomRadius < 0) || ((topRadius === 0) && (bottomRadius === 0))) {
-            return;
-        }
-
-        var numVertices = slices * 2;
-
-        var positions = CylinderGeometryLibrary.computePositions(length, topRadius, bottomRadius, slices, false);
-        var numIndices = slices * 2;
-        var numSide;
-        if (numberOfVerticalLines > 0) {
-            var numSideLines = Math.min(numberOfVerticalLines, slices);
-            numSide = Math.round(slices / numSideLines);
-            numIndices += numSideLines;
-        }
-
-        var indices = IndexDatatype.createTypedArray(numVertices, numIndices * 2);
-        var index = 0;
-        var i;
-        for (i = 0; i < slices - 1; i++) {
-            indices[index++] = i;
-            indices[index++] = i + 1;
-            indices[index++] = i + slices;
-            indices[index++] = i + 1 + slices;
-        }
-
-        indices[index++] = slices - 1;
-        indices[index++] = 0;
-        indices[index++] = slices + slices - 1;
-        indices[index++] = slices;
-
-        if (numberOfVerticalLines > 0) {
-            for (i = 0; i < slices; i += numSide) {
-                indices[index++] = i;
-                indices[index++] = i + slices;
-            }
-        }
-
-        var attributes = new GeometryAttributes();
-        attributes.position = new GeometryAttribute({
-            componentDatatype : ComponentDatatype.DOUBLE,
-            componentsPerAttribute : 3,
-            values : positions
-        });
-
-        radiusScratch.x = length * 0.5;
-        radiusScratch.y = Math.max(bottomRadius, topRadius);
-
-        var boundingSphere = new BoundingSphere(Cartesian3.ZERO, Cartesian2.magnitude(radiusScratch));
-
-        if (defined(cylinderGeometry._offsetAttribute)) {
-            length = positions.length;
-            var applyOffset = new Uint8Array(length / 3);
-            var offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-            arrayFill(applyOffset, offsetValue);
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values: applyOffset
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.LINES,
-            boundingSphere : boundingSphere,
-            offsetAttribute : cylinderGeometry._offsetAttribute
-        });
-    };
-export default CylinderOutlineGeometry;

+ 0 - 25
Source/Core/DefaultProxy.js

@@ -1,25 +0,0 @@
-
-    /**
-     * A simple proxy that appends the desired resource as the sole query parameter
-     * to the given proxy URL.
-     *
-     * @alias DefaultProxy
-     * @constructor
-     *
-     * @param {String} proxy The proxy URL that will be used to requests all resources.
-     */
-    function DefaultProxy(proxy) {
-        this.proxy = proxy;
-    }
-
-    /**
-     * Get the final URL to use to request a given resource.
-     *
-     * @param {String} resource The resource to request.
-     * @returns {String} proxied resource
-     */
-    DefaultProxy.prototype.getURL = function(resource) {
-        var prefix = this.proxy.indexOf('?') === -1 ? '?' : '';
-        return this.proxy + prefix + encodeURIComponent(resource);
-    };
-export default DefaultProxy;

+ 0 - 73
Source/Core/DeveloperError.js

@@ -1,73 +0,0 @@
-import defined from './defined.js';
-
-    /**
-     * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
-     * argument out of range, etc.  This exception should only be thrown during development;
-     * it usually indicates a bug in the calling code.  This exception should never be
-     * caught; instead the calling code should strive not to generate it.
-     * <br /><br />
-     * On the other hand, a {@link RuntimeError} indicates an exception that may
-     * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
-     * to catch.
-     *
-     * @alias DeveloperError
-     * @constructor
-     * @extends Error
-     *
-     * @param {String} [message] The error message for this exception.
-     *
-     * @see RuntimeError
-     */
-    function DeveloperError(message) {
-        /**
-         * 'DeveloperError' indicating that this exception was thrown due to a developer error.
-         * @type {String}
-         * @readonly
-         */
-        this.name = 'DeveloperError';
-
-        /**
-         * The explanation for why this exception was thrown.
-         * @type {String}
-         * @readonly
-         */
-        this.message = message;
-
-        //Browsers such as IE don't have a stack property until you actually throw the error.
-        var stack;
-        try {
-            throw new Error();
-        } catch (e) {
-            stack = e.stack;
-        }
-
-        /**
-         * The stack trace of this exception, if available.
-         * @type {String}
-         * @readonly
-         */
-        this.stack = stack;
-    }
-
-    if (defined(Object.create)) {
-        DeveloperError.prototype = Object.create(Error.prototype);
-        DeveloperError.prototype.constructor = DeveloperError;
-    }
-
-    DeveloperError.prototype.toString = function() {
-        var str = this.name + ': ' + this.message;
-
-        if (defined(this.stack)) {
-            str += '\n' + this.stack.toString();
-        }
-
-        return str;
-    };
-
-    /**
-     * @private
-     */
-    DeveloperError.throwInstantiationError = function() {
-        throw new DeveloperError('This function defines an interface and should not be called directly.');
-    };
-export default DeveloperError;

+ 0 - 171
Source/Core/DistanceDisplayCondition.js

@@ -1,171 +0,0 @@
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * Determines visibility based on the distance to the camera.
-     *
-     * @alias DistanceDisplayCondition
-     * @constructor
-     *
-     * @param {Number} [near=0.0] The smallest distance in the interval where the object is visible.
-     * @param {Number} [far=Number.MAX_VALUE] The largest distance in the interval where the object is visible.
-     *
-     * @example
-     * // Make a billboard that is only visible when the distance to the camera is between 10 and 20 meters.
-     * billboard.distanceDisplayCondition = new Cesium.DistanceDisplayCondition(10.0, 20.0);
-     */
-    function DistanceDisplayCondition(near, far) {
-        near = defaultValue(near, 0.0);
-        this._near = near;
-
-        far = defaultValue(far, Number.MAX_VALUE);
-        this._far = far;
-    }
-
-    defineProperties(DistanceDisplayCondition.prototype, {
-        /**
-         * The smallest distance in the interval where the object is visible.
-         * @memberof DistanceDisplayCondition.prototype
-         * @type {Number}
-         * @default 0.0
-         */
-        near: {
-            get: function() {
-                return this._near;
-            },
-            set: function(value) {
-                this._near = value;
-            }
-        },
-        /**
-         * The largest distance in the interval where the object is visible.
-         * @memberof DistanceDisplayCondition.prototype
-         * @type {Number}
-         * @default Number.MAX_VALUE
-         */
-        far: {
-            get: function() {
-                return this._far;
-            },
-            set: function(value) {
-                this._far = value;
-            }
-        }
-    });
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    DistanceDisplayCondition.packedLength = 2;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {DistanceDisplayCondition} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    DistanceDisplayCondition.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(value)) {
-            throw new DeveloperError('value is required');
-        }
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        array[startingIndex++] = value.near;
-        array[startingIndex] = value.far;
-
-        return array;
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {DistanceDisplayCondition} [result] The object into which to store the result.
-     * @returns {DistanceDisplayCondition} The modified result parameter or a new DistanceDisplayCondition instance if one was not provided.
-     */
-    DistanceDisplayCondition.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        if (!defined(result)) {
-            result = new DistanceDisplayCondition();
-        }
-        result.near = array[startingIndex++];
-        result.far = array[startingIndex];
-        return result;
-    };
-
-    /**
-     * Determines if two distance display conditions are equal.
-     *
-     * @param {DistanceDisplayCondition} left A distance display condition.
-     * @param {DistanceDisplayCondition} right Another distance display condition.
-     * @return {Boolean} Whether the two distance display conditions are equal.
-     */
-    DistanceDisplayCondition.equals = function(left, right) {
-        return left === right ||
-               (defined(left) &&
-                defined(right) &&
-                left.near === right.near &&
-                left.far === right.far);
-    };
-
-    /**
-     * Duplicates a distance display condition instance.
-     *
-     * @param {DistanceDisplayCondition} [value] The distance display condition to duplicate.
-     * @param {DistanceDisplayCondition} [result] The result onto which to store the result.
-     * @return {DistanceDisplayCondition} The duplicated instance.
-     */
-    DistanceDisplayCondition.clone = function(value, result) {
-        if (!defined(value)) {
-            return undefined;
-        }
-
-        if (!defined(result)) {
-            result = new DistanceDisplayCondition();
-        }
-
-        result.near = value.near;
-        result.far = value.far;
-        return result;
-    };
-
-    /**
-     * Duplicates this instance.
-     *
-     * @param {DistanceDisplayCondition} [result] The result onto which to store the result.
-     * @return {DistanceDisplayCondition} The duplicated instance.
-     */
-    DistanceDisplayCondition.prototype.clone = function(result) {
-        return DistanceDisplayCondition.clone(this, result);
-    };
-
-    /**
-     * Determines if this distance display condition is equal to another.
-     *
-     * @param {DistanceDisplayCondition} other Another distance display condition.
-     * @return {Boolean} Whether this distance display condition is equal to the other.
-     */
-    DistanceDisplayCondition.prototype.equals = function(other) {
-        return DistanceDisplayCondition.equals(this, other);
-    };
-export default DistanceDisplayCondition;

+ 0 - 164
Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js

@@ -1,164 +0,0 @@
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.
-     *
-     * @alias DistanceDisplayConditionGeometryInstanceAttribute
-     * @constructor
-     *
-     * @param {Number} [near=0.0] The near distance.
-     * @param {Number} [far=Number.MAX_VALUE] The far distance.
-     *
-     * @exception {DeveloperError} far must be greater than near.
-     *
-     * @example
-     * var instance = new Cesium.GeometryInstance({
-     *   geometry : new Cesium.BoxGeometry({
-     *     vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
-     *     minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
-     *     maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
-     *   }),
-     *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
-     *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
-     *   id : 'box',
-     *   attributes : {
-     *     distanceDisplayCondition : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
-     *   }
-     * });
-     *
-     * @see GeometryInstance
-     * @see GeometryInstanceAttribute
-     */
-    function DistanceDisplayConditionGeometryInstanceAttribute(near, far) {
-        near = defaultValue(near, 0.0);
-        far = defaultValue(far, Number.MAX_VALUE);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (far <= near) {
-            throw new DeveloperError('far distance must be greater than near distance.');
-        }
-        //>>includeEnd('debug');
-
-        /**
-         * The values for the attributes stored in a typed array.
-         *
-         * @type Float32Array
-         *
-         * @default [0.0, 0.0, Number.MAX_VALUE]
-         */
-        this.value = new Float32Array([near, far]);
-    }
-
-    defineProperties(DistanceDisplayConditionGeometryInstanceAttribute.prototype, {
-        /**
-         * The datatype of each component in the attribute, e.g., individual elements in
-         * {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
-         *
-         * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype
-         *
-         * @type {ComponentDatatype}
-         * @readonly
-         *
-         * @default {@link ComponentDatatype.FLOAT}
-         */
-        componentDatatype : {
-            get : function() {
-                return ComponentDatatype.FLOAT;
-            }
-        },
-
-        /**
-         * The number of components in the attributes, i.e., {@link DistanceDisplayConditionGeometryInstanceAttribute#value}.
-         *
-         * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype
-         *
-         * @type {Number}
-         * @readonly
-         *
-         * @default 3
-         */
-        componentsPerAttribute : {
-            get : function() {
-                return 2;
-            }
-        },
-
-        /**
-         * When <code>true</code> and <code>componentDatatype</code> is an integer format,
-         * indicate that the components should be mapped to the range [0, 1] (unsigned)
-         * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
-         *
-         * @memberof DistanceDisplayConditionGeometryInstanceAttribute.prototype
-         *
-         * @type {Boolean}
-         * @readonly
-         *
-         * @default false
-         */
-        normalize : {
-            get : function() {
-                return false;
-            }
-        }
-    });
-
-    /**
-     * Creates a new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
-     *
-     * @param {DistanceDisplayCondition} distanceDisplayCondition The distance display condition.
-     * @returns {DistanceDisplayConditionGeometryInstanceAttribute} The new {@link DistanceDisplayConditionGeometryInstanceAttribute} instance.
-     *
-     * @exception {DeveloperError} distanceDisplayCondition.far must be greater than distanceDisplayCondition.near
-     *
-     * @example
-     * var distanceDisplayCondition = new Cesium.DistanceDisplayCondition(100.0, 10000.0);
-     * var instance = new Cesium.GeometryInstance({
-     *   geometry : geometry,
-     *   attributes : {
-     *     distanceDisplayCondition : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition)
-     *   }
-     * });
-     */
-    DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = function(distanceDisplayCondition) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(distanceDisplayCondition)) {
-            throw new DeveloperError('distanceDisplayCondition is required.');
-        }
-        if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {
-            throw new DeveloperError('distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.');
-        }
-        //>>includeEnd('debug');
-
-        return new DistanceDisplayConditionGeometryInstanceAttribute(distanceDisplayCondition.near, distanceDisplayCondition.far);
-    };
-
-    /**
-     * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
-     *
-     * @param {DistanceDisplayCondition} distanceDisplayCondition The distance display condition value.
-     * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.
-     * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.
-     *
-     * @example
-     * var attributes = primitive.getGeometryInstanceAttributes('an id');
-     * attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);
-     */
-    DistanceDisplayConditionGeometryInstanceAttribute.toValue = function(distanceDisplayCondition, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(distanceDisplayCondition)) {
-            throw new DeveloperError('distanceDisplayCondition is required.');
-        }
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            return new Float32Array([distanceDisplayCondition.near, distanceDisplayCondition.far]);
-        }
-        result[0] = distanceDisplayCondition.near;
-        result[1] = distanceDisplayCondition.far;
-        return result;
-    };
-export default DistanceDisplayConditionGeometryInstanceAttribute;

+ 0 - 113
Source/Core/DoublyLinkedList.js

@@ -1,113 +0,0 @@
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-
-    /**
-     * @private
-     */
-    function DoublyLinkedList() {
-        this.head = undefined;
-        this.tail = undefined;
-        this._length = 0;
-    }
-
-    defineProperties(DoublyLinkedList.prototype, {
-        length : {
-            get : function() {
-                return this._length;
-            }
-        }
-    });
-
-    /**
-     * @private
-     */
-    function DoublyLinkedListNode(item, previous, next) {
-        this.item = item;
-        this.previous  = previous;
-        this.next = next;
-    }
-
-    /**
-     * Adds the item to the end of the list
-     * @param {*} [item]
-     * @return {DoublyLinkedListNode}
-     */
-    DoublyLinkedList.prototype.add = function(item) {
-        var node = new DoublyLinkedListNode(item, this.tail, undefined);
-
-        if (defined(this.tail)) {
-            this.tail.next = node;
-            this.tail = node;
-        } else {
-            this.head = node;
-            this.tail = node;
-        }
-
-        ++this._length;
-
-        return node;
-    };
-
-    function remove(list, node) {
-        if (defined(node.previous) && defined(node.next)) {
-            node.previous.next = node.next;
-            node.next.previous = node.previous;
-        } else if (defined(node.previous)) {
-            // Remove last node
-            node.previous.next = undefined;
-            list.tail = node.previous;
-        } else if (defined(node.next)) {
-            // Remove first node
-            node.next.previous = undefined;
-            list.head = node.next;
-        } else {
-            // Remove last node in the linked list
-            list.head = undefined;
-            list.tail = undefined;
-        }
-
-        node.next = undefined;
-        node.previous = undefined;
-    }
-
-    /**
-     * Removes the given node from the list
-     * @param {DoublyLinkedListNode} node
-     */
-    DoublyLinkedList.prototype.remove = function(node) {
-        if (!defined(node)) {
-            return;
-        }
-
-        remove(this, node);
-
-        --this._length;
-    };
-
-    /**
-     * Moves nextNode after node
-     * @param {DoublyLinkedListNode} node
-     * @param {DoublyLinkedListNode} nextNode
-     */
-    DoublyLinkedList.prototype.splice = function(node, nextNode) {
-        if (node === nextNode) {
-            return;
-        }
-
-        // Remove nextNode, then insert after node
-        remove(this, nextNode);
-
-        var oldNodeNext = node.next;
-        node.next = nextNode;
-
-        // nextNode is the new tail
-        if (this.tail === node) {
-            this.tail = nextNode;
-        } else {
-            oldNodeNext.previous = nextNode;
-        }
-
-        nextNode.next = oldNodeNext;
-        nextNode.previous = node;
-    };
-export default DoublyLinkedList;

+ 0 - 367
Source/Core/EarthOrientationParameters.js

@@ -1,367 +0,0 @@
-import when from '../ThirdParty/when.js';
-import binarySearch from './binarySearch.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import EarthOrientationParametersSample from './EarthOrientationParametersSample.js';
-import freezeObject from './freezeObject.js';
-import JulianDate from './JulianDate.js';
-import LeapSecond from './LeapSecond.js';
-import Resource from './Resource.js';
-import RuntimeError from './RuntimeError.js';
-import TimeConstants from './TimeConstants.js';
-import TimeStandard from './TimeStandard.js';
-
-    /**
-     * Specifies Earth polar motion coordinates and the difference between UT1 and UTC.
-     * These Earth Orientation Parameters (EOP) are primarily used in the transformation from
-     * the International Celestial Reference Frame (ICRF) to the International Terrestrial
-     * Reference Frame (ITRF).
-     *
-     * @alias EarthOrientationParameters
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {Resource|String} [options.url] The URL from which to obtain EOP data.  If neither this
-     *                 parameter nor options.data is specified, all EOP values are assumed
-     *                 to be 0.0.  If options.data is specified, this parameter is
-     *                 ignored.
-     * @param {Object} [options.data] The actual EOP data.  If neither this
-     *                 parameter nor options.data is specified, all EOP values are assumed
-     *                 to be 0.0.
-     * @param {Boolean} [options.addNewLeapSeconds=true] True if leap seconds that
-     *                  are specified in the EOP data but not in {@link JulianDate.leapSeconds}
-     *                  should be added to {@link JulianDate.leapSeconds}.  False if
-     *                  new leap seconds should be handled correctly in the context
-     *                  of the EOP data but otherwise ignored.
-     *
-     * @example
-     * // An example EOP data file, EOP.json:
-     * {
-     *   "columnNames" : ["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],
-     *   "samples" : [
-     *      "2011-07-01T00:00:00Z",55743.0,2.117957047295119e-7,2.111518721609984e-6,-0.2908948,-2.956e-4,3.393695767766752e-11,3.3452143996557983e-10,34.0,
-     *      "2011-07-02T00:00:00Z",55744.0,2.193297093339541e-7,2.115460256837405e-6,-0.29065,-1.824e-4,-8.241832578862112e-11,5.623838700870617e-10,34.0,
-     *      "2011-07-03T00:00:00Z",55745.0,2.262286080161428e-7,2.1191157519929706e-6,-0.2905572,1.9e-6,-3.490658503988659e-10,6.981317007977318e-10,34.0
-     *   ]
-     * }
-     *
-     * @example
-     * // Loading the EOP data
-     * var eop = new Cesium.EarthOrientationParameters({ url : 'Data/EOP.json' });
-     * Cesium.Transforms.earthOrientationParameters = eop;
-     *
-     * @private
-     */
-    function EarthOrientationParameters(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        this._dates = undefined;
-        this._samples = undefined;
-
-        this._dateColumn = -1;
-        this._xPoleWanderRadiansColumn = -1;
-        this._yPoleWanderRadiansColumn = -1;
-        this._ut1MinusUtcSecondsColumn = -1;
-        this._xCelestialPoleOffsetRadiansColumn = -1;
-        this._yCelestialPoleOffsetRadiansColumn = -1;
-        this._taiMinusUtcSecondsColumn = -1;
-
-        this._columnCount = 0;
-        this._lastIndex = -1;
-
-        this._downloadPromise = undefined;
-        this._dataError = undefined;
-
-        this._addNewLeapSeconds = defaultValue(options.addNewLeapSeconds, true);
-
-        if (defined(options.data)) {
-            // Use supplied EOP data.
-            onDataReady(this, options.data);
-        } else if (defined(options.url)) {
-            var resource = Resource.createIfNeeded(options.url);
-
-            // Download EOP data.
-            var that = this;
-            this._downloadPromise = when(resource.fetchJson(), function(eopData) {
-                onDataReady(that, eopData);
-            }, function() {
-                that._dataError = 'An error occurred while retrieving the EOP data from the URL ' + resource.url + '.';
-            });
-        } else {
-            // Use all zeros for EOP data.
-            onDataReady(this, {
-                'columnNames' : ['dateIso8601', 'modifiedJulianDateUtc', 'xPoleWanderRadians', 'yPoleWanderRadians', 'ut1MinusUtcSeconds', 'lengthOfDayCorrectionSeconds', 'xCelestialPoleOffsetRadians', 'yCelestialPoleOffsetRadians', 'taiMinusUtcSeconds'],
-                'samples' : []
-            });
-        }
-    }
-
-    /**
-     * A default {@link EarthOrientationParameters} instance that returns zero for all EOP values.
-     */
-    EarthOrientationParameters.NONE = freezeObject({
-            getPromiseToLoad : function() {
-                return when();
-            },
-            compute : function(date, result) {
-                if (!defined(result)) {
-                    result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);
-                } else {
-                    result.xPoleWander = 0.0;
-                    result.yPoleWander = 0.0;
-                    result.xPoleOffset = 0.0;
-                    result.yPoleOffset = 0.0;
-                    result.ut1MinusUtc = 0.0;
-                }
-                return result;
-            }
-    });
-
-    /**
-     * Gets a promise that, when resolved, indicates that the EOP data has been loaded and is
-     * ready to use.
-     *
-     * @returns {Promise} The promise.
-     *
-     * @see when
-     */
-    EarthOrientationParameters.prototype.getPromiseToLoad = function() {
-        return when(this._downloadPromise);
-    };
-
-    /**
-     * Computes the Earth Orientation Parameters (EOP) for a given date by interpolating.
-     * If the EOP data has not yet been download, this method returns undefined.
-     *
-     * @param {JulianDate} date The date for each to evaluate the EOP.
-     * @param {EarthOrientationParametersSample} [result] The instance to which to copy the result.
-     *        If this parameter is undefined, a new instance is created and returned.
-     * @returns {EarthOrientationParametersSample} The EOP evaluated at the given date, or
-     *          undefined if the data necessary to evaluate EOP at the date has not yet been
-     *          downloaded.
-     *
-     * @exception {RuntimeError} The loaded EOP data has an error and cannot be used.
-     *
-     * @see EarthOrientationParameters#getPromiseToLoad
-     */
-    EarthOrientationParameters.prototype.compute = function(date, result) {
-        // We cannot compute until the samples are available.
-        if (!defined(this._samples)) {
-            if (defined(this._dataError)) {
-                throw new RuntimeError(this._dataError);
-            }
-
-            return undefined;
-        }
-
-        if (!defined(result)) {
-            result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);
-        }
-
-        if (this._samples.length === 0) {
-            result.xPoleWander = 0.0;
-            result.yPoleWander = 0.0;
-            result.xPoleOffset = 0.0;
-            result.yPoleOffset = 0.0;
-            result.ut1MinusUtc = 0.0;
-            return result;
-        }
-
-        var dates = this._dates;
-        var lastIndex = this._lastIndex;
-
-        var before = 0;
-        var after = 0;
-        if (defined(lastIndex)) {
-            var previousIndexDate = dates[lastIndex];
-            var nextIndexDate = dates[lastIndex + 1];
-            var isAfterPrevious = JulianDate.lessThanOrEquals(previousIndexDate, date);
-            var isAfterLastSample = !defined(nextIndexDate);
-            var isBeforeNext = isAfterLastSample || JulianDate.greaterThanOrEquals(nextIndexDate, date);
-
-            if (isAfterPrevious && isBeforeNext) {
-                before = lastIndex;
-
-                if (!isAfterLastSample && nextIndexDate.equals(date)) {
-                    ++before;
-                }
-                after = before + 1;
-
-                interpolate(this, dates, this._samples, date, before, after, result);
-                return result;
-            }
-        }
-
-        var index = binarySearch(dates, date, JulianDate.compare, this._dateColumn);
-        if (index >= 0) {
-            // If the next entry is the same date, use the later entry.  This way, if two entries
-            // describe the same moment, one before a leap second and the other after, then we will use
-            // the post-leap second data.
-            if (index < dates.length - 1 && dates[index + 1].equals(date)) {
-                ++index;
-            }
-            before = index;
-            after = index;
-        } else {
-            after = ~index;
-            before = after - 1;
-
-            // Use the first entry if the date requested is before the beginning of the data.
-            if (before < 0) {
-                before = 0;
-            }
-        }
-
-        this._lastIndex = before;
-
-        interpolate(this, dates, this._samples, date, before, after, result);
-        return result;
-    };
-
-    function compareLeapSecondDates(leapSecond, dateToFind) {
-        return JulianDate.compare(leapSecond.julianDate, dateToFind);
-    }
-
-    function onDataReady(eop, eopData) {
-        if (!defined(eopData.columnNames)) {
-            eop._dataError = 'Error in loaded EOP data: The columnNames property is required.';
-            return;
-        }
-
-        if (!defined(eopData.samples)) {
-            eop._dataError = 'Error in loaded EOP data: The samples property is required.';
-            return;
-        }
-
-        var dateColumn = eopData.columnNames.indexOf('modifiedJulianDateUtc');
-        var xPoleWanderRadiansColumn = eopData.columnNames.indexOf('xPoleWanderRadians');
-        var yPoleWanderRadiansColumn = eopData.columnNames.indexOf('yPoleWanderRadians');
-        var ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf('ut1MinusUtcSeconds');
-        var xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf('xCelestialPoleOffsetRadians');
-        var yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf('yCelestialPoleOffsetRadians');
-        var taiMinusUtcSecondsColumn = eopData.columnNames.indexOf('taiMinusUtcSeconds');
-
-        if (dateColumn < 0 || xPoleWanderRadiansColumn < 0 || yPoleWanderRadiansColumn < 0 || ut1MinusUtcSecondsColumn < 0 || xCelestialPoleOffsetRadiansColumn < 0 || yCelestialPoleOffsetRadiansColumn < 0 || taiMinusUtcSecondsColumn < 0) {
-            eop._dataError = 'Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns';
-            return;
-        }
-
-        var samples = eop._samples = eopData.samples;
-        var dates = eop._dates = [];
-
-        eop._dateColumn = dateColumn;
-        eop._xPoleWanderRadiansColumn = xPoleWanderRadiansColumn;
-        eop._yPoleWanderRadiansColumn = yPoleWanderRadiansColumn;
-        eop._ut1MinusUtcSecondsColumn = ut1MinusUtcSecondsColumn;
-        eop._xCelestialPoleOffsetRadiansColumn = xCelestialPoleOffsetRadiansColumn;
-        eop._yCelestialPoleOffsetRadiansColumn = yCelestialPoleOffsetRadiansColumn;
-        eop._taiMinusUtcSecondsColumn = taiMinusUtcSecondsColumn;
-
-        eop._columnCount = eopData.columnNames.length;
-        eop._lastIndex = undefined;
-
-        var lastTaiMinusUtc;
-
-        var addNewLeapSeconds = eop._addNewLeapSeconds;
-
-        // Convert the ISO8601 dates to JulianDates.
-        for (var i = 0, len = samples.length; i < len; i += eop._columnCount) {
-            var mjd = samples[i + dateColumn];
-            var taiMinusUtc = samples[i + taiMinusUtcSecondsColumn];
-            var day = mjd + TimeConstants.MODIFIED_JULIAN_DATE_DIFFERENCE;
-            var date = new JulianDate(day, taiMinusUtc, TimeStandard.TAI);
-            dates.push(date);
-
-            if (addNewLeapSeconds) {
-                if (taiMinusUtc !== lastTaiMinusUtc && defined(lastTaiMinusUtc)) {
-                    // We crossed a leap second boundary, so add the leap second
-                    // if it does not already exist.
-                    var leapSeconds = JulianDate.leapSeconds;
-                    var leapSecondIndex = binarySearch(leapSeconds, date, compareLeapSecondDates);
-                    if (leapSecondIndex < 0) {
-                        var leapSecond = new LeapSecond(date, taiMinusUtc);
-                        leapSeconds.splice(~leapSecondIndex, 0, leapSecond);
-                    }
-                }
-                lastTaiMinusUtc = taiMinusUtc;
-            }
-        }
-    }
-
-    function fillResultFromIndex(eop, samples, index, columnCount, result) {
-        var start = index * columnCount;
-        result.xPoleWander = samples[start + eop._xPoleWanderRadiansColumn];
-        result.yPoleWander = samples[start + eop._yPoleWanderRadiansColumn];
-        result.xPoleOffset = samples[start + eop._xCelestialPoleOffsetRadiansColumn];
-        result.yPoleOffset = samples[start + eop._yCelestialPoleOffsetRadiansColumn];
-        result.ut1MinusUtc = samples[start + eop._ut1MinusUtcSecondsColumn];
-    }
-
-    function linearInterp(dx, y1, y2) {
-        return y1 + dx * (y2 - y1);
-    }
-
-    function interpolate(eop, dates, samples, date, before, after, result) {
-        var columnCount = eop._columnCount;
-
-        // First check the bounds on the EOP data
-        // If we are after the bounds of the data, return zeros.
-        // The 'before' index should never be less than zero.
-        if (after > dates.length - 1) {
-            result.xPoleWander = 0;
-            result.yPoleWander = 0;
-            result.xPoleOffset = 0;
-            result.yPoleOffset = 0;
-            result.ut1MinusUtc = 0;
-            return result;
-        }
-
-        var beforeDate = dates[before];
-        var afterDate = dates[after];
-        if (beforeDate.equals(afterDate) || date.equals(beforeDate)) {
-            fillResultFromIndex(eop, samples, before, columnCount, result);
-            return result;
-        } else if (date.equals(afterDate)) {
-            fillResultFromIndex(eop, samples, after, columnCount, result);
-            return result;
-        }
-
-        var factor = JulianDate.secondsDifference(date, beforeDate) / JulianDate.secondsDifference(afterDate, beforeDate);
-
-        var startBefore = before * columnCount;
-        var startAfter = after * columnCount;
-
-        // Handle UT1 leap second edge case
-        var beforeUt1MinusUtc = samples[startBefore + eop._ut1MinusUtcSecondsColumn];
-        var afterUt1MinusUtc = samples[startAfter + eop._ut1MinusUtcSecondsColumn];
-
-        var offsetDifference = afterUt1MinusUtc - beforeUt1MinusUtc;
-        if (offsetDifference > 0.5 || offsetDifference < -0.5) {
-            // The absolute difference between the values is more than 0.5, so we may have
-            // crossed a leap second.  Check if this is the case and, if so, adjust the
-            // afterValue to account for the leap second.  This way, our interpolation will
-            // produce reasonable results.
-            var beforeTaiMinusUtc = samples[startBefore + eop._taiMinusUtcSecondsColumn];
-            var afterTaiMinusUtc = samples[startAfter + eop._taiMinusUtcSecondsColumn];
-            if (beforeTaiMinusUtc !== afterTaiMinusUtc) {
-                if (afterDate.equals(date)) {
-                    // If we are at the end of the leap second interval, take the second value
-                    // Otherwise, the interpolation below will yield the wrong side of the
-                    // discontinuity
-                    // At the end of the leap second, we need to start accounting for the jump
-                    beforeUt1MinusUtc = afterUt1MinusUtc;
-                } else {
-                    // Otherwise, remove the leap second so that the interpolation is correct
-                    afterUt1MinusUtc -= afterTaiMinusUtc - beforeTaiMinusUtc;
-                }
-            }
-        }
-
-        result.xPoleWander = linearInterp(factor, samples[startBefore + eop._xPoleWanderRadiansColumn], samples[startAfter + eop._xPoleWanderRadiansColumn]);
-        result.yPoleWander = linearInterp(factor, samples[startBefore + eop._yPoleWanderRadiansColumn], samples[startAfter + eop._yPoleWanderRadiansColumn]);
-        result.xPoleOffset = linearInterp(factor, samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn], samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn]);
-        result.yPoleOffset = linearInterp(factor, samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn], samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn]);
-        result.ut1MinusUtc = linearInterp(factor, beforeUt1MinusUtc, afterUt1MinusUtc);
-        return result;
-    }
-export default EarthOrientationParameters;

+ 0 - 47
Source/Core/EarthOrientationParametersSample.js

@@ -1,47 +0,0 @@
-
-    /**
-     * A set of Earth Orientation Parameters (EOP) sampled at a time.
-     *
-     * @alias EarthOrientationParametersSample
-     * @constructor
-     *
-     * @param {Number} xPoleWander The pole wander about the X axis, in radians.
-     * @param {Number} yPoleWander The pole wander about the Y axis, in radians.
-     * @param {Number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.
-     * @param {Number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.
-     * @param {Number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.
-     *
-     * @private
-     */
-    function EarthOrientationParametersSample(xPoleWander, yPoleWander, xPoleOffset, yPoleOffset, ut1MinusUtc) {
-        /**
-         * The pole wander about the X axis, in radians.
-         * @type {Number}
-         */
-        this.xPoleWander = xPoleWander;
-
-        /**
-         * The pole wander about the Y axis, in radians.
-         * @type {Number}
-         */
-        this.yPoleWander = yPoleWander;
-
-        /**
-         * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.
-         * @type {Number}
-         */
-        this.xPoleOffset = xPoleOffset;
-
-        /**
-         * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.
-         * @type {Number}
-         */
-        this.yPoleOffset = yPoleOffset;
-
-        /**
-         * The difference in time standards, UT1 - UTC, in seconds.
-         * @type {Number}
-         */
-        this.ut1MinusUtc = ut1MinusUtc;
-    }
-export default EarthOrientationParametersSample;

+ 0 - 257
Source/Core/EasingFunction.js

@@ -1,257 +0,0 @@
-import Tween from '../ThirdParty/Tween.js';
-import freezeObject from './freezeObject.js';
-
-    /**
-     * Easing functions for use with TweenCollection.  These function are from
-     * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner.  See the
-     * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}.
-     *
-     * @exports EasingFunction
-     */
-    var EasingFunction = {
-        /**
-         * Linear easing.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        LINEAR_NONE : Tween.Easing.Linear.None,
-
-        /**
-         * Quadratic in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUADRACTIC_IN : Tween.Easing.Quadratic.In,
-        /**
-         * Quadratic out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUADRACTIC_OUT : Tween.Easing.Quadratic.Out,
-        /**
-         * Quadratic in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUADRACTIC_IN_OUT : Tween.Easing.Quadratic.InOut,
-
-        /**
-         * Cubic in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        CUBIC_IN : Tween.Easing.Cubic.In,
-        /**
-         * Cubic out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        CUBIC_OUT : Tween.Easing.Cubic.Out,
-        /**
-         * Cubic in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        CUBIC_IN_OUT : Tween.Easing.Cubic.InOut,
-
-        /**
-         * Quartic in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUARTIC_IN : Tween.Easing.Quartic.In,
-        /**
-         * Quartic out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUARTIC_OUT : Tween.Easing.Quartic.Out,
-        /**
-         * Quartic in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUARTIC_IN_OUT : Tween.Easing.Quartic.InOut,
-
-        /**
-         * Quintic in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUINTIC_IN : Tween.Easing.Quintic.In,
-        /**
-         * Quintic out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUINTIC_OUT : Tween.Easing.Quintic.Out,
-        /**
-         * Quintic in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        QUINTIC_IN_OUT : Tween.Easing.Quintic.InOut,
-
-        /**
-         * Sinusoidal in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        SINUSOIDAL_IN : Tween.Easing.Sinusoidal.In,
-        /**
-         * Sinusoidal out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        SINUSOIDAL_OUT : Tween.Easing.Sinusoidal.Out,
-        /**
-         * Sinusoidal in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        SINUSOIDAL_IN_OUT : Tween.Easing.Sinusoidal.InOut,
-
-        /**
-         * Exponential in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        EXPONENTIAL_IN : Tween.Easing.Exponential.In,
-        /**
-         * Exponential out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        EXPONENTIAL_OUT : Tween.Easing.Exponential.Out,
-        /**
-         * Exponential in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        EXPONENTIAL_IN_OUT : Tween.Easing.Exponential.InOut,
-
-        /**
-         * Circular in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        CIRCULAR_IN : Tween.Easing.Circular.In,
-        /**
-         * Circular out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        CIRCULAR_OUT : Tween.Easing.Circular.Out,
-        /**
-         * Circular in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        CIRCULAR_IN_OUT : Tween.Easing.Circular.InOut,
-
-        /**
-         * Elastic in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        ELASTIC_IN : Tween.Easing.Elastic.In,
-        /**
-         * Elastic out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        ELASTIC_OUT : Tween.Easing.Elastic.Out,
-        /**
-         * Elastic in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        ELASTIC_IN_OUT : Tween.Easing.Elastic.InOut,
-
-        /**
-         * Back in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        BACK_IN : Tween.Easing.Back.In,
-        /**
-         * Back out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        BACK_OUT : Tween.Easing.Back.Out,
-        /**
-         * Back in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        BACK_IN_OUT : Tween.Easing.Back.InOut,
-
-        /**
-         * Bounce in.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        BOUNCE_IN : Tween.Easing.Bounce.In,
-        /**
-         * Bounce out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        BOUNCE_OUT : Tween.Easing.Bounce.Out,
-        /**
-         * Bounce in then out.
-         *
-         * @type {EasingFunction~Callback}
-         * @constant
-         */
-        BOUNCE_IN_OUT : Tween.Easing.Bounce.InOut
-    };
-
-    /**
-     * Function interface for implementing a custom easing function.
-     * @callback EasingFunction~Callback
-     * @param {Number} time The time in the range <code>[0, 1]</code>.
-     * @returns {Number} The value of the function at the given time.
-     *
-     * @example
-     * function quadraticIn(time) {
-     *     return time * time;
-     * }
-     *
-     * @example
-     * function quadraticOut(time) {
-     *     return time * (2.0 - time);
-     * }
-     */
-export default freezeObject(EasingFunction);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1074
Source/Core/EllipseGeometry.js


+ 0 - 263
Source/Core/EllipseGeometryLibrary.js

@@ -1,263 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import CesiumMath from './Math.js';
-import Matrix3 from './Matrix3.js';
-import Quaternion from './Quaternion.js';
-
-    var EllipseGeometryLibrary = {};
-
-    var rotAxis = new Cartesian3();
-    var tempVec = new Cartesian3();
-    var unitQuat = new Quaternion();
-    var rotMtx = new Matrix3();
-
-    function pointOnEllipsoid(theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, result) {
-        var azimuth = theta + rotation;
-
-        Cartesian3.multiplyByScalar(eastVec, Math.cos(azimuth), rotAxis);
-        Cartesian3.multiplyByScalar(northVec, Math.sin(azimuth), tempVec);
-        Cartesian3.add(rotAxis, tempVec, rotAxis);
-
-        var cosThetaSquared = Math.cos(theta);
-        cosThetaSquared = cosThetaSquared * cosThetaSquared;
-
-        var sinThetaSquared = Math.sin(theta);
-        sinThetaSquared = sinThetaSquared * sinThetaSquared;
-
-        var radius = ab / Math.sqrt(bSqr * cosThetaSquared + aSqr * sinThetaSquared);
-        var angle = radius / mag;
-
-        // Create the quaternion to rotate the position vector to the boundary of the ellipse.
-        Quaternion.fromAxisAngle(rotAxis, angle, unitQuat);
-        Matrix3.fromQuaternion(unitQuat, rotMtx);
-
-        Matrix3.multiplyByVector(rotMtx, unitPos, result);
-        Cartesian3.normalize(result, result);
-        Cartesian3.multiplyByScalar(result, mag, result);
-        return result;
-    }
-
-    var scratchCartesian1 = new Cartesian3();
-    var scratchCartesian2 = new Cartesian3();
-    var scratchCartesian3 = new Cartesian3();
-    var scratchNormal = new Cartesian3();
-    /**
-     * Returns the positions raised to the given heights
-     * @private
-     */
-    EllipseGeometryLibrary.raisePositionsToHeight = function(positions, options, extrude) {
-        var ellipsoid = options.ellipsoid;
-        var height = options.height;
-        var extrudedHeight = options.extrudedHeight;
-        var size = (extrude) ? positions.length / 3 * 2 : positions.length / 3;
-
-        var finalPositions = new Float64Array(size * 3);
-
-        var length = positions.length;
-        var bottomOffset = (extrude) ? length : 0;
-        for (var i = 0; i < length; i += 3) {
-            var i1 = i + 1;
-            var i2 = i + 2;
-
-            var position = Cartesian3.fromArray(positions, i, scratchCartesian1);
-            ellipsoid.scaleToGeodeticSurface(position, position);
-
-            var extrudedPosition = Cartesian3.clone(position, scratchCartesian2);
-            var normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
-            var scaledNormal = Cartesian3.multiplyByScalar(normal, height, scratchCartesian3);
-            Cartesian3.add(position, scaledNormal, position);
-
-            if (extrude) {
-                Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal);
-                Cartesian3.add(extrudedPosition, scaledNormal, extrudedPosition);
-
-                finalPositions[i + bottomOffset] = extrudedPosition.x;
-                finalPositions[i1 + bottomOffset] = extrudedPosition.y;
-                finalPositions[i2 + bottomOffset] = extrudedPosition.z;
-            }
-
-            finalPositions[i] = position.x;
-            finalPositions[i1] = position.y;
-            finalPositions[i2] = position.z;
-        }
-
-        return finalPositions;
-    };
-
-    var unitPosScratch = new Cartesian3();
-    var eastVecScratch = new Cartesian3();
-    var northVecScratch = new Cartesian3();
-    /**
-     * Returns an array of positions that make up the ellipse.
-     * @private
-     */
-    EllipseGeometryLibrary.computeEllipsePositions = function(options, addFillPositions, addEdgePositions) {
-        var semiMinorAxis = options.semiMinorAxis;
-        var semiMajorAxis = options.semiMajorAxis;
-        var rotation = options.rotation;
-        var center = options.center;
-
-        // Computing the arc-length of the ellipse is too expensive to be practical. Estimating it using the
-        // arc length of the sphere is too inaccurate and creates sharp edges when either the semi-major or
-        // semi-minor axis is much bigger than the other. Instead, scale the angle delta to make
-        // the distance along the ellipse boundary more closely match the granularity.
-        var granularity = options.granularity * 8.0;
-
-        var aSqr = semiMinorAxis * semiMinorAxis;
-        var bSqr = semiMajorAxis * semiMajorAxis;
-        var ab = semiMajorAxis * semiMinorAxis;
-
-        var mag = Cartesian3.magnitude(center);
-
-        var unitPos = Cartesian3.normalize(center, unitPosScratch);
-        var eastVec = Cartesian3.cross(Cartesian3.UNIT_Z, center, eastVecScratch);
-        eastVec = Cartesian3.normalize(eastVec, eastVec);
-        var northVec = Cartesian3.cross(unitPos, eastVec, northVecScratch);
-
-        // The number of points in the first quadrant
-        var numPts = 1 + Math.ceil(CesiumMath.PI_OVER_TWO / granularity);
-
-        var deltaTheta = CesiumMath.PI_OVER_TWO / (numPts - 1);
-        var theta = CesiumMath.PI_OVER_TWO - numPts * deltaTheta;
-        if (theta < 0.0) {
-            numPts -= Math.ceil(Math.abs(theta) / deltaTheta);
-        }
-
-        // If the number of points were three, the ellipse
-        // would be tessellated like below:
-        //
-        //         *---*
-        //       / | \ | \
-        //     *---*---*---*
-        //   / | \ | \ | \ | \
-        //  / .*---*---*---*. \
-        // * ` | \ | \ | \ | `*
-        //  \`.*---*---*---*.`/
-        //   \ | \ | \ | \ | /
-        //     *---*---*---*
-        //       \ | \ | /
-        //         *---*
-        // The first and last column have one position and fan to connect to the adjacent column.
-        // Each other vertical column contains an even number of positions.
-        var size = 2 * (numPts * (numPts + 2));
-        var positions = (addFillPositions) ? new Array(size * 3) : undefined;
-        var positionIndex = 0;
-        var position = scratchCartesian1;
-        var reflectedPosition = scratchCartesian2;
-
-        var outerPositionsLength = (numPts * 4) * 3;
-        var outerRightIndex = outerPositionsLength - 1;
-        var outerLeftIndex = 0;
-        var outerPositions = (addEdgePositions) ? new Array(outerPositionsLength) : undefined;
-
-        var i;
-        var j;
-        var numInterior;
-        var t;
-        var interiorPosition;
-
-        // Compute points in the 'eastern' half of the ellipse
-        theta = CesiumMath.PI_OVER_TWO;
-        position = pointOnEllipsoid(theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, position);
-        if (addFillPositions) {
-            positions[positionIndex++] = position.x;
-            positions[positionIndex++] = position.y;
-            positions[positionIndex++] = position.z;
-        }
-        if (addEdgePositions) {
-            outerPositions[outerRightIndex--] = position.z;
-            outerPositions[outerRightIndex--] = position.y;
-            outerPositions[outerRightIndex--] = position.x;
-        }
-        theta = CesiumMath.PI_OVER_TWO -  deltaTheta;
-        for (i = 1; i < numPts + 1; ++i) {
-            position = pointOnEllipsoid(theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, position);
-            reflectedPosition = pointOnEllipsoid(Math.PI - theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, reflectedPosition);
-
-            if (addFillPositions) {
-                positions[positionIndex++] = position.x;
-                positions[positionIndex++] = position.y;
-                positions[positionIndex++] = position.z;
-
-                numInterior = 2 * i + 2;
-                for (j = 1; j < numInterior - 1; ++j) {
-                    t = j / (numInterior - 1);
-                    interiorPosition = Cartesian3.lerp(position, reflectedPosition, t, scratchCartesian3);
-                    positions[positionIndex++] = interiorPosition.x;
-                    positions[positionIndex++] = interiorPosition.y;
-                    positions[positionIndex++] = interiorPosition.z;
-                }
-
-                positions[positionIndex++] = reflectedPosition.x;
-                positions[positionIndex++] = reflectedPosition.y;
-                positions[positionIndex++] = reflectedPosition.z;
-            }
-
-            if (addEdgePositions) {
-                outerPositions[outerRightIndex--] = position.z;
-                outerPositions[outerRightIndex--] = position.y;
-                outerPositions[outerRightIndex--] = position.x;
-                outerPositions[outerLeftIndex++] = reflectedPosition.x;
-                outerPositions[outerLeftIndex++] = reflectedPosition.y;
-                outerPositions[outerLeftIndex++] = reflectedPosition.z;
-            }
-
-            theta = CesiumMath.PI_OVER_TWO - (i + 1) * deltaTheta;
-        }
-
-        // Compute points in the 'western' half of the ellipse
-        for (i = numPts; i > 1; --i) {
-            theta = CesiumMath.PI_OVER_TWO - (i - 1) * deltaTheta;
-
-            position = pointOnEllipsoid(-theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, position);
-            reflectedPosition = pointOnEllipsoid(theta + Math.PI, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, reflectedPosition);
-
-            if (addFillPositions) {
-                positions[positionIndex++] = position.x;
-                positions[positionIndex++] = position.y;
-                positions[positionIndex++] = position.z;
-
-                numInterior = 2 * (i - 1) + 2;
-                for (j = 1; j < numInterior - 1; ++j) {
-                    t = j / (numInterior - 1);
-                    interiorPosition = Cartesian3.lerp(position, reflectedPosition, t, scratchCartesian3);
-                    positions[positionIndex++] = interiorPosition.x;
-                    positions[positionIndex++] = interiorPosition.y;
-                    positions[positionIndex++] = interiorPosition.z;
-                }
-
-                positions[positionIndex++] = reflectedPosition.x;
-                positions[positionIndex++] = reflectedPosition.y;
-                positions[positionIndex++] = reflectedPosition.z;
-            }
-
-            if (addEdgePositions) {
-                outerPositions[outerRightIndex--] = position.z;
-                outerPositions[outerRightIndex--] = position.y;
-                outerPositions[outerRightIndex--] = position.x;
-                outerPositions[outerLeftIndex++] = reflectedPosition.x;
-                outerPositions[outerLeftIndex++] = reflectedPosition.y;
-                outerPositions[outerLeftIndex++] = reflectedPosition.z;
-            }
-        }
-
-        theta = CesiumMath.PI_OVER_TWO;
-        position = pointOnEllipsoid(-theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, position);
-
-        var r = {};
-        if (addFillPositions) {
-            positions[positionIndex++] = position.x;
-            positions[positionIndex++] = position.y;
-            positions[positionIndex++] = position.z;
-            r.positions = positions;
-            r.numPts = numPts;
-        }
-        if (addEdgePositions) {
-            outerPositions[outerRightIndex--] = position.z;
-            outerPositions[outerRightIndex--] = position.y;
-            outerPositions[outerRightIndex--] = position.x;
-            r.outerPositions = outerPositions;
-        }
-
-        return r;
-    };
-export default EllipseGeometryLibrary;

+ 0 - 377
Source/Core/EllipseOutlineGeometry.js

@@ -1,377 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import EllipseGeometryLibrary from './EllipseGeometryLibrary.js';
-import Ellipsoid from './Ellipsoid.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import IndexDatatype from './IndexDatatype.js';
-import CesiumMath from './Math.js';
-import PrimitiveType from './PrimitiveType.js';
-
-    var scratchCartesian1 = new Cartesian3();
-    var boundingSphereCenter = new Cartesian3();
-
-    function computeEllipse(options) {
-        var center = options.center;
-        boundingSphereCenter = Cartesian3.multiplyByScalar(options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter), options.height, boundingSphereCenter);
-        boundingSphereCenter = Cartesian3.add(center, boundingSphereCenter, boundingSphereCenter);
-        var boundingSphere = new BoundingSphere(boundingSphereCenter, options.semiMajorAxis);
-        var positions = EllipseGeometryLibrary.computeEllipsePositions(options, false, true).outerPositions;
-
-        var attributes = new GeometryAttributes({
-            position: new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : EllipseGeometryLibrary.raisePositionsToHeight(positions, options, false)
-            })
-        });
-
-        var length = positions.length / 3;
-        var indices = IndexDatatype.createTypedArray(length, length * 2);
-        var index = 0;
-        for ( var i = 0; i < length; ++i) {
-            indices[index++] = i;
-            indices[index++] = (i + 1) % length;
-        }
-
-        return {
-            boundingSphere : boundingSphere,
-            attributes : attributes,
-            indices : indices
-        };
-    }
-
-    var topBoundingSphere = new BoundingSphere();
-    var bottomBoundingSphere = new BoundingSphere();
-    function computeExtrudedEllipse(options) {
-        var center = options.center;
-        var ellipsoid = options.ellipsoid;
-        var semiMajorAxis = options.semiMajorAxis;
-        var scaledNormal = Cartesian3.multiplyByScalar(ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1), options.height, scratchCartesian1);
-        topBoundingSphere.center = Cartesian3.add(center, scaledNormal, topBoundingSphere.center);
-        topBoundingSphere.radius = semiMajorAxis;
-
-        scaledNormal = Cartesian3.multiplyByScalar(ellipsoid.geodeticSurfaceNormal(center, scaledNormal), options.extrudedHeight, scaledNormal);
-        bottomBoundingSphere.center = Cartesian3.add(center, scaledNormal, bottomBoundingSphere.center);
-        bottomBoundingSphere.radius = semiMajorAxis;
-
-        var positions = EllipseGeometryLibrary.computeEllipsePositions(options, false, true).outerPositions;
-        var attributes = new GeometryAttributes({
-            position: new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : EllipseGeometryLibrary.raisePositionsToHeight(positions, options, true)
-            })
-        });
-
-        positions = attributes.position.values;
-        var boundingSphere = BoundingSphere.union(topBoundingSphere, bottomBoundingSphere);
-        var length = positions.length/3;
-
-        if (defined(options.offsetAttribute)) {
-            var applyOffset = new Uint8Array(length);
-            if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {
-                applyOffset = arrayFill(applyOffset, 1, 0, length / 2);
-            } else {
-                var offsetValue = options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-                applyOffset = arrayFill(applyOffset, offsetValue);
-            }
-
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values: applyOffset
-            });
-        }
-
-        var numberOfVerticalLines = defaultValue(options.numberOfVerticalLines, 16);
-        numberOfVerticalLines = CesiumMath.clamp(numberOfVerticalLines, 0, length/2);
-
-        var indices = IndexDatatype.createTypedArray(length, length * 2 + numberOfVerticalLines * 2);
-
-        length /= 2;
-        var index = 0;
-        var i;
-        for (i = 0; i < length; ++i) {
-            indices[index++] = i;
-            indices[index++] = (i + 1) % length;
-            indices[index++] = i + length;
-            indices[index++] = ((i + 1) % length) + length;
-        }
-
-        var numSide;
-        if (numberOfVerticalLines > 0) {
-            var numSideLines = Math.min(numberOfVerticalLines, length);
-            numSide = Math.round(length / numSideLines);
-
-            var maxI = Math.min(numSide * numberOfVerticalLines, length);
-            for (i = 0; i < maxI; i += numSide) {
-                indices[index++] = i;
-                indices[index++] = i + length;
-            }
-        }
-
-        return {
-            boundingSphere : boundingSphere,
-            attributes : attributes,
-            indices : indices
-        };
-    }
-
-    /**
-     * A description of the outline of an ellipse on an ellipsoid.
-     *
-     * @alias EllipseOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.
-     * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.
-     * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.
-     * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.
-     * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.
-     * @param {Number} [options.rotation=0.0] The angle from north (counter-clockwise) in radians.
-     * @param {Number} [options.granularity=0.02] The angular distance between points on the ellipse in radians.
-     * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surface of an extruded ellipse.
-     *
-     * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.
-     * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.
-     * @exception {DeveloperError} granularity must be greater than zero.
-     *
-     * @see EllipseOutlineGeometry.createGeometry
-     *
-     * @example
-     * var ellipse = new Cesium.EllipseOutlineGeometry({
-     *   center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
-     *   semiMajorAxis : 500000.0,
-     *   semiMinorAxis : 300000.0,
-     *   rotation : Cesium.Math.toRadians(60.0)
-     * });
-     * var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
-     */
-    function EllipseOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var center = options.center;
-        var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);
-        var semiMajorAxis = options.semiMajorAxis;
-        var semiMinorAxis = options.semiMinorAxis;
-        var granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(center)) {
-            throw new DeveloperError('center is required.');
-        }
-        if (!defined(semiMajorAxis)) {
-            throw new DeveloperError('semiMajorAxis is required.');
-        }
-        if (!defined(semiMinorAxis)) {
-            throw new DeveloperError('semiMinorAxis is required.');
-        }
-        if (semiMajorAxis < semiMinorAxis) {
-            throw new DeveloperError('semiMajorAxis must be greater than or equal to the semiMinorAxis.');
-        }
-        if (granularity <= 0.0) {
-            throw new DeveloperError('granularity must be greater than zero.');
-        }
-        //>>includeEnd('debug');
-
-        var height = defaultValue(options.height, 0.0);
-        var extrudedHeight = defaultValue(options.extrudedHeight, height);
-
-        this._center = Cartesian3.clone(center);
-        this._semiMajorAxis = semiMajorAxis;
-        this._semiMinorAxis = semiMinorAxis;
-        this._ellipsoid = Ellipsoid.clone(ellipsoid);
-        this._rotation = defaultValue(options.rotation, 0.0);
-        this._height = Math.max(extrudedHeight, height);
-        this._granularity = granularity;
-        this._extrudedHeight = Math.min(extrudedHeight, height);
-        this._numberOfVerticalLines = Math.max(defaultValue(options.numberOfVerticalLines, 16), 0);
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createEllipseOutlineGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    EllipseOutlineGeometry.packedLength = Cartesian3.packedLength + Ellipsoid.packedLength + 8;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {EllipseOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    EllipseOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(value)) {
-            throw new DeveloperError('value is required');
-        }
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        Cartesian3.pack(value._center, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-
-        Ellipsoid.pack(value._ellipsoid, array, startingIndex);
-        startingIndex += Ellipsoid.packedLength;
-
-        array[startingIndex++] = value._semiMajorAxis;
-        array[startingIndex++] = value._semiMinorAxis;
-        array[startingIndex++] = value._rotation;
-        array[startingIndex++] = value._height;
-        array[startingIndex++] = value._granularity;
-        array[startingIndex++] = value._extrudedHeight;
-        array[startingIndex++]   = value._numberOfVerticalLines;
-        array[startingIndex] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchCenter = new Cartesian3();
-    var scratchEllipsoid = new Ellipsoid();
-    var scratchOptions = {
-        center : scratchCenter,
-        ellipsoid : scratchEllipsoid,
-        semiMajorAxis : undefined,
-        semiMinorAxis : undefined,
-        rotation : undefined,
-        height : undefined,
-        granularity : undefined,
-        extrudedHeight : undefined,
-        numberOfVerticalLines : undefined,
-        offsetAttribute: undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {EllipseOutlineGeometry} [result] The object into which to store the result.
-     * @returns {EllipseOutlineGeometry} The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
-     */
-    EllipseOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var center = Cartesian3.unpack(array, startingIndex, scratchCenter);
-        startingIndex += Cartesian3.packedLength;
-
-        var ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
-        startingIndex += Ellipsoid.packedLength;
-
-        var semiMajorAxis = array[startingIndex++];
-        var semiMinorAxis = array[startingIndex++];
-        var rotation = array[startingIndex++];
-        var height = array[startingIndex++];
-        var granularity = array[startingIndex++];
-        var extrudedHeight = array[startingIndex++];
-        var numberOfVerticalLines = array[startingIndex++];
-        var offsetAttribute = array[startingIndex];
-
-        if (!defined(result)) {
-            scratchOptions.height = height;
-            scratchOptions.extrudedHeight = extrudedHeight;
-            scratchOptions.granularity = granularity;
-            scratchOptions.rotation = rotation;
-            scratchOptions.semiMajorAxis = semiMajorAxis;
-            scratchOptions.semiMinorAxis = semiMinorAxis;
-            scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-            return new EllipseOutlineGeometry(scratchOptions);
-        }
-
-        result._center = Cartesian3.clone(center, result._center);
-        result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);
-        result._semiMajorAxis = semiMajorAxis;
-        result._semiMinorAxis = semiMinorAxis;
-        result._rotation = rotation;
-        result._height = height;
-        result._granularity = granularity;
-        result._extrudedHeight = extrudedHeight;
-        result._numberOfVerticalLines = numberOfVerticalLines;
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {EllipseOutlineGeometry} ellipseGeometry A description of the ellipse.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    EllipseOutlineGeometry.createGeometry = function(ellipseGeometry) {
-        if ((ellipseGeometry._semiMajorAxis <= 0.0) || (ellipseGeometry._semiMinorAxis <= 0.0)) {
-            return;
-        }
-
-        var height = ellipseGeometry._height;
-        var extrudedHeight = ellipseGeometry._extrudedHeight;
-        var extrude = !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);
-
-        ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(ellipseGeometry._center, ellipseGeometry._center);
-        var options = {
-            center : ellipseGeometry._center,
-            semiMajorAxis : ellipseGeometry._semiMajorAxis,
-            semiMinorAxis : ellipseGeometry._semiMinorAxis,
-            ellipsoid : ellipseGeometry._ellipsoid,
-            rotation : ellipseGeometry._rotation,
-            height : height,
-            granularity : ellipseGeometry._granularity,
-            numberOfVerticalLines : ellipseGeometry._numberOfVerticalLines
-        };
-        var geometry;
-        if (extrude) {
-            options.extrudedHeight = extrudedHeight;
-            options.offsetAttribute = ellipseGeometry._offsetAttribute;
-            geometry = computeExtrudedEllipse(options);
-        } else {
-            geometry = computeEllipse(options);
-
-            if (defined(ellipseGeometry._offsetAttribute)) {
-                var length = geometry.attributes.position.values.length;
-                var applyOffset = new Uint8Array(length / 3);
-                var offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-                arrayFill(applyOffset, offsetValue);
-                geometry.attributes.applyOffset = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                    componentsPerAttribute : 1,
-                    values: applyOffset
-                });
-            }
-        }
-
-        return new Geometry({
-            attributes : geometry.attributes,
-            indices : geometry.indices,
-            primitiveType : PrimitiveType.LINES,
-            boundingSphere : geometry.boundingSphere,
-            offsetAttribute : ellipseGeometry._offsetAttribute
-        });
-    };
-export default EllipseOutlineGeometry;

+ 0 - 637
Source/Core/Ellipsoid.js

@@ -1,637 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Cartographic from './Cartographic.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import freezeObject from './freezeObject.js';
-import CesiumMath from './Math.js';
-import scaleToGeodeticSurface from './scaleToGeodeticSurface.js';
-
-    function initialize(ellipsoid, x, y, z) {
-        x = defaultValue(x, 0.0);
-        y = defaultValue(y, 0.0);
-        z = defaultValue(z, 0.0);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number.greaterThanOrEquals('x', x, 0.0);
-        Check.typeOf.number.greaterThanOrEquals('y', y, 0.0);
-        Check.typeOf.number.greaterThanOrEquals('z', z, 0.0);
-        //>>includeEnd('debug');
-
-        ellipsoid._radii = new Cartesian3(x, y, z);
-
-        ellipsoid._radiiSquared = new Cartesian3(x * x,
-                                            y * y,
-                                            z * z);
-
-        ellipsoid._radiiToTheFourth = new Cartesian3(x * x * x * x,
-                                                y * y * y * y,
-                                                z * z * z * z);
-
-        ellipsoid._oneOverRadii = new Cartesian3(x === 0.0 ? 0.0 : 1.0 / x,
-                                            y === 0.0 ? 0.0 : 1.0 / y,
-                                            z === 0.0 ? 0.0 : 1.0 / z);
-
-        ellipsoid._oneOverRadiiSquared = new Cartesian3(x === 0.0 ? 0.0 : 1.0 / (x * x),
-                                                   y === 0.0 ? 0.0 : 1.0 / (y * y),
-                                                   z === 0.0 ? 0.0 : 1.0 / (z * z));
-
-        ellipsoid._minimumRadius = Math.min(x, y, z);
-
-        ellipsoid._maximumRadius = Math.max(x, y, z);
-
-        ellipsoid._centerToleranceSquared = CesiumMath.EPSILON1;
-
-        if (ellipsoid._radiiSquared.z !== 0) {
-            ellipsoid._squaredXOverSquaredZ = ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;
-        }
-    }
-
-    /**
-     * A quadratic surface defined in Cartesian coordinates by the equation
-     * <code>(x / a)^2 + (y / b)^2 + (z / c)^2 = 1</code>.  Primarily used
-     * by Cesium to represent the shape of planetary bodies.
-     *
-     * Rather than constructing this object directly, one of the provided
-     * constants is normally used.
-     * @alias Ellipsoid
-     * @constructor
-     *
-     * @param {Number} [x=0] The radius in the x direction.
-     * @param {Number} [y=0] The radius in the y direction.
-     * @param {Number} [z=0] The radius in the z direction.
-     *
-     * @exception {DeveloperError} All radii components must be greater than or equal to zero.
-     *
-     * @see Ellipsoid.fromCartesian3
-     * @see Ellipsoid.WGS84
-     * @see Ellipsoid.UNIT_SPHERE
-     */
-    function Ellipsoid(x, y, z) {
-        this._radii = undefined;
-        this._radiiSquared = undefined;
-        this._radiiToTheFourth = undefined;
-        this._oneOverRadii = undefined;
-        this._oneOverRadiiSquared = undefined;
-        this._minimumRadius = undefined;
-        this._maximumRadius = undefined;
-        this._centerToleranceSquared = undefined;
-        this._squaredXOverSquaredZ = undefined;
-
-        initialize(this, x, y, z);
-    }
-
-    defineProperties(Ellipsoid.prototype, {
-        /**
-         * Gets the radii of the ellipsoid.
-         * @memberof Ellipsoid.prototype
-         * @type {Cartesian3}
-         * @readonly
-         */
-        radii : {
-            get: function() {
-                return this._radii;
-            }
-        },
-        /**
-         * Gets the squared radii of the ellipsoid.
-         * @memberof Ellipsoid.prototype
-         * @type {Cartesian3}
-         * @readonly
-         */
-        radiiSquared : {
-            get : function() {
-                return this._radiiSquared;
-            }
-        },
-        /**
-         * Gets the radii of the ellipsoid raise to the fourth power.
-         * @memberof Ellipsoid.prototype
-         * @type {Cartesian3}
-         * @readonly
-         */
-        radiiToTheFourth : {
-            get : function() {
-                return this._radiiToTheFourth;
-            }
-        },
-        /**
-         * Gets one over the radii of the ellipsoid.
-         * @memberof Ellipsoid.prototype
-         * @type {Cartesian3}
-         * @readonly
-         */
-        oneOverRadii : {
-            get : function() {
-                return this._oneOverRadii;
-            }
-        },
-        /**
-         * Gets one over the squared radii of the ellipsoid.
-         * @memberof Ellipsoid.prototype
-         * @type {Cartesian3}
-         * @readonly
-         */
-        oneOverRadiiSquared : {
-            get : function() {
-                return this._oneOverRadiiSquared;
-            }
-        },
-        /**
-         * Gets the minimum radius of the ellipsoid.
-         * @memberof Ellipsoid.prototype
-         * @type {Number}
-         * @readonly
-         */
-        minimumRadius : {
-            get : function() {
-                return this._minimumRadius;
-            }
-        },
-        /**
-         * Gets the maximum radius of the ellipsoid.
-         * @memberof Ellipsoid.prototype
-         * @type {Number}
-         * @readonly
-         */
-        maximumRadius : {
-            get : function() {
-                return this._maximumRadius;
-            }
-        }
-    });
-
-    /**
-     * Duplicates an Ellipsoid instance.
-     *
-     * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.
-     * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
-     *                    instance should be created.
-     * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
-     */
-    Ellipsoid.clone = function(ellipsoid, result) {
-        if (!defined(ellipsoid)) {
-            return undefined;
-        }
-        var radii = ellipsoid._radii;
-
-        if (!defined(result)) {
-            return new Ellipsoid(radii.x, radii.y, radii.z);
-        }
-
-        Cartesian3.clone(radii, result._radii);
-        Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);
-        Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
-        Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
-        Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);
-        result._minimumRadius = ellipsoid._minimumRadius;
-        result._maximumRadius = ellipsoid._maximumRadius;
-        result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
-
-        return result;
-    };
-
-    /**
-     * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
-     *
-     * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.
-     * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
-     *                    instance should be created.
-     * @returns {Ellipsoid} A new Ellipsoid instance.
-     *
-     * @exception {DeveloperError} All radii components must be greater than or equal to zero.
-     *
-     * @see Ellipsoid.WGS84
-     * @see Ellipsoid.UNIT_SPHERE
-     */
-    Ellipsoid.fromCartesian3 = function(cartesian, result) {
-        if (!defined(result)) {
-            result = new Ellipsoid();
-        }
-
-        if (!defined(cartesian)) {
-            return result;
-        }
-
-        initialize(result, cartesian.x, cartesian.y, cartesian.z);
-        return result;
-    };
-
-    /**
-     * An Ellipsoid instance initialized to the WGS84 standard.
-     *
-     * @type {Ellipsoid}
-     * @constant
-     */
-    Ellipsoid.WGS84 = freezeObject(new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793));
-
-    /**
-     * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
-     *
-     * @type {Ellipsoid}
-     * @constant
-     */
-    Ellipsoid.UNIT_SPHERE = freezeObject(new Ellipsoid(1.0, 1.0, 1.0));
-
-    /**
-     * An Ellipsoid instance initialized to a sphere with the lunar radius.
-     *
-     * @type {Ellipsoid}
-     * @constant
-     */
-    Ellipsoid.MOON = freezeObject(new Ellipsoid(CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS, CesiumMath.LUNAR_RADIUS));
-
-    /**
-     * Duplicates an Ellipsoid instance.
-     *
-     * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
-     *                    instance should be created.
-     * @returns {Ellipsoid} The cloned Ellipsoid.
-     */
-    Ellipsoid.prototype.clone = function(result) {
-        return Ellipsoid.clone(this, result);
-    };
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    Ellipsoid.packedLength = Cartesian3.packedLength;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {Ellipsoid} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    Ellipsoid.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        Cartesian3.pack(value._radii, array, startingIndex);
-
-        return array;
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {Ellipsoid} [result] The object into which to store the result.
-     * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.
-     */
-    Ellipsoid.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var radii = Cartesian3.unpack(array, startingIndex);
-        return Ellipsoid.fromCartesian3(radii, result);
-    };
-
-    /**
-     * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
-     * @function
-     *
-     * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
-     */
-    Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;
-
-    /**
-     * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
-     *
-     * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
-     */
-    Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function(cartographic, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartographic', cartographic);
-        //>>includeEnd('debug');
-
-        var longitude = cartographic.longitude;
-        var latitude = cartographic.latitude;
-        var cosLatitude = Math.cos(latitude);
-
-        var x = cosLatitude * Math.cos(longitude);
-        var y = cosLatitude * Math.sin(longitude);
-        var z = Math.sin(latitude);
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-        result.x = x;
-        result.y = y;
-        result.z = z;
-        return Cartesian3.normalize(result, result);
-    };
-
-    /**
-     * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
-     *
-     * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
-     */
-    Ellipsoid.prototype.geodeticSurfaceNormal = function(cartesian, result) {
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-        result = Cartesian3.multiplyComponents(cartesian, this._oneOverRadiiSquared, result);
-        return Cartesian3.normalize(result, result);
-    };
-
-    var cartographicToCartesianNormal = new Cartesian3();
-    var cartographicToCartesianK = new Cartesian3();
-
-    /**
-     * Converts the provided cartographic to Cartesian representation.
-     *
-     * @param {Cartographic} cartographic The cartographic position.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
-     *
-     * @example
-     * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
-     * var position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
-     * var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
-     */
-    Ellipsoid.prototype.cartographicToCartesian = function(cartographic, result) {
-        //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.
-        var n = cartographicToCartesianNormal;
-        var k = cartographicToCartesianK;
-        this.geodeticSurfaceNormalCartographic(cartographic, n);
-        Cartesian3.multiplyComponents(this._radiiSquared, n, k);
-        var gamma = Math.sqrt(Cartesian3.dot(n, k));
-        Cartesian3.divideByScalar(k, gamma, k);
-        Cartesian3.multiplyByScalar(n, cartographic.height, n);
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-        return Cartesian3.add(k, n, result);
-    };
-
-    /**
-     * Converts the provided array of cartographics to an array of Cartesians.
-     *
-     * @param {Cartographic[]} cartographics An array of cartographic positions.
-     * @param {Cartesian3[]} [result] The object onto which to store the result.
-     * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.
-     *
-     * @example
-     * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
-     * var positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
-     *                  new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
-     *                  new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
-     * var cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
-     */
-    Ellipsoid.prototype.cartographicArrayToCartesianArray = function(cartographics, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartographics', cartographics);
-        //>>includeEnd('debug')
-
-        var length = cartographics.length;
-        if (!defined(result)) {
-            result = new Array(length);
-        } else {
-            result.length = length;
-        }
-        for ( var i = 0; i < length; i++) {
-            result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
-        }
-        return result;
-    };
-
-    var cartesianToCartographicN = new Cartesian3();
-    var cartesianToCartographicP = new Cartesian3();
-    var cartesianToCartographicH = new Cartesian3();
-
-    /**
-     * Converts the provided cartesian to cartographic representation.
-     * The cartesian is undefined at the center of the ellipsoid.
-     *
-     * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
-     * @param {Cartographic} [result] The object onto which to store the result.
-     * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
-     *
-     * @example
-     * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
-     * var position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
-     * var cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
-     */
-    Ellipsoid.prototype.cartesianToCartographic = function(cartesian, result) {
-        //`cartesian is required.` is thrown from scaleToGeodeticSurface
-        var p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);
-
-        if (!defined(p)) {
-            return undefined;
-        }
-
-        var n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);
-        var h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);
-
-        var longitude = Math.atan2(n.y, n.x);
-        var latitude = Math.asin(n.z);
-        var height = CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);
-
-        if (!defined(result)) {
-            return new Cartographic(longitude, latitude, height);
-        }
-        result.longitude = longitude;
-        result.latitude = latitude;
-        result.height = height;
-        return result;
-    };
-
-    /**
-     * Converts the provided array of cartesians to an array of cartographics.
-     *
-     * @param {Cartesian3[]} cartesians An array of Cartesian positions.
-     * @param {Cartographic[]} [result] The object onto which to store the result.
-     * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.
-     *
-     * @example
-     * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
-     * var positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
-     *                  new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
-     *                  new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
-     * var cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
-     */
-    Ellipsoid.prototype.cartesianArrayToCartographicArray = function(cartesians, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesians', cartesians);
-        //>>includeEnd('debug');
-
-        var length = cartesians.length;
-        if (!defined(result)) {
-            result = new Array(length);
-        } else {
-            result.length = length;
-        }
-        for ( var i = 0; i < length; ++i) {
-            result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
-        }
-        return result;
-    };
-
-    /**
-     * Scales the provided Cartesian position along the geodetic surface normal
-     * so that it is on the surface of this ellipsoid.  If the position is
-     * at the center of the ellipsoid, this function returns undefined.
-     *
-     * @param {Cartesian3} cartesian The Cartesian position to scale.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
-     */
-    Ellipsoid.prototype.scaleToGeodeticSurface = function(cartesian, result) {
-        return scaleToGeodeticSurface(cartesian, this._oneOverRadii, this._oneOverRadiiSquared, this._centerToleranceSquared, result);
-    };
-
-    /**
-     * Scales the provided Cartesian position along the geocentric surface normal
-     * so that it is on the surface of this ellipsoid.
-     *
-     * @param {Cartesian3} cartesian The Cartesian position to scale.
-     * @param {Cartesian3} [result] The object onto which to store the result.
-     * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
-     */
-    Ellipsoid.prototype.scaleToGeocentricSurface = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        var positionX = cartesian.x;
-        var positionY = cartesian.y;
-        var positionZ = cartesian.z;
-        var oneOverRadiiSquared = this._oneOverRadiiSquared;
-
-        var beta = 1.0 / Math.sqrt((positionX * positionX) * oneOverRadiiSquared.x +
-                                   (positionY * positionY) * oneOverRadiiSquared.y +
-                                   (positionZ * positionZ) * oneOverRadiiSquared.z);
-
-        return Cartesian3.multiplyByScalar(cartesian, beta, result);
-    };
-
-    /**
-     * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
-     * its components by the result of {@link Ellipsoid#oneOverRadii}.
-     *
-     * @param {Cartesian3} position The position to transform.
-     * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
-     *        return a new instance.
-     * @returns {Cartesian3} The position expressed in the scaled space.  The returned instance is the
-     *          one passed as the result parameter if it is not undefined, or a new instance of it is.
-     */
-    Ellipsoid.prototype.transformPositionToScaledSpace = function(position, result) {
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);
-    };
-
-    /**
-     * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
-     * its components by the result of {@link Ellipsoid#radii}.
-     *
-     * @param {Cartesian3} position The position to transform.
-     * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
-     *        return a new instance.
-     * @returns {Cartesian3} The position expressed in the unscaled space.  The returned instance is the
-     *          one passed as the result parameter if it is not undefined, or a new instance of it is.
-     */
-    Ellipsoid.prototype.transformPositionFromScaledSpace = function(position, result) {
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        return Cartesian3.multiplyComponents(position, this._radii, result);
-    };
-
-    /**
-     * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
-     * <code>true</code> if they are equal, <code>false</code> otherwise.
-     *
-     * @param {Ellipsoid} [right] The other Ellipsoid.
-     * @returns {Boolean} <code>true</code> if they are equal, <code>false</code> otherwise.
-     */
-    Ellipsoid.prototype.equals = function(right) {
-        return (this === right) ||
-               (defined(right) &&
-                Cartesian3.equals(this._radii, right._radii));
-    };
-
-    /**
-     * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
-     *
-     * @returns {String} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
-     */
-    Ellipsoid.prototype.toString = function() {
-        return this._radii.toString();
-    };
-
-    /**
-     * Computes a point which is the intersection of the surface normal with the z-axis.
-     *
-     * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.
-     * @param {Number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
-     *                                In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.
-     *                                In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
-     *                                Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
-     * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and
-     *        return a new instance.
-     * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise
-     *
-     * @exception {DeveloperError} position is required.
-     * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).
-     * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.
-     */
-    Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function(position, buffer, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('position', position);
-
-        if (!CesiumMath.equalsEpsilon(this._radii.x, this._radii.y, CesiumMath.EPSILON15)) {
-            throw new DeveloperError('Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)');
-        }
-
-        Check.typeOf.number.greaterThan('Ellipsoid.radii.z', this._radii.z, 0);
-        //>>includeEnd('debug');
-
-        buffer = defaultValue(buffer, 0.0);
-
-        var squaredXOverSquaredZ = this._squaredXOverSquaredZ;
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        result.x = 0.0;
-        result.y = 0.0;
-        result.z = position.z * (1 - squaredXOverSquaredZ);
-
-        if (Math.abs(result.z) >= this._radii.z - buffer) {
-            return undefined;
-        }
-
-        return result;
-    };
-export default Ellipsoid;

+ 0 - 395
Source/Core/EllipsoidGeodesic.js

@@ -1,395 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Cartographic from './Cartographic.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import Ellipsoid from './Ellipsoid.js';
-import CesiumMath from './Math.js';
-
-    function setConstants(ellipsoidGeodesic) {
-        var uSquared = ellipsoidGeodesic._uSquared;
-        var a = ellipsoidGeodesic._ellipsoid.maximumRadius;
-        var b = ellipsoidGeodesic._ellipsoid.minimumRadius;
-        var f = (a - b) / a;
-
-        var cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);
-        var sineHeading = Math.sin(ellipsoidGeodesic._startHeading);
-
-        var tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);
-
-        var cosineU = 1.0 / Math.sqrt(1.0 + tanU * tanU);
-        var sineU = cosineU * tanU;
-
-        var sigma = Math.atan2(tanU, cosineHeading);
-
-        var sineAlpha = cosineU * sineHeading;
-        var sineSquaredAlpha = sineAlpha * sineAlpha;
-
-        var cosineSquaredAlpha = 1.0 - sineSquaredAlpha;
-        var cosineAlpha = Math.sqrt(cosineSquaredAlpha);
-
-        var u2Over4 = uSquared / 4.0;
-        var u4Over16 = u2Over4 * u2Over4;
-        var u6Over64 = u4Over16 * u2Over4;
-        var u8Over256 = u4Over16 * u4Over16;
-
-        var a0 = (1.0 + u2Over4 - 3.0 * u4Over16 / 4.0 + 5.0 * u6Over64 / 4.0 - 175.0 * u8Over256 / 64.0);
-        var a1 = (1.0 - u2Over4 + 15.0 * u4Over16 / 8.0 - 35.0 * u6Over64 / 8.0);
-        var a2 = (1.0 - 3.0 * u2Over4 + 35.0 * u4Over16 / 4.0);
-        var a3 = (1.0 - 5.0 * u2Over4);
-
-        var distanceRatio = a0 * sigma - a1 * Math.sin(2.0 * sigma) * u2Over4 / 2.0 - a2 * Math.sin(4.0 * sigma) * u4Over16 / 16.0 -
-                            a3 * Math.sin(6.0 * sigma) * u6Over64 / 48.0 - Math.sin(8.0 * sigma) * 5.0 * u8Over256 / 512;
-
-        var constants = ellipsoidGeodesic._constants;
-
-        constants.a = a;
-        constants.b = b;
-        constants.f = f;
-        constants.cosineHeading = cosineHeading;
-        constants.sineHeading = sineHeading;
-        constants.tanU = tanU;
-        constants.cosineU = cosineU;
-        constants.sineU = sineU;
-        constants.sigma = sigma;
-        constants.sineAlpha = sineAlpha;
-        constants.sineSquaredAlpha = sineSquaredAlpha;
-        constants.cosineSquaredAlpha = cosineSquaredAlpha;
-        constants.cosineAlpha = cosineAlpha;
-        constants.u2Over4 = u2Over4;
-        constants.u4Over16 = u4Over16;
-        constants.u6Over64 = u6Over64;
-        constants.u8Over256 = u8Over256;
-        constants.a0 = a0;
-        constants.a1 = a1;
-        constants.a2 = a2;
-        constants.a3 = a3;
-        constants.distanceRatio = distanceRatio;
-    }
-
-    function computeC(f, cosineSquaredAlpha) {
-        return f * cosineSquaredAlpha * (4.0 + f * (4.0 - 3.0 * cosineSquaredAlpha)) / 16.0;
-    }
-
-    function computeDeltaLambda(f, sineAlpha, cosineSquaredAlpha, sigma, sineSigma, cosineSigma, cosineTwiceSigmaMidpoint) {
-        var C = computeC(f, cosineSquaredAlpha);
-
-        return (1.0 - C) * f * sineAlpha * (sigma + C * sineSigma * (cosineTwiceSigmaMidpoint +
-                C * cosineSigma * (2.0 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1.0)));
-    }
-
-    function vincentyInverseFormula(ellipsoidGeodesic, major, minor, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
-        var eff = (major - minor) / major;
-        var l = secondLongitude - firstLongitude;
-
-        var u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));
-        var u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));
-
-        var cosineU1 = Math.cos(u1);
-        var sineU1 = Math.sin(u1);
-        var cosineU2 = Math.cos(u2);
-        var sineU2 = Math.sin(u2);
-
-        var cc = cosineU1 * cosineU2;
-        var cs = cosineU1 * sineU2;
-        var ss = sineU1 * sineU2;
-        var sc = sineU1 * cosineU2;
-
-        var lambda = l;
-        var lambdaDot = CesiumMath.TWO_PI;
-
-        var cosineLambda = Math.cos(lambda);
-        var sineLambda = Math.sin(lambda);
-
-        var sigma;
-        var cosineSigma;
-        var sineSigma;
-        var cosineSquaredAlpha;
-        var cosineTwiceSigmaMidpoint;
-
-        do {
-            cosineLambda = Math.cos(lambda);
-            sineLambda = Math.sin(lambda);
-
-            var temp = cs - sc * cosineLambda;
-            sineSigma = Math.sqrt(cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp);
-            cosineSigma = ss + cc * cosineLambda;
-
-            sigma = Math.atan2(sineSigma, cosineSigma);
-
-            var sineAlpha;
-
-            if (sineSigma === 0.0) {
-                sineAlpha = 0.0;
-                cosineSquaredAlpha = 1.0;
-            } else {
-                sineAlpha = cc * sineLambda / sineSigma;
-                cosineSquaredAlpha = 1.0 - sineAlpha * sineAlpha;
-            }
-
-            lambdaDot = lambda;
-
-            cosineTwiceSigmaMidpoint = cosineSigma - 2.0 * ss / cosineSquaredAlpha;
-
-            if (isNaN(cosineTwiceSigmaMidpoint)) {
-                cosineTwiceSigmaMidpoint = 0.0;
-            }
-
-            lambda = l + computeDeltaLambda(eff, sineAlpha, cosineSquaredAlpha,
-                                            sigma, sineSigma, cosineSigma, cosineTwiceSigmaMidpoint);
-        } while (Math.abs(lambda - lambdaDot) > CesiumMath.EPSILON12);
-
-        var uSquared = cosineSquaredAlpha * (major * major - minor * minor) / (minor * minor);
-        var A = 1.0 + uSquared * (4096.0 + uSquared * (uSquared * (320.0 - 175.0 * uSquared) - 768.0)) / 16384.0;
-        var B = uSquared * (256.0 + uSquared * (uSquared * (74.0 - 47.0 * uSquared) - 128.0)) / 1024.0;
-
-        var cosineSquaredTwiceSigmaMidpoint = cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;
-        var deltaSigma = B * sineSigma * (cosineTwiceSigmaMidpoint + B * (cosineSigma *
-                (2.0 * cosineSquaredTwiceSigmaMidpoint - 1.0) - B * cosineTwiceSigmaMidpoint *
-                (4.0 * sineSigma * sineSigma - 3.0) * (4.0 * cosineSquaredTwiceSigmaMidpoint - 3.0) / 6.0) / 4.0);
-
-        var distance = minor * A * (sigma - deltaSigma);
-
-        var startHeading = Math.atan2(cosineU2 * sineLambda, cs - sc * cosineLambda);
-        var endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);
-
-        ellipsoidGeodesic._distance = distance;
-        ellipsoidGeodesic._startHeading = startHeading;
-        ellipsoidGeodesic._endHeading = endHeading;
-        ellipsoidGeodesic._uSquared = uSquared;
-    }
-
-    var scratchCart1 = new Cartesian3();
-    var scratchCart2 = new Cartesian3();
-    function computeProperties(ellipsoidGeodesic, start, end, ellipsoid) {
-        var firstCartesian = Cartesian3.normalize(ellipsoid.cartographicToCartesian(start, scratchCart2), scratchCart1);
-        var lastCartesian = Cartesian3.normalize(ellipsoid.cartographicToCartesian(end, scratchCart2), scratchCart2);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number.greaterThanOrEquals('value', Math.abs(Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI), 0.0125);
-        //>>includeEnd('debug');
-
-        vincentyInverseFormula(ellipsoidGeodesic, ellipsoid.maximumRadius, ellipsoid.minimumRadius,
-                               start.longitude, start.latitude, end.longitude, end.latitude);
-
-        ellipsoidGeodesic._start = Cartographic.clone(start, ellipsoidGeodesic._start);
-        ellipsoidGeodesic._end = Cartographic.clone(end, ellipsoidGeodesic._end);
-        ellipsoidGeodesic._start.height = 0;
-        ellipsoidGeodesic._end.height = 0;
-
-        setConstants(ellipsoidGeodesic);
-    }
-
-    /**
-     * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
-     *
-     * @alias EllipsoidGeodesic
-     * @constructor
-     *
-     * @param {Cartographic} [start] The initial planetodetic point on the path.
-     * @param {Cartographic} [end] The final planetodetic point on the path.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the geodesic lies.
-     */
-    function EllipsoidGeodesic(start, end, ellipsoid) {
-        var e = defaultValue(ellipsoid, Ellipsoid.WGS84);
-        this._ellipsoid = e;
-        this._start = new Cartographic();
-        this._end = new Cartographic();
-
-        this._constants = {};
-        this._startHeading = undefined;
-        this._endHeading = undefined;
-        this._distance = undefined;
-        this._uSquared = undefined;
-
-        if (defined(start) && defined(end)) {
-            computeProperties(this, start, end, e);
-        }
-    }
-
-    defineProperties(EllipsoidGeodesic.prototype, {
-        /**
-         * Gets the ellipsoid.
-         * @memberof EllipsoidGeodesic.prototype
-         * @type {Ellipsoid}
-         * @readonly
-         */
-        ellipsoid : {
-            get : function() {
-                return this._ellipsoid;
-            }
-        },
-
-        /**
-         * Gets the surface distance between the start and end point
-         * @memberof EllipsoidGeodesic.prototype
-         * @type {Number}
-         * @readonly
-         */
-        surfaceDistance : {
-            get : function() {
-                //>>includeStart('debug', pragmas.debug);
-                Check.defined('distance', this._distance);
-                //>>includeEnd('debug');
-
-                return this._distance;
-            }
-        },
-
-        /**
-         * Gets the initial planetodetic point on the path.
-         * @memberof EllipsoidGeodesic.prototype
-         * @type {Cartographic}
-         * @readonly
-         */
-        start : {
-            get : function() {
-                return this._start;
-            }
-        },
-
-        /**
-         * Gets the final planetodetic point on the path.
-         * @memberof EllipsoidGeodesic.prototype
-         * @type {Cartographic}
-         * @readonly
-         */
-        end : {
-            get : function() {
-                return this._end;
-            }
-        },
-
-        /**
-         * Gets the heading at the initial point.
-         * @memberof EllipsoidGeodesic.prototype
-         * @type {Number}
-         * @readonly
-         */
-        startHeading : {
-            get : function() {
-                //>>includeStart('debug', pragmas.debug);
-                Check.defined('distance', this._distance);
-                //>>includeEnd('debug');
-
-                return this._startHeading;
-            }
-        },
-
-        /**
-         * Gets the heading at the final point.
-         * @memberof EllipsoidGeodesic.prototype
-         * @type {Number}
-         * @readonly
-         */
-        endHeading : {
-            get : function() {
-                //>>includeStart('debug', pragmas.debug);
-                Check.defined('distance', this._distance);
-                //>>includeEnd('debug');
-
-                return this._endHeading;
-            }
-        }
-    });
-
-    /**
-     * Sets the start and end points of the geodesic
-     *
-     * @param {Cartographic} start The initial planetodetic point on the path.
-     * @param {Cartographic} end The final planetodetic point on the path.
-     */
-    EllipsoidGeodesic.prototype.setEndPoints = function(start, end) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('start', start);
-        Check.defined('end', end);
-        //>>includeEnd('debug');
-
-        computeProperties(this, start, end, this._ellipsoid);
-    };
-
-    /**
-     * Provides the location of a point at the indicated portion along the geodesic.
-     *
-     * @param {Number} fraction The portion of the distance between the initial and final points.
-     * @param {Cartographic} result The object in which to store the result.
-     * @returns {Cartographic} The location of the point along the geodesic.
-     */
-    EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) {
-        return this.interpolateUsingSurfaceDistance(this._distance * fraction, result);
-    };
-
-    /**
-     * Provides the location of a point at the indicated distance along the geodesic.
-     *
-     * @param {Number} distance The distance from the inital point to the point of interest along the geodesic
-     * @param {Cartographic} result The object in which to store the result.
-     * @returns {Cartographic} The location of the point along the geodesic.
-     *
-     * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance
-     */
-    EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function(distance, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('distance', this._distance);
-        //>>includeEnd('debug');
-
-        var constants = this._constants;
-
-        var s = constants.distanceRatio + distance / constants.b;
-
-        var cosine2S = Math.cos(2.0 * s);
-        var cosine4S = Math.cos(4.0 * s);
-        var cosine6S = Math.cos(6.0 * s);
-        var sine2S = Math.sin(2.0 * s);
-        var sine4S = Math.sin(4.0 * s);
-        var sine6S = Math.sin(6.0 * s);
-        var sine8S = Math.sin(8.0 * s);
-
-        var s2 = s * s;
-        var s3 = s * s2;
-
-        var u8Over256 = constants.u8Over256;
-        var u2Over4 = constants.u2Over4;
-        var u6Over64 = constants.u6Over64;
-        var u4Over16 = constants.u4Over16;
-        var sigma = 2.0 * s3 * u8Over256 * cosine2S / 3.0 +
-            s * (1.0 - u2Over4 + 7.0 * u4Over16 / 4.0 - 15.0 * u6Over64 / 4.0 + 579.0 * u8Over256 / 64.0 -
-            (u4Over16 - 15.0 * u6Over64 / 4.0 + 187.0 * u8Over256 / 16.0) * cosine2S -
-            (5.0 * u6Over64 / 4.0 - 115.0 * u8Over256 / 16.0) * cosine4S -
-            29.0 * u8Over256 * cosine6S / 16.0) +
-            (u2Over4 / 2.0 - u4Over16 + 71.0 * u6Over64 / 32.0 - 85.0 * u8Over256 / 16.0) * sine2S +
-            (5.0 * u4Over16 / 16.0 - 5.0 * u6Over64 / 4.0 + 383.0 * u8Over256 / 96.0) * sine4S -
-            s2 * ((u6Over64 - 11.0 * u8Over256 / 2.0) * sine2S + 5.0 * u8Over256 * sine4S / 2.0) +
-            (29.0 * u6Over64 / 96.0 - 29.0 * u8Over256 / 16.0) * sine6S +
-            539.0 * u8Over256 * sine8S / 1536.0;
-
-        var theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);
-        var latitude = Math.atan(constants.a / constants.b * Math.tan(theta));
-
-        // Redefine in terms of relative argument of latitude.
-        sigma = sigma - constants.sigma;
-
-        var cosineTwiceSigmaMidpoint = Math.cos(2.0 * constants.sigma + sigma);
-
-        var sineSigma = Math.sin(sigma);
-        var cosineSigma = Math.cos(sigma);
-
-        var cc = constants.cosineU * cosineSigma;
-        var ss = constants.sineU * sineSigma;
-
-        var lambda = Math.atan2(sineSigma * constants.sineHeading, cc - ss * constants.cosineHeading);
-
-        var l = lambda - computeDeltaLambda(constants.f, constants.sineAlpha, constants.cosineSquaredAlpha,
-                                            sigma, sineSigma, cosineSigma, cosineTwiceSigmaMidpoint);
-
-        if (defined(result)) {
-            result.longitude = this._start.longitude + l;
-            result.latitude = latitude;
-            result.height = 0.0;
-            return result;
-        }
-
-        return new Cartographic(this._start.longitude + l, latitude, 0.0);
-    };
-export default EllipsoidGeodesic;

+ 0 - 602
Source/Core/EllipsoidGeometry.js

@@ -1,602 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import IndexDatatype from './IndexDatatype.js';
-import CesiumMath from './Math.js';
-import PrimitiveType from './PrimitiveType.js';
-import VertexFormat from './VertexFormat.js';
-
-    var scratchPosition = new Cartesian3();
-    var scratchNormal = new Cartesian3();
-    var scratchTangent = new Cartesian3();
-    var scratchBitangent = new Cartesian3();
-    var scratchNormalST = new Cartesian3();
-    var defaultRadii = new Cartesian3(1.0, 1.0, 1.0);
-
-    var cos = Math.cos;
-    var sin = Math.sin;
-
-    /**
-     * A description of an ellipsoid centered at the origin.
-     *
-     * @alias EllipsoidGeometry
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.
-     * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.
-     * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
-     * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
-     * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.
-     * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.
-     * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.
-     * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     *
-     * @exception {DeveloperError} options.slicePartitions cannot be less than three.
-     * @exception {DeveloperError} options.stackPartitions cannot be less than three.
-     *
-     * @see EllipsoidGeometry#createGeometry
-     *
-     * @example
-     * var ellipsoid = new Cesium.EllipsoidGeometry({
-     *   vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
-     *   radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
-     * });
-     * var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
-     */
-    function EllipsoidGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var radii = defaultValue(options.radii, defaultRadii);
-        var innerRadii = defaultValue(options.innerRadii, radii);
-        var minimumClock = defaultValue(options.minimumClock, 0.0);
-        var maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);
-        var minimumCone = defaultValue(options.minimumCone, 0.0);
-        var maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);
-        var stackPartitions = Math.round(defaultValue(options.stackPartitions, 64));
-        var slicePartitions = Math.round(defaultValue(options.slicePartitions, 64));
-        var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (slicePartitions < 3) {
-            throw new DeveloperError('options.slicePartitions cannot be less than three.');
-        }
-        if (stackPartitions < 3) {
-            throw new DeveloperError('options.stackPartitions cannot be less than three.');
-        }
-        //>>includeEnd('debug');
-
-        this._radii = Cartesian3.clone(radii);
-        this._innerRadii = Cartesian3.clone(innerRadii);
-        this._minimumClock = minimumClock;
-        this._maximumClock = maximumClock;
-        this._minimumCone = minimumCone;
-        this._maximumCone = maximumCone;
-        this._stackPartitions = stackPartitions;
-        this._slicePartitions = slicePartitions;
-        this._vertexFormat = VertexFormat.clone(vertexFormat);
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createEllipsoidGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    EllipsoidGeometry.packedLength = 2 * (Cartesian3.packedLength) + VertexFormat.packedLength + 7;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {EllipsoidGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    EllipsoidGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(value)) {
-            throw new DeveloperError('value is required');
-        }
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        Cartesian3.pack(value._radii, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-
-        Cartesian3.pack(value._innerRadii, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-
-        VertexFormat.pack(value._vertexFormat, array, startingIndex);
-        startingIndex += VertexFormat.packedLength;
-
-        array[startingIndex++] = value._minimumClock;
-        array[startingIndex++] = value._maximumClock;
-        array[startingIndex++] = value._minimumCone;
-        array[startingIndex++] = value._maximumCone;
-        array[startingIndex++] = value._stackPartitions;
-        array[startingIndex++] = value._slicePartitions;
-        array[startingIndex] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchRadii = new Cartesian3();
-    var scratchInnerRadii = new Cartesian3();
-    var scratchVertexFormat = new VertexFormat();
-    var scratchOptions = {
-        radii : scratchRadii,
-        innerRadii : scratchInnerRadii,
-        vertexFormat : scratchVertexFormat,
-        minimumClock : undefined,
-        maximumClock : undefined,
-        minimumCone : undefined,
-        maximumCone : undefined,
-        stackPartitions : undefined,
-        slicePartitions : undefined,
-        offsetAttribute : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {EllipsoidGeometry} [result] The object into which to store the result.
-     * @returns {EllipsoidGeometry} The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
-     */
-    EllipsoidGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var radii = Cartesian3.unpack(array, startingIndex, scratchRadii);
-        startingIndex += Cartesian3.packedLength;
-
-        var innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);
-        startingIndex += Cartesian3.packedLength;
-
-        var vertexFormat = VertexFormat.unpack(array, startingIndex, scratchVertexFormat);
-        startingIndex += VertexFormat.packedLength;
-
-        var minimumClock = array[startingIndex++];
-        var maximumClock = array[startingIndex++];
-        var minimumCone = array[startingIndex++];
-        var maximumCone = array[startingIndex++];
-        var stackPartitions = array[startingIndex++];
-        var slicePartitions = array[startingIndex++];
-        var offsetAttribute = array[startingIndex];
-
-        if (!defined(result)) {
-            scratchOptions.minimumClock = minimumClock;
-            scratchOptions.maximumClock = maximumClock;
-            scratchOptions.minimumCone = minimumCone;
-            scratchOptions.maximumCone = maximumCone;
-            scratchOptions.stackPartitions = stackPartitions;
-            scratchOptions.slicePartitions = slicePartitions;
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new EllipsoidGeometry(scratchOptions);
-        }
-
-        result._radii = Cartesian3.clone(radii, result._radii);
-        result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);
-        result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);
-        result._minimumClock = minimumClock;
-        result._maximumClock = maximumClock;
-        result._minimumCone = minimumCone;
-        result._maximumCone = maximumCone;
-        result._stackPartitions = stackPartitions;
-        result._slicePartitions = slicePartitions;
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {EllipsoidGeometry} ellipsoidGeometry A description of the ellipsoid.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    EllipsoidGeometry.createGeometry = function(ellipsoidGeometry) {
-        var radii = ellipsoidGeometry._radii;
-        if ((radii.x <= 0) || (radii.y <= 0) || (radii.z <= 0)) {
-            return;
-        }
-
-        var innerRadii = ellipsoidGeometry._innerRadii;
-        if ((innerRadii.x <= 0) || (innerRadii.y <= 0) || innerRadii.z <= 0) {
-            return;
-        }
-
-        var minimumClock = ellipsoidGeometry._minimumClock;
-        var maximumClock = ellipsoidGeometry._maximumClock;
-        var minimumCone = ellipsoidGeometry._minimumCone;
-        var maximumCone = ellipsoidGeometry._maximumCone;
-        var vertexFormat = ellipsoidGeometry._vertexFormat;
-
-        // Add an extra slice and stack so that the number of partitions is the
-        // number of surfaces rather than the number of joints
-        var slicePartitions = ellipsoidGeometry._slicePartitions + 1;
-        var stackPartitions = ellipsoidGeometry._stackPartitions + 1;
-
-        slicePartitions = Math.round(slicePartitions * Math.abs(maximumClock - minimumClock) / CesiumMath.TWO_PI);
-        stackPartitions = Math.round(stackPartitions * Math.abs(maximumCone - minimumCone) / CesiumMath.PI);
-
-        if (slicePartitions < 2) {
-            slicePartitions = 2;
-        }
-        if (stackPartitions < 2) {
-            stackPartitions = 2;
-        }
-
-        var i;
-        var j;
-        var index = 0;
-
-        // Create arrays for theta and phi. Duplicate first and last angle to
-        // allow different normals at the intersections.
-        var phis = [minimumCone];
-        var thetas = [minimumClock];
-        for (i = 0; i < stackPartitions; i++) {
-            phis.push(minimumCone + i * (maximumCone - minimumCone) / (stackPartitions - 1));
-        }
-        phis.push(maximumCone);
-        for (j = 0; j < slicePartitions; j++) {
-            thetas.push(minimumClock + j * (maximumClock - minimumClock) / (slicePartitions - 1));
-        }
-        thetas.push(maximumClock);
-        var numPhis = phis.length;
-        var numThetas = thetas.length;
-
-        // Allow for extra indices if there is an inner surface and if we need
-        // to close the sides if the clock range is not a full circle
-        var extraIndices = 0;
-        var vertexMultiplier = 1.0;
-        var hasInnerSurface = ((innerRadii.x !== radii.x) || (innerRadii.y !== radii.y) || innerRadii.z !== radii.z);
-        var isTopOpen = false;
-        var isBotOpen = false;
-        var isClockOpen = false;
-        if (hasInnerSurface) {
-            vertexMultiplier = 2.0;
-            if (minimumCone > 0.0) {
-                isTopOpen = true;
-                extraIndices += (slicePartitions - 1);
-            }
-            if (maximumCone < Math.PI) {
-                isBotOpen = true;
-                extraIndices += (slicePartitions - 1);
-            }
-            if ((maximumClock - minimumClock) % CesiumMath.TWO_PI) {
-                isClockOpen = true;
-                extraIndices += ((stackPartitions - 1) * 2) + 1;
-            } else {
-                extraIndices += 1;
-            }
-        }
-
-        var vertexCount = numThetas * numPhis * vertexMultiplier;
-        var positions = new Float64Array(vertexCount * 3);
-        var isInner = arrayFill(new Array(vertexCount), false);
-        var negateNormal = arrayFill(new Array(vertexCount), false);
-
-        // Multiply by 6 because there are two triangles per sector
-        var indexCount = slicePartitions * stackPartitions * vertexMultiplier;
-        var numIndices = 6 * (indexCount + extraIndices + 1 - (slicePartitions + stackPartitions) * vertexMultiplier);
-        var indices = IndexDatatype.createTypedArray(indexCount, numIndices);
-
-        var normals = (vertexFormat.normal) ? new Float32Array(vertexCount * 3) : undefined;
-        var tangents = (vertexFormat.tangent) ? new Float32Array(vertexCount * 3) : undefined;
-        var bitangents = (vertexFormat.bitangent) ? new Float32Array(vertexCount * 3) : undefined;
-        var st = (vertexFormat.st) ? new Float32Array(vertexCount * 2) : undefined;
-
-        // Calculate sin/cos phi
-        var sinPhi = new Array(numPhis);
-        var cosPhi = new Array(numPhis);
-        for (i = 0; i < numPhis; i++) {
-            sinPhi[i] = sin(phis[i]);
-            cosPhi[i] = cos(phis[i]);
-        }
-
-        // Calculate sin/cos theta
-        var sinTheta = new Array(numThetas);
-        var cosTheta = new Array(numThetas);
-        for (j = 0; j < numThetas; j++) {
-            cosTheta[j] = cos(thetas[j]);
-            sinTheta[j] = sin(thetas[j]);
-        }
-
-        // Create outer surface
-        for (i = 0; i < numPhis; i++) {
-            for (j = 0; j < numThetas; j++) {
-                positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
-                positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
-                positions[index++] = radii.z * cosPhi[i];
-            }
-        }
-
-        // Create inner surface
-        var vertexIndex = vertexCount / 2.0;
-        if (hasInnerSurface) {
-            for (i = 0; i < numPhis; i++) {
-                for (j = 0; j < numThetas; j++) {
-                    positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
-                    positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
-                    positions[index++] = innerRadii.z * cosPhi[i];
-
-                    // Keep track of which vertices are the inner and which ones
-                    // need the normal to be negated
-                    isInner[vertexIndex] = true;
-                    if (i > 0 && i !== (numPhis - 1) && j !== 0 && j !== (numThetas - 1)) {
-                        negateNormal[vertexIndex] = true;
-                    }
-                    vertexIndex++;
-                }
-            }
-        }
-
-        // Create indices for outer surface
-        index = 0;
-        var topOffset;
-        var bottomOffset;
-        for (i = 1; i < (numPhis - 2); i++) {
-            topOffset = i * numThetas;
-            bottomOffset = (i + 1) * numThetas;
-
-            for (j = 1; j < numThetas - 2; j++) {
-                indices[index++] = bottomOffset + j;
-                indices[index++] = bottomOffset + j + 1;
-                indices[index++] = topOffset + j + 1;
-
-                indices[index++] = bottomOffset + j;
-                indices[index++] = topOffset + j + 1;
-                indices[index++] = topOffset + j;
-            }
-        }
-
-        // Create indices for inner surface
-        if (hasInnerSurface) {
-            var offset = numPhis * numThetas;
-            for (i = 1; i < (numPhis - 2); i++) {
-                topOffset = offset + i * numThetas;
-                bottomOffset = offset + (i + 1) * numThetas;
-
-                for (j = 1; j < numThetas - 2; j++) {
-                    indices[index++] = bottomOffset + j;
-                    indices[index++] = topOffset + j;
-                    indices[index++] = topOffset + j + 1;
-
-                    indices[index++] = bottomOffset + j;
-                    indices[index++] = topOffset + j + 1;
-                    indices[index++] = bottomOffset + j + 1;
-                }
-            }
-        }
-
-        var outerOffset;
-        var innerOffset;
-        if (hasInnerSurface) {
-            if (isTopOpen) {
-                // Connect the top of the inner surface to the top of the outer surface
-                innerOffset = numPhis * numThetas;
-                for (i = 1; i < numThetas - 2; i++) {
-                    indices[index++] = i;
-                    indices[index++] = i + 1;
-                    indices[index++] = innerOffset + i + 1;
-
-                    indices[index++] = i;
-                    indices[index++] = innerOffset + i + 1;
-                    indices[index++] = innerOffset + i;
-                }
-            }
-
-            if (isBotOpen) {
-                // Connect the bottom of the inner surface to the bottom of the outer surface
-                outerOffset = numPhis * numThetas - numThetas;
-                innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;
-                for (i = 1; i < numThetas - 2; i++) {
-                    indices[index++] = outerOffset + i + 1;
-                    indices[index++] = outerOffset + i;
-                    indices[index++] = innerOffset + i;
-
-                    indices[index++] = outerOffset + i + 1;
-                    indices[index++] = innerOffset + i;
-                    indices[index++] = innerOffset + i + 1;
-                }
-            }
-        }
-
-        // Connect the edges if clock is not closed
-        if (isClockOpen) {
-            for (i = 1; i < numPhis - 2; i++) {
-                innerOffset = numThetas * numPhis + (numThetas * i);
-                outerOffset = numThetas * i;
-                indices[index++] = innerOffset;
-                indices[index++] = outerOffset + numThetas;
-                indices[index++] = outerOffset;
-
-                indices[index++] = innerOffset;
-                indices[index++] = innerOffset + numThetas;
-                indices[index++] = outerOffset + numThetas;
-            }
-
-            for (i = 1; i < numPhis - 2; i++) {
-                innerOffset = numThetas * numPhis + (numThetas * (i + 1)) - 1;
-                outerOffset = numThetas * (i + 1) - 1;
-                indices[index++] = outerOffset + numThetas;
-                indices[index++] = innerOffset;
-                indices[index++] = outerOffset;
-
-                indices[index++] = outerOffset + numThetas;
-                indices[index++] = innerOffset + numThetas;
-                indices[index++] = innerOffset;
-            }
-        }
-
-        var attributes = new GeometryAttributes();
-
-        if (vertexFormat.position) {
-            attributes.position = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : positions
-            });
-        }
-
-        var stIndex = 0;
-        var normalIndex = 0;
-        var tangentIndex = 0;
-        var bitangentIndex = 0;
-        var vertexCountHalf = vertexCount / 2.0;
-
-        var ellipsoid;
-        var ellipsoidOuter = Ellipsoid.fromCartesian3(radii);
-        var ellipsoidInner = Ellipsoid.fromCartesian3(innerRadii);
-
-        if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
-            for (i = 0; i < vertexCount; i++) {
-                ellipsoid = (isInner[i]) ? ellipsoidInner : ellipsoidOuter;
-                var position = Cartesian3.fromArray(positions, i * 3, scratchPosition);
-                var normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
-                if (negateNormal[i]) {
-                    Cartesian3.negate(normal, normal);
-                }
-
-                if (vertexFormat.st) {
-                    var normalST = Cartesian2.negate(normal, scratchNormalST);
-                    st[stIndex++] = (Math.atan2(normalST.y, normalST.x) / CesiumMath.TWO_PI) + 0.5;
-                    st[stIndex++] = (Math.asin(normal.z) / Math.PI) + 0.5;
-                }
-
-                if (vertexFormat.normal) {
-                    normals[normalIndex++] = normal.x;
-                    normals[normalIndex++] = normal.y;
-                    normals[normalIndex++] = normal.z;
-                }
-
-                if (vertexFormat.tangent || vertexFormat.bitangent) {
-                    var tangent = scratchTangent;
-
-                    // Use UNIT_X for the poles
-                    var tangetOffset = 0;
-                    var unit;
-                    if (isInner[i]) {
-                        tangetOffset = vertexCountHalf;
-                    }
-                    if ((!isTopOpen && (i >= tangetOffset && i < (tangetOffset + numThetas * 2)))) {
-                        unit = Cartesian3.UNIT_X;
-                    } else {
-                        unit = Cartesian3.UNIT_Z;
-                    }
-                    Cartesian3.cross(unit, normal, tangent);
-                    Cartesian3.normalize(tangent, tangent);
-
-                    if (vertexFormat.tangent) {
-                        tangents[tangentIndex++] = tangent.x;
-                        tangents[tangentIndex++] = tangent.y;
-                        tangents[tangentIndex++] = tangent.z;
-                    }
-
-                    if (vertexFormat.bitangent) {
-                        var bitangent = Cartesian3.cross(normal, tangent, scratchBitangent);
-                        Cartesian3.normalize(bitangent, bitangent);
-
-                        bitangents[bitangentIndex++] = bitangent.x;
-                        bitangents[bitangentIndex++] = bitangent.y;
-                        bitangents[bitangentIndex++] = bitangent.z;
-                    }
-                }
-            }
-
-            if (vertexFormat.st) {
-                attributes.st = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 2,
-                    values : st
-                });
-            }
-
-            if (vertexFormat.normal) {
-                attributes.normal = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : normals
-                });
-            }
-
-            if (vertexFormat.tangent) {
-                attributes.tangent = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : tangents
-                });
-            }
-
-            if (vertexFormat.bitangent) {
-                attributes.bitangent = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : bitangents
-                });
-            }
-        }
-
-        if (defined(ellipsoidGeometry._offsetAttribute)) {
-            var length = positions.length;
-            var applyOffset = new Uint8Array(length / 3);
-            var offsetValue = ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-            arrayFill(applyOffset, offsetValue);
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values : applyOffset
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.TRIANGLES,
-            boundingSphere : BoundingSphere.fromEllipsoid(ellipsoidOuter),
-            offsetAttribute : ellipsoidGeometry._offsetAttribute
-        });
-    };
-
-    var unitEllipsoidGeometry;
-
-    /**
-     * Returns the geometric representation of a unit ellipsoid, including its vertices, indices, and a bounding sphere.
-     * @returns {Geometry} The computed vertices and indices.
-     *
-     * @private
-     */
-    EllipsoidGeometry.getUnitEllipsoid = function() {
-        if (!defined(unitEllipsoidGeometry)) {
-            unitEllipsoidGeometry = EllipsoidGeometry.createGeometry((new EllipsoidGeometry({
-                radii : new Cartesian3(1.0, 1.0, 1.0),
-                vertexFormat : VertexFormat.POSITION_ONLY
-            })));
-        }
-        return unitEllipsoidGeometry;
-    };
-export default EllipsoidGeometry;

+ 0 - 435
Source/Core/EllipsoidOutlineGeometry.js

@@ -1,435 +0,0 @@
-import arrayFill from './arrayFill.js';
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import GeometryOffsetAttribute from './GeometryOffsetAttribute.js';
-import IndexDatatype from './IndexDatatype.js';
-import CesiumMath from './Math.js';
-import PrimitiveType from './PrimitiveType.js';
-
-    var defaultRadii = new Cartesian3(1.0, 1.0, 1.0);
-    var cos = Math.cos;
-    var sin = Math.sin;
-
-    /**
-     * A description of the outline of an ellipsoid centered at the origin.
-     *
-     * @alias EllipsoidOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.
-     * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.
-     * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
-     * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
-     * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.
-     * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.
-     * @param {Number} [options.stackPartitions=10] The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
-     * @param {Number} [options.slicePartitions=8] The count of slices for the ellipsoid (Equal to the number of radial lines).
-     * @param {Number} [options.subdivisions=128] The number of points per line, determining the granularity of the curvature.
-     *
-     * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.
-     * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.
-     * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.
-     *
-     * @example
-     * var ellipsoid = new Cesium.EllipsoidOutlineGeometry({
-     *   radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
-     *   stackPartitions: 6,
-     *   slicePartitions: 5
-     * });
-     * var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
-     */
-    function EllipsoidOutlineGeometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        var radii = defaultValue(options.radii, defaultRadii);
-        var innerRadii = defaultValue(options.innerRadii, radii);
-        var minimumClock = defaultValue(options.minimumClock, 0.0);
-        var maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);
-        var minimumCone = defaultValue(options.minimumCone, 0.0);
-        var maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);
-        var stackPartitions = Math.round(defaultValue(options.stackPartitions, 10));
-        var slicePartitions = Math.round(defaultValue(options.slicePartitions, 8));
-        var subdivisions = Math.round(defaultValue(options.subdivisions, 128));
-
-        //>>includeStart('debug', pragmas.debug);
-        if (stackPartitions < 1) {
-            throw new DeveloperError('options.stackPartitions cannot be less than 1');
-        }
-        if (slicePartitions < 0) {
-            throw new DeveloperError('options.slicePartitions cannot be less than 0');
-        }
-        if (subdivisions < 0) {
-            throw new DeveloperError('options.subdivisions must be greater than or equal to zero.');
-        }
-        if (defined(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute.TOP) {
-            throw new DeveloperError('GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.');
-        }
-        //>>includeEnd('debug');
-
-        this._radii = Cartesian3.clone(radii);
-        this._innerRadii = Cartesian3.clone(innerRadii);
-        this._minimumClock = minimumClock;
-        this._maximumClock = maximumClock;
-        this._minimumCone = minimumCone;
-        this._maximumCone = maximumCone;
-        this._stackPartitions = stackPartitions;
-        this._slicePartitions = slicePartitions;
-        this._subdivisions = subdivisions;
-        this._offsetAttribute = options.offsetAttribute;
-        this._workerName = 'createEllipsoidOutlineGeometry';
-    }
-
-    /**
-     * The number of elements used to pack the object into an array.
-     * @type {Number}
-     */
-    EllipsoidOutlineGeometry.packedLength = 2 * (Cartesian3.packedLength) + 8;
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {EllipsoidOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    EllipsoidOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(value)) {
-            throw new DeveloperError('value is required');
-        }
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        Cartesian3.pack(value._radii, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-
-        Cartesian3.pack(value._innerRadii, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-
-        array[startingIndex++] = value._minimumClock;
-        array[startingIndex++] = value._maximumClock;
-        array[startingIndex++] = value._minimumCone;
-        array[startingIndex++] = value._maximumCone;
-        array[startingIndex++] = value._stackPartitions;
-        array[startingIndex++] = value._slicePartitions;
-        array[startingIndex++] = value._subdivisions;
-        array[startingIndex] = defaultValue(value._offsetAttribute, -1);
-
-        return array;
-    };
-
-    var scratchRadii = new Cartesian3();
-    var scratchInnerRadii = new Cartesian3();
-    var scratchOptions = {
-        radii : scratchRadii,
-        innerRadii : scratchInnerRadii,
-        minimumClock : undefined,
-        maximumClock : undefined,
-        minimumCone : undefined,
-        maximumCone : undefined,
-        stackPartitions : undefined,
-        slicePartitions : undefined,
-        subdivisions : undefined,
-        offsetAttribute : undefined
-    };
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {EllipsoidOutlineGeometry} [result] The object into which to store the result.
-     * @returns {EllipsoidOutlineGeometry} The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
-     */
-    EllipsoidOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(array)) {
-            throw new DeveloperError('array is required');
-        }
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var radii = Cartesian3.unpack(array, startingIndex, scratchRadii);
-        startingIndex += Cartesian3.packedLength;
-
-        var innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);
-        startingIndex += Cartesian3.packedLength;
-
-        var minimumClock = array[startingIndex++];
-        var maximumClock = array[startingIndex++];
-        var minimumCone = array[startingIndex++];
-        var maximumCone = array[startingIndex++];
-        var stackPartitions = array[startingIndex++];
-        var slicePartitions = array[startingIndex++];
-        var subdivisions = array[startingIndex++];
-        var offsetAttribute = array[startingIndex];
-
-        if (!defined(result)) {
-            scratchOptions.minimumClock = minimumClock;
-            scratchOptions.maximumClock = maximumClock;
-            scratchOptions.minimumCone = minimumCone;
-            scratchOptions.maximumCone = maximumCone;
-            scratchOptions.stackPartitions = stackPartitions;
-            scratchOptions.slicePartitions = slicePartitions;
-            scratchOptions.subdivisions = subdivisions;
-            scratchOptions.offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-            return new EllipsoidOutlineGeometry(scratchOptions);
-        }
-
-        result._radii = Cartesian3.clone(radii, result._radii);
-        result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);
-        result._minimumClock = minimumClock;
-        result._maximumClock = maximumClock;
-        result._minimumCone = minimumCone;
-        result._maximumCone = maximumCone;
-        result._stackPartitions = stackPartitions;
-        result._slicePartitions = slicePartitions;
-        result._subdivisions = subdivisions;
-        result._offsetAttribute = offsetAttribute === -1 ? undefined : offsetAttribute;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {EllipsoidOutlineGeometry} ellipsoidGeometry A description of the ellipsoid outline.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    EllipsoidOutlineGeometry.createGeometry = function(ellipsoidGeometry) {
-        var radii = ellipsoidGeometry._radii;
-        if ((radii.x <= 0) || (radii.y <= 0) || (radii.z <= 0)) {
-            return;
-        }
-
-        var innerRadii = ellipsoidGeometry._innerRadii;
-        if ((innerRadii.x <= 0) || (innerRadii.y <= 0) || (innerRadii.z <= 0)) {
-            return;
-        }
-
-        var minimumClock = ellipsoidGeometry._minimumClock;
-        var maximumClock = ellipsoidGeometry._maximumClock;
-        var minimumCone = ellipsoidGeometry._minimumCone;
-        var maximumCone = ellipsoidGeometry._maximumCone;
-        var subdivisions = ellipsoidGeometry._subdivisions;
-        var ellipsoid = Ellipsoid.fromCartesian3(radii);
-
-        // Add an extra slice and stack to remain consistent with EllipsoidGeometry
-        var slicePartitions = ellipsoidGeometry._slicePartitions + 1;
-        var stackPartitions = ellipsoidGeometry._stackPartitions + 1;
-
-        slicePartitions = Math.round(slicePartitions * Math.abs(maximumClock - minimumClock) / CesiumMath.TWO_PI);
-        stackPartitions = Math.round(stackPartitions * Math.abs(maximumCone - minimumCone) / CesiumMath.PI);
-
-        if (slicePartitions < 2) {
-            slicePartitions = 2;
-        }
-        if (stackPartitions < 2) {
-            stackPartitions = 2;
-        }
-
-        var extraIndices = 0;
-        var vertexMultiplier = 1.0;
-        var hasInnerSurface = ((innerRadii.x !== radii.x) || (innerRadii.y !== radii.y) || innerRadii.z !== radii.z);
-        var isTopOpen = false;
-        var isBotOpen = false;
-        if (hasInnerSurface) {
-            vertexMultiplier = 2.0;
-            // Add 2x slicePartitions to connect the top/bottom of the outer to
-            // the top/bottom of the inner
-            if (minimumCone > 0.0) {
-                isTopOpen = true;
-                extraIndices += slicePartitions;
-            }
-            if (maximumCone < Math.PI) {
-                isBotOpen = true;
-                extraIndices += slicePartitions;
-            }
-        }
-
-        var vertexCount = subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);
-        var positions = new Float64Array(vertexCount * 3);
-
-        // Multiply by two because two points define each line segment
-        var numIndices = 2 * (vertexCount + extraIndices - (slicePartitions + stackPartitions) * vertexMultiplier);
-        var indices = IndexDatatype.createTypedArray(vertexCount, numIndices);
-
-        var i;
-        var j;
-        var theta;
-        var phi;
-        var index = 0;
-
-        // Calculate sin/cos phi
-        var sinPhi = new Array(stackPartitions);
-        var cosPhi = new Array(stackPartitions);
-        for (i = 0; i < stackPartitions; i++) {
-            phi = minimumCone + i * (maximumCone - minimumCone) / (stackPartitions - 1);
-            sinPhi[i] = sin(phi);
-            cosPhi[i] = cos(phi);
-        }
-
-        // Calculate sin/cos theta
-        var sinTheta = new Array(subdivisions);
-        var cosTheta = new Array(subdivisions);
-        for (i = 0; i < subdivisions; i++) {
-            theta = minimumClock + i * (maximumClock - minimumClock) / (subdivisions - 1);
-            sinTheta[i] = sin(theta);
-            cosTheta[i] = cos(theta);
-        }
-
-        // Calculate the latitude lines on the outer surface
-        for (i = 0; i < stackPartitions; i++) {
-            for (j = 0; j < subdivisions; j++) {
-                positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
-                positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
-                positions[index++] = radii.z * cosPhi[i];
-            }
-        }
-
-        // Calculate the latitude lines on the inner surface
-        if (hasInnerSurface) {
-            for (i = 0; i < stackPartitions; i++) {
-                for (j = 0; j < subdivisions; j++) {
-                    positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
-                    positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
-                    positions[index++] = innerRadii.z * cosPhi[i];
-                }
-            }
-        }
-
-        // Calculate sin/cos phi
-        sinPhi.length = subdivisions;
-        cosPhi.length = subdivisions;
-        for (i = 0; i < subdivisions; i++) {
-            phi = minimumCone + i * (maximumCone - minimumCone) / (subdivisions - 1);
-            sinPhi[i] = sin(phi);
-            cosPhi[i] = cos(phi);
-        }
-
-        // Calculate sin/cos theta for each slice partition
-        sinTheta.length = slicePartitions;
-        cosTheta.length = slicePartitions;
-        for (i = 0; i < slicePartitions; i++) {
-            theta = minimumClock + i * (maximumClock - minimumClock) / (slicePartitions - 1);
-            sinTheta[i] = sin(theta);
-            cosTheta[i] = cos(theta);
-        }
-
-        // Calculate the longitude lines on the outer surface
-        for (i = 0; i < subdivisions; i++) {
-            for (j = 0; j < slicePartitions; j++) {
-                positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
-                positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
-                positions[index++] = radii.z * cosPhi[i];
-            }
-        }
-
-        // Calculate the longitude lines on the inner surface
-        if (hasInnerSurface) {
-            for (i = 0; i < subdivisions; i++) {
-                for (j = 0; j < slicePartitions; j++) {
-                    positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
-                    positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
-                    positions[index++] = innerRadii.z * cosPhi[i];
-                }
-            }
-        }
-
-        // Create indices for the latitude lines
-        index = 0;
-        for (i = 0; i < stackPartitions * vertexMultiplier; i++) {
-            var topOffset = i * subdivisions;
-            for (j = 0; j < subdivisions - 1; j++) {
-                indices[index++] = topOffset + j;
-                indices[index++] = topOffset + j + 1;
-            }
-        }
-
-        // Create indices for the outer longitude lines
-        var offset = stackPartitions * subdivisions * vertexMultiplier;
-        for (i = 0; i < slicePartitions; i++) {
-            for (j = 0; j < subdivisions - 1; j++) {
-                indices[index++] = offset + i + (j * slicePartitions);
-                indices[index++] = offset + i + (j + 1) * slicePartitions;
-            }
-        }
-
-        // Create indices for the inner longitude lines
-        if (hasInnerSurface) {
-            offset = stackPartitions * subdivisions * vertexMultiplier + slicePartitions * subdivisions;
-            for (i = 0; i < slicePartitions; i++) {
-                for (j = 0; j < subdivisions - 1; j++) {
-                    indices[index++] = offset + i + (j * slicePartitions);
-                    indices[index++] = offset + i + (j + 1) * slicePartitions;
-                }
-            }
-        }
-
-        if (hasInnerSurface) {
-            var outerOffset = stackPartitions * subdivisions * vertexMultiplier;
-            var innerOffset = outerOffset + (subdivisions * slicePartitions);
-            if (isTopOpen) {
-                // Draw lines from the top of the inner surface to the top of the outer surface
-                for (i = 0; i < slicePartitions; i++) {
-                    indices[index++] = outerOffset + i;
-                    indices[index++] = innerOffset + i;
-                }
-            }
-
-            if (isBotOpen) {
-                // Draw lines from the top of the inner surface to the top of the outer surface
-                outerOffset += (subdivisions * slicePartitions) - slicePartitions;
-                innerOffset += (subdivisions * slicePartitions) - slicePartitions;
-                for (i = 0; i < slicePartitions; i++) {
-                    indices[index++] = outerOffset + i;
-                    indices[index++] = innerOffset + i;
-                }
-            }
-        }
-
-        var attributes = new GeometryAttributes({
-            position : new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : positions
-            })
-        });
-
-        if (defined(ellipsoidGeometry._offsetAttribute)) {
-            var length = positions.length;
-            var applyOffset = new Uint8Array(length / 3);
-            var offsetValue = ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;
-            arrayFill(applyOffset, offsetValue);
-            attributes.applyOffset = new GeometryAttribute({
-                componentDatatype : ComponentDatatype.UNSIGNED_BYTE,
-                componentsPerAttribute : 1,
-                values : applyOffset
-            });
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.LINES,
-            boundingSphere : BoundingSphere.fromEllipsoid(ellipsoid),
-            offsetAttribute : ellipsoidGeometry._offsetAttribute
-        });
-    };
-export default EllipsoidOutlineGeometry;

+ 0 - 497
Source/Core/EllipsoidRhumbLine.js

@@ -1,497 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Cartographic from './Cartographic.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-import CesiumMath from './Math.js';
-
-    function calculateM(ellipticity, major, latitude) {
-        if (ellipticity === 0.0) { // sphere
-            return major * latitude;
-        }
-
-        var e2 = ellipticity * ellipticity;
-        var e4 = e2 * e2;
-        var e6 = e4 * e2;
-        var e8 = e6 * e2;
-        var e10 = e8 * e2;
-        var e12 = e10 * e2;
-        var phi = latitude;
-        var sin2Phi = Math.sin(2 * phi);
-        var sin4Phi = Math.sin(4 * phi);
-        var sin6Phi = Math.sin(6 * phi);
-        var sin8Phi = Math.sin(8 * phi);
-        var sin10Phi = Math.sin(10 * phi);
-        var sin12Phi = Math.sin(12 * phi);
-
-        return major * ((1 - e2 / 4 - 3 * e4 / 64 - 5 * e6 / 256 - 175 * e8 / 16384 - 441 * e10 / 65536 - 4851 * e12 / 1048576) * phi
-                     - (3 * e2 / 8 + 3 * e4 / 32 + 45 * e6 / 1024 + 105 * e8 / 4096 + 2205 * e10 / 131072 + 6237 * e12 / 524288) * sin2Phi
-                     + (15 * e4 / 256 + 45 * e6 / 1024 + 525 * e8 / 16384 + 1575 * e10 / 65536 + 155925 * e12 / 8388608) * sin4Phi
-                     - (35 * e6 / 3072 + 175 * e8 / 12288 + 3675 * e10 / 262144 + 13475 * e12 / 1048576) * sin6Phi
-                     + (315 * e8 / 131072 + 2205 * e10 / 524288 + 43659 * e12 / 8388608) * sin8Phi
-                     - (693 * e10 / 1310720 + 6237 * e12 / 5242880) * sin10Phi
-                     + 1001 * e12 / 8388608 * sin12Phi);
-    }
-
-    function calculateInverseM(M, ellipticity, major) {
-        var d = M / major;
-
-        if (ellipticity === 0.0) { // sphere
-            return d;
-        }
-
-        var d2 = d * d;
-        var d3 = d2 * d;
-        var d4 = d3 * d;
-        var e = ellipticity;
-        var e2 = e * e;
-        var e4 = e2 * e2;
-        var e6 = e4 * e2;
-        var e8 = e6 * e2;
-        var e10 = e8 * e2;
-        var e12 = e10 * e2;
-        var sin2D = Math.sin(2 * d);
-        var cos2D = Math.cos(2 * d);
-        var sin4D = Math.sin(4 * d);
-        var cos4D = Math.cos(4 * d);
-        var sin6D = Math.sin(6 * d);
-        var cos6D = Math.cos(6 * d);
-        var sin8D = Math.sin(8 * d);
-        var cos8D = Math.cos(8 * d);
-        var sin10D = Math.sin(10 * d);
-        var cos10D = Math.cos(10 * d);
-        var sin12D = Math.sin(12 * d);
-
-        return d + d * e2 / 4 + 7 * d * e4 / 64 + 15 * d * e6 / 256 + 579 * d * e8 / 16384 + 1515 * d * e10 / 65536 + 16837 * d * e12 / 1048576
-            + (3 * d * e4 / 16 + 45 * d * e6 / 256 - d * (32 * d2 - 561) * e8 / 4096 - d * (232 * d2 - 1677) * e10 / 16384 + d * (399985 - 90560 * d2 + 512 * d4) * e12 / 5242880) * cos2D
-            + (21 * d * e6 / 256 + 483 * d * e8 / 4096 - d * (224 * d2 - 1969) * e10 / 16384 - d * (33152 * d2 - 112599) * e12 / 1048576) * cos4D
-            + (151 * d * e8 / 4096 + 4681 * d * e10 / 65536 + 1479 * d * e12 / 16384 - 453 * d3 * e12 / 32768) * cos6D
-            + (1097 * d * e10 / 65536 + 42783 * d * e12 / 1048576) * cos8D
-            + 8011 * d * e12 / 1048576 * cos10D
-            + (3 * e2 / 8 + 3 * e4 / 16 + 213 * e6 / 2048 - 3 * d2 * e6 / 64 + 255 * e8 / 4096 - 33 * d2 * e8 / 512 + 20861 * e10 / 524288 - 33 * d2 * e10 / 512 + d4 * e10 / 1024 + 28273 * e12 / 1048576 - 471 * d2 * e12 / 8192 + 9 * d4 * e12 / 4096) * sin2D
-            + (21 * e4 / 256 + 21 * e6 / 256 + 533 * e8 / 8192 - 21 * d2 * e8 / 512 + 197 * e10 / 4096 - 315 * d2 * e10 / 4096 + 584039 * e12 / 16777216 - 12517 * d2 * e12 / 131072 + 7 * d4 * e12 / 2048) * sin4D
-            + (151 * e6 / 6144 + 151 * e8 / 4096 + 5019 * e10 / 131072 - 453 * d2 * e10 / 16384 + 26965 * e12 / 786432 - 8607 * d2 * e12 / 131072) * sin6D
-            + (1097 * e8 / 131072 + 1097 * e10 / 65536 + 225797 * e12 / 10485760 - 1097 * d2 * e12 / 65536) * sin8D
-            + (8011 * e10 / 2621440 + 8011 * e12 / 1048576) * sin10D
-            + 293393 * e12 / 251658240 * sin12D;
-    }
-
-    function calculateSigma(ellipticity, latitude) {
-        if (ellipticity === 0.0) { // sphere
-            return Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude)));
-        }
-
-        var eSinL = ellipticity * Math.sin(latitude);
-        return Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude))) - (ellipticity / 2.0 * Math.log((1 + eSinL) / (1 - eSinL)));
-    }
-
-    function calculateHeading(ellipsoidRhumbLine, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
-        var sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);
-        var sigma2 = calculateSigma(ellipsoidRhumbLine._ellipticity, secondLatitude);
-        return Math.atan2(CesiumMath.negativePiToPi(secondLongitude - firstLongitude), sigma2 - sigma1);
-    }
-
-    function calculateArcLength(ellipsoidRhumbLine, major, minor, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
-        var heading = ellipsoidRhumbLine._heading;
-        var deltaLongitude = secondLongitude - firstLongitude;
-
-        var distance = 0.0;
-
-        //Check to see if the rhumb line has constant latitude
-        //This equation will diverge if heading gets close to 90 degrees
-        if (CesiumMath.equalsEpsilon(Math.abs(heading), CesiumMath.PI_OVER_TWO, CesiumMath.EPSILON8)) { //If heading is close to 90 degrees
-            if (major === minor) {
-                distance = major * Math.cos(firstLatitude) * CesiumMath.negativePiToPi(deltaLongitude);
-            } else {
-                var sinPhi = Math.sin(firstLatitude);
-                distance = major * Math.cos(firstLatitude) * CesiumMath.negativePiToPi(deltaLongitude) / Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);
-            }
-        } else {
-            var M1 = calculateM(ellipsoidRhumbLine._ellipticity, major, firstLatitude);
-            var M2 = calculateM(ellipsoidRhumbLine._ellipticity, major, secondLatitude);
-
-            distance = (M2 - M1) / Math.cos(heading);
-        }
-        return Math.abs(distance);
-    }
-
-    var scratchCart1 = new Cartesian3();
-    var scratchCart2 = new Cartesian3();
-
-    function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) {
-        var firstCartesian = Cartesian3.normalize(ellipsoid.cartographicToCartesian(start, scratchCart2), scratchCart1);
-        var lastCartesian = Cartesian3.normalize(ellipsoid.cartographicToCartesian(end, scratchCart2), scratchCart2);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number.greaterThanOrEquals('value', Math.abs(Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI), 0.0125);
-        //>>includeEnd('debug');
-
-        var major = ellipsoid.maximumRadius;
-        var minor = ellipsoid.minimumRadius;
-        var majorSquared = major * major;
-        var minorSquared = minor * minor;
-        ellipsoidRhumbLine._ellipticitySquared = (majorSquared - minorSquared) / majorSquared;
-        ellipsoidRhumbLine._ellipticity = Math.sqrt(ellipsoidRhumbLine._ellipticitySquared);
-
-        ellipsoidRhumbLine._start = Cartographic.clone(start, ellipsoidRhumbLine._start);
-        ellipsoidRhumbLine._start.height = 0;
-
-        ellipsoidRhumbLine._end = Cartographic.clone(end, ellipsoidRhumbLine._end);
-        ellipsoidRhumbLine._end.height = 0;
-
-        ellipsoidRhumbLine._heading = calculateHeading(ellipsoidRhumbLine, start.longitude, start.latitude, end.longitude, end.latitude);
-        ellipsoidRhumbLine._distance = calculateArcLength(ellipsoidRhumbLine, ellipsoid.maximumRadius, ellipsoid.minimumRadius,
-                                                          start.longitude, start.latitude, end.longitude, end.latitude);
-    }
-
-    function interpolateUsingSurfaceDistance(start, heading, distance, major, ellipticity, result)
-    {
-        var ellipticitySquared = ellipticity * ellipticity;
-
-        var longitude;
-        var latitude;
-        var deltaLongitude;
-
-        //Check to see if the rhumb line has constant latitude
-        //This won't converge if heading is close to 90 degrees
-        if (Math.abs(CesiumMath.PI_OVER_TWO - Math.abs(heading)) > CesiumMath.EPSILON8) {
-            //Calculate latitude of the second point
-            var M1 = calculateM(ellipticity, major, start.latitude);
-            var deltaM = distance * Math.cos(heading);
-            var M2 = M1 + deltaM;
-            latitude = calculateInverseM(M2, ellipticity, major);
-
-            //Now find the longitude of the second point
-            var sigma1 = calculateSigma(ellipticity, start.latitude);
-            var sigma2 = calculateSigma(ellipticity, latitude);
-            deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
-            longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);
-        } else { //If heading is close to 90 degrees
-            latitude = start.latitude;
-            var localRad;
-
-            if (ellipticity === 0.0) { // sphere
-                localRad = major * Math.cos(start.latitude);
-            } else {
-                var sinPhi = Math.sin(start.latitude);
-                localRad = major * Math.cos(start.latitude) / Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);
-            }
-
-            deltaLongitude = distance / localRad;
-            if (heading > 0.0) {
-                longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);
-            } else {
-                longitude = CesiumMath.negativePiToPi(start.longitude - deltaLongitude);
-            }
-        }
-
-        if (defined(result)) {
-            result.longitude = longitude;
-            result.latitude = latitude;
-            result.height = 0;
-
-            return result;
-        }
-
-        return new Cartographic(longitude, latitude, 0);
-    }
-
-    /**
-     * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
-     *
-     * @alias EllipsoidRhumbLine
-     * @constructor
-     *
-     * @param {Cartographic} [start] The initial planetodetic point on the path.
-     * @param {Cartographic} [end] The final planetodetic point on the path.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.
-     *
-     * @exception {DeveloperError} angle between start and end must be at least 0.0125 radians.
-     */
-    function EllipsoidRhumbLine(start, end, ellipsoid) {
-        var e = defaultValue(ellipsoid, Ellipsoid.WGS84);
-        this._ellipsoid = e;
-        this._start = new Cartographic();
-        this._end = new Cartographic();
-
-        this._heading = undefined;
-        this._distance = undefined;
-        this._ellipticity = undefined;
-        this._ellipticitySquared = undefined;
-
-        if (defined(start) && defined(end)) {
-            computeProperties(this, start, end, e);
-        }
-    }
-
-    defineProperties(EllipsoidRhumbLine.prototype, {
-        /**
-         * Gets the ellipsoid.
-         * @memberof EllipsoidRhumbLine.prototype
-         * @type {Ellipsoid}
-         * @readonly
-         */
-        ellipsoid : {
-            get : function() {
-                return this._ellipsoid;
-            }
-        },
-
-        /**
-         * Gets the surface distance between the start and end point
-         * @memberof EllipsoidRhumbLine.prototype
-         * @type {Number}
-         * @readonly
-         */
-        surfaceDistance : {
-            get : function() {
-                //>>includeStart('debug', pragmas.debug);
-                Check.defined('distance', this._distance);
-                //>>includeEnd('debug');
-
-                return this._distance;
-            }
-        },
-
-        /**
-         * Gets the initial planetodetic point on the path.
-         * @memberof EllipsoidRhumbLine.prototype
-         * @type {Cartographic}
-         * @readonly
-         */
-        start : {
-            get : function() {
-                return this._start;
-            }
-        },
-
-        /**
-         * Gets the final planetodetic point on the path.
-         * @memberof EllipsoidRhumbLine.prototype
-         * @type {Cartographic}
-         * @readonly
-         */
-        end : {
-            get : function() {
-                return this._end;
-            }
-        },
-
-        /**
-         * Gets the heading from the start point to the end point.
-         * @memberof EllipsoidRhumbLine.prototype
-         * @type {Number}
-         * @readonly
-         */
-        heading : {
-            get : function() {
-                //>>includeStart('debug', pragmas.debug);
-                Check.defined('distance', this._distance);
-                //>>includeEnd('debug');
-
-                return this._heading;
-            }
-        }
-    });
-
-    /**
-     * Create a rhumb line using an initial position with a heading and distance.
-     *
-     * @param {Cartographic} start The initial planetodetic point on the path.
-     * @param {Number} heading The heading in radians.
-     * @param {Number} distance The rhumb line distance between the start and end point.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.
-     * @param {EllipsoidRhumbLine} [result] The object in which to store the result.
-     * @returns {EllipsoidRhumbLine} The EllipsoidRhumbLine object.
-     */
-    EllipsoidRhumbLine.fromStartHeadingDistance = function(start, heading, distance, ellipsoid, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('start', start);
-        Check.defined('heading', heading);
-        Check.defined('distance', distance);
-        Check.typeOf.number.greaterThan('distance', distance, 0.0);
-        //>>includeEnd('debug');
-
-        var e = defaultValue(ellipsoid, Ellipsoid.WGS84);
-        var major = e.maximumRadius;
-        var minor = e.minimumRadius;
-        var majorSquared = major * major;
-        var minorSquared = minor * minor;
-        var ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);
-
-        heading = CesiumMath.negativePiToPi(heading);
-        var end = interpolateUsingSurfaceDistance(start, heading, distance, e.maximumRadius, ellipticity);
-
-        if (!defined(result) || (defined(ellipsoid) && !ellipsoid.equals(result.ellipsoid))) {
-            return new EllipsoidRhumbLine(start, end, e);
-        }
-
-        result.setEndPoints(start, end);
-        return result;
-    };
-
-    /**
-     * Sets the start and end points of the rhumb line.
-     *
-     * @param {Cartographic} start The initial planetodetic point on the path.
-     * @param {Cartographic} end The final planetodetic point on the path.
-     */
-    EllipsoidRhumbLine.prototype.setEndPoints = function(start, end) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('start', start);
-        Check.defined('end', end);
-        //>>includeEnd('debug');
-
-        computeProperties(this, start, end, this._ellipsoid);
-    };
-
-    /**
-     * Provides the location of a point at the indicated portion along the rhumb line.
-     *
-     * @param {Number} fraction The portion of the distance between the initial and final points.
-     * @param {Cartographic} [result] The object in which to store the result.
-     * @returns {Cartographic} The location of the point along the rhumb line.
-     */
-    EllipsoidRhumbLine.prototype.interpolateUsingFraction = function(fraction, result) {
-        return this.interpolateUsingSurfaceDistance(fraction * this._distance, result);
-    };
-
-    /**
-     * Provides the location of a point at the indicated distance along the rhumb line.
-     *
-     * @param {Number} distance The distance from the inital point to the point of interest along the rhumbLine.
-     * @param {Cartographic} [result] The object in which to store the result.
-     * @returns {Cartographic} The location of the point along the rhumb line.
-     *
-     * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance
-     */
-    EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function(distance, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('distance', distance);
-        if (!defined(this._distance) || this._distance === 0.0) {
-            throw new DeveloperError('EllipsoidRhumbLine must have distinct start and end set.');
-        }
-        //>>includeEnd('debug');
-
-        return interpolateUsingSurfaceDistance(this._start, this._heading, distance, this._ellipsoid.maximumRadius, this._ellipticity, result);
-    };
-
-    /**
-     * Provides the location of a point at the indicated longitude along the rhumb line.
-     * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
-     *
-     * @param {Number} intersectionLongitude The longitude, in radians, at which to find the intersection point from the starting point using the heading.
-     * @param {Cartographic} [result] The object in which to store the result.
-     * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
-     *
-     * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.
-     */
-    EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function(intersectionLongitude, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('intersectionLongitude', intersectionLongitude);
-        if (!defined(this._distance) || this._distance === 0.0) {
-            throw new DeveloperError('EllipsoidRhumbLine must have distinct start and end set.');
-        }
-        //>>includeEnd('debug');
-
-        var ellipticity = this._ellipticity;
-        var heading = this._heading;
-        var absHeading = Math.abs(heading);
-        var start = this._start;
-
-        intersectionLongitude = CesiumMath.negativePiToPi(intersectionLongitude);
-
-        if (CesiumMath.equalsEpsilon(Math.abs(intersectionLongitude), Math.PI, CesiumMath.EPSILON14)) {
-            intersectionLongitude = CesiumMath.sign(start.longitude) * Math.PI;
-        }
-
-        if (!defined(result)) {
-            result = new Cartographic();
-        }
-
-        // If heading is -PI/2 or PI/2, this is an E-W rhumb line
-        // If heading is 0 or PI, this is an N-S rhumb line
-        if (Math.abs(CesiumMath.PI_OVER_TWO - absHeading) <= CesiumMath.EPSILON8) {
-            result.longitude = intersectionLongitude;
-            result.latitude = start.latitude;
-            result.height = 0;
-            return result;
-        } else if (CesiumMath.equalsEpsilon(Math.abs(CesiumMath.PI_OVER_TWO - absHeading), CesiumMath.PI_OVER_TWO, CesiumMath.EPSILON8)) {
-            if (CesiumMath.equalsEpsilon(intersectionLongitude, start.longitude, CesiumMath.EPSILON12)) {
-                return undefined;
-            }
-
-            result.longitude = intersectionLongitude;
-            result.latitude = CesiumMath.PI_OVER_TWO * CesiumMath.sign(CesiumMath.PI_OVER_TWO - heading);
-            result.height = 0;
-            return result;
-        }
-
-        // Use iterative solver from Equation 9 from http://edwilliams.org/ellipsoid/ellipsoid.pdf
-        var phi1 = start.latitude;
-        var eSinPhi1 = ellipticity * Math.sin(phi1);
-        var leftComponent = Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + phi1)) * Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));
-        var denominator = (1 + eSinPhi1) / (1 - eSinPhi1);
-
-        var newPhi = start.latitude;
-        var phi;
-        do {
-            phi = newPhi;
-            var eSinPhi = ellipticity * Math.sin(phi);
-            var numerator = (1 + eSinPhi) / (1 - eSinPhi);
-            newPhi = 2 * Math.atan(leftComponent * Math.pow(numerator / denominator, ellipticity / 2)) - CesiumMath.PI_OVER_TWO;
-        } while (!CesiumMath.equalsEpsilon(newPhi, phi, CesiumMath.EPSILON12));
-
-        result.longitude = intersectionLongitude;
-        result.latitude = newPhi;
-        result.height = 0;
-        return result;
-    };
-
-    /**
-     * Provides the location of a point at the indicated latitude along the rhumb line.
-     * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
-     *
-     * @param {Number} intersectionLatitude The latitude, in radians, at which to find the intersection point from the starting point using the heading.
-     * @param {Cartographic} [result] The object in which to store the result.
-     * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
-     *
-     * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.
-     */
-    EllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function(intersectionLatitude, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('intersectionLatitude', intersectionLatitude);
-        if (!defined(this._distance) || this._distance === 0.0) {
-            throw new DeveloperError('EllipsoidRhumbLine must have distinct start and end set.');
-        }
-        //>>includeEnd('debug');
-
-        var ellipticity = this._ellipticity;
-        var heading = this._heading;
-        var start = this._start;
-
-        // If start and end have same latitude, return undefined since it's either no intersection or infinite intersections
-        if (CesiumMath.equalsEpsilon(Math.abs(heading), CesiumMath.PI_OVER_TWO, CesiumMath.EPSILON8)) {
-            return;
-        }
-
-        // Can be solved using the same equations from interpolateUsingSurfaceDistance
-        var sigma1 = calculateSigma(ellipticity, start.latitude);
-        var sigma2 = calculateSigma(ellipticity, intersectionLatitude);
-        var deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
-        var longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);
-
-        if (defined(result)) {
-            result.longitude = longitude;
-            result.latitude = intersectionLatitude;
-            result.height = 0;
-
-            return result;
-        }
-
-        return new Cartographic(longitude, intersectionLatitude, 0);
-    };
-export default EllipsoidRhumbLine;

+ 0 - 333
Source/Core/EllipsoidTangentPlane.js

@@ -1,333 +0,0 @@
-import AxisAlignedBoundingBox from './AxisAlignedBoundingBox.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Cartesian4 from './Cartesian4.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-import IntersectionTests from './IntersectionTests.js';
-import Matrix4 from './Matrix4.js';
-import Plane from './Plane.js';
-import Ray from './Ray.js';
-import Transforms from './Transforms.js';
-
-    var scratchCart4 = new Cartesian4();
-    /**
-     * A plane tangent to the provided ellipsoid at the provided origin.
-     * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
-     * If origin is at the center of the ellipsoid, an exception will be thrown.
-     * @alias EllipsoidTangentPlane
-     * @constructor
-     *
-     * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
-     *
-     * @exception {DeveloperError} origin must not be at the center of the ellipsoid.
-     */
-    function EllipsoidTangentPlane(origin, ellipsoid) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('origin', origin);
-        //>>includeEnd('debug');
-
-        ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
-        origin = ellipsoid.scaleToGeodeticSurface(origin);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(origin)) {
-            throw new DeveloperError('origin must not be at the center of the ellipsoid.');
-        }
-        //>>includeEnd('debug');
-
-        var eastNorthUp = Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);
-        this._ellipsoid = ellipsoid;
-        this._origin = origin;
-        this._xAxis = Cartesian3.fromCartesian4(Matrix4.getColumn(eastNorthUp, 0, scratchCart4));
-        this._yAxis = Cartesian3.fromCartesian4(Matrix4.getColumn(eastNorthUp, 1, scratchCart4));
-
-        var normal = Cartesian3.fromCartesian4(Matrix4.getColumn(eastNorthUp, 2, scratchCart4));
-        this._plane = Plane.fromPointNormal(origin, normal);
-    }
-
-    defineProperties(EllipsoidTangentPlane.prototype, {
-        /**
-         * Gets the ellipsoid.
-         * @memberof EllipsoidTangentPlane.prototype
-         * @type {Ellipsoid}
-         */
-        ellipsoid : {
-            get : function() {
-                return this._ellipsoid;
-            }
-        },
-
-        /**
-         * Gets the origin.
-         * @memberof EllipsoidTangentPlane.prototype
-         * @type {Cartesian3}
-         */
-        origin : {
-            get : function() {
-                return this._origin;
-            }
-        },
-
-        /**
-         * Gets the plane which is tangent to the ellipsoid.
-         * @memberof EllipsoidTangentPlane.prototype
-         * @readonly
-         * @type {Plane}
-         */
-        plane : {
-            get : function() {
-                return this._plane;
-            }
-        },
-
-        /**
-         * Gets the local X-axis (east) of the tangent plane.
-         * @memberof EllipsoidTangentPlane.prototype
-         * @readonly
-         * @type {Cartesian3}
-         */
-        xAxis : {
-            get : function() {
-                return this._xAxis;
-            }
-        },
-
-        /**
-         * Gets the local Y-axis (north) of the tangent plane.
-         * @memberof EllipsoidTangentPlane.prototype
-         * @readonly
-         * @type {Cartesian3}
-         */
-        yAxis : {
-            get : function() {
-                return this._yAxis;
-            }
-        },
-
-        /**
-         * Gets the local Z-axis (up) of the tangent plane.
-         * @member EllipsoidTangentPlane.prototype
-         * @readonly
-         * @type {Cartesian3}
-         */
-        zAxis : {
-            get : function() {
-                return this._plane.normal;
-            }
-        }
-    });
-
-    var tmp = new AxisAlignedBoundingBox();
-    /**
-     * Creates a new instance from the provided ellipsoid and the center
-     * point of the provided Cartesians.
-     *
-     * @param {Cartesian3} cartesians The list of positions surrounding the center point.
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
-     */
-    EllipsoidTangentPlane.fromPoints = function(cartesians, ellipsoid) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesians', cartesians);
-        //>>includeEnd('debug');
-
-        var box = AxisAlignedBoundingBox.fromPoints(cartesians, tmp);
-        return new EllipsoidTangentPlane(box.center, ellipsoid);
-    };
-
-    var scratchProjectPointOntoPlaneRay = new Ray();
-    var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3();
-
-    /**
-     * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
-     *
-     * @param {Cartesian3} cartesian The point to project.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
-     */
-    EllipsoidTangentPlane.prototype.projectPointOntoPlane = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        var ray = scratchProjectPointOntoPlaneRay;
-        ray.origin = cartesian;
-        Cartesian3.normalize(cartesian, ray.direction);
-
-        var intersectionPoint = IntersectionTests.rayPlane(ray, this._plane, scratchProjectPointOntoPlaneCartesian3);
-        if (!defined(intersectionPoint)) {
-            Cartesian3.negate(ray.direction, ray.direction);
-            intersectionPoint = IntersectionTests.rayPlane(ray, this._plane, scratchProjectPointOntoPlaneCartesian3);
-        }
-
-        if (defined(intersectionPoint)) {
-            var v = Cartesian3.subtract(intersectionPoint, this._origin, intersectionPoint);
-            var x = Cartesian3.dot(this._xAxis, v);
-            var y = Cartesian3.dot(this._yAxis, v);
-
-            if (!defined(result)) {
-                return new Cartesian2(x, y);
-            }
-            result.x = x;
-            result.y = y;
-            return result;
-        }
-        return undefined;
-    };
-
-    /**
-     * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
-     * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
-     *
-     * @see EllipsoidTangentPlane.projectPointOntoPlane
-     *
-     * @param {Cartesian3[]} cartesians The array of points to project.
-     * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.
-     * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided.
-     */
-    EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function(cartesians, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesians', cartesians);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = [];
-        }
-
-        var count = 0;
-        var length = cartesians.length;
-        for ( var i = 0; i < length; i++) {
-            var p = this.projectPointOntoPlane(cartesians[i], result[count]);
-            if (defined(p)) {
-                result[count] = p;
-                count++;
-            }
-        }
-        result.length = count;
-        return result;
-    };
-
-    /**
-     * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
-     *
-     * @param {Cartesian3} cartesian The point to project.
-     * @param {Cartesian2} [result] The object onto which to store the result.
-     * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.
-     */
-    EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new Cartesian2();
-        }
-
-        var ray = scratchProjectPointOntoPlaneRay;
-        ray.origin = cartesian;
-        Cartesian3.clone(this._plane.normal, ray.direction);
-
-        var intersectionPoint = IntersectionTests.rayPlane(ray, this._plane, scratchProjectPointOntoPlaneCartesian3);
-        if (!defined(intersectionPoint)) {
-            Cartesian3.negate(ray.direction, ray.direction);
-            intersectionPoint = IntersectionTests.rayPlane(ray, this._plane, scratchProjectPointOntoPlaneCartesian3);
-        }
-
-        var v = Cartesian3.subtract(intersectionPoint, this._origin, intersectionPoint);
-        var x = Cartesian3.dot(this._xAxis, v);
-        var y = Cartesian3.dot(this._yAxis, v);
-
-        result.x = x;
-        result.y = y;
-        return result;
-    };
-
-    /**
-     * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
-     *
-     * @see EllipsoidTangentPlane.projectPointToNearestOnPlane
-     *
-     * @param {Cartesian3[]} cartesians The array of points to project.
-     * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.
-     * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as <code>cartesians</code>.
-     */
-    EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function(cartesians, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesians', cartesians);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = [];
-        }
-
-        var length = cartesians.length;
-        result.length = length;
-        for (var i = 0; i < length; i++) {
-            result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
-        }
-        return result;
-    };
-
-    var projectPointsOntoEllipsoidScratch = new Cartesian3();
-    /**
-     * Computes the projection of the provided 2D position onto the 3D ellipsoid.
-     *
-     * @param {Cartesian2} cartesian The points to project.
-     * @param {Cartesian3} [result] The Cartesian3 instance to store result.
-     * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
-     */
-    EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        var ellipsoid = this._ellipsoid;
-        var origin = this._origin;
-        var xAxis = this._xAxis;
-        var yAxis = this._yAxis;
-        var tmp = projectPointsOntoEllipsoidScratch;
-
-        Cartesian3.multiplyByScalar(xAxis, cartesian.x, tmp);
-        result = Cartesian3.add(origin, tmp, result);
-        Cartesian3.multiplyByScalar(yAxis, cartesian.y, tmp);
-        Cartesian3.add(result, tmp, result);
-        ellipsoid.scaleToGeocentricSurface(result, result);
-
-        return result;
-    };
-
-    /**
-     * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
-     *
-     * @param {Cartesian2[]} cartesians The array of points to project.
-     * @param {Cartesian3[]} [result] The array of Cartesian3 instances onto which to store results.
-     * @returns {Cartesian3[]} The modified result parameter or a new array of Cartesian3 instances if none was provided.
-     */
-    EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function(cartesians, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesians', cartesians);
-        //>>includeEnd('debug');
-
-        var length = cartesians.length;
-        if (!defined(result)) {
-            result = new Array(length);
-        } else {
-            result.length = length;
-        }
-
-        for ( var i = 0; i < length; ++i) {
-            result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
-        }
-
-        return result;
-    };
-export default EllipsoidTangentPlane;

+ 0 - 191
Source/Core/EllipsoidTerrainProvider.js

@@ -1,191 +0,0 @@
-import when from '../ThirdParty/when.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import Ellipsoid from './Ellipsoid.js';
-import Event from './Event.js';
-import GeographicTilingScheme from './GeographicTilingScheme.js';
-import HeightmapTerrainData from './HeightmapTerrainData.js';
-import TerrainProvider from './TerrainProvider.js';
-
-    /**
-     * A very simple {@link TerrainProvider} that produces geometry by tessellating an ellipsoidal
-     * surface.
-     *
-     * @alias EllipsoidTerrainProvider
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {TilingScheme} [options.tilingScheme] The tiling scheme specifying how the ellipsoidal
-     * surface is broken into tiles.  If this parameter is not provided, a {@link GeographicTilingScheme}
-     * is used.
-     * @param {Ellipsoid} [options.ellipsoid] The ellipsoid.  If the tilingScheme is specified,
-     * this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
-     * parameter is specified, the WGS84 ellipsoid is used.
-     *
-     * @see TerrainProvider
-     */
-    function EllipsoidTerrainProvider(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        this._tilingScheme = options.tilingScheme;
-        if (!defined(this._tilingScheme)) {
-            this._tilingScheme = new GeographicTilingScheme({
-                ellipsoid : defaultValue(options.ellipsoid, Ellipsoid.WGS84)
-            });
-        }
-
-        // Note: the 64 below does NOT need to match the actual vertex dimensions, because
-        // the ellipsoid is significantly smoother than actual terrain.
-        this._levelZeroMaximumGeometricError = TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid, 64, this._tilingScheme.getNumberOfXTilesAtLevel(0));
-
-        this._errorEvent = new Event();
-        this._readyPromise = when.resolve(true);
-    }
-
-    defineProperties(EllipsoidTerrainProvider.prototype, {
-        /**
-         * Gets an event that is raised when the terrain provider encounters an asynchronous error.  By subscribing
-         * to the event, you will be notified of the error and can potentially recover from it.  Event listeners
-         * are passed an instance of {@link TileProviderError}.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {Event}
-         */
-        errorEvent : {
-            get : function() {
-                return this._errorEvent;
-            }
-        },
-
-        /**
-         * Gets the credit to display when this terrain provider is active.  Typically this is used to credit
-         * the source of the terrain.  This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {Credit}
-         */
-        credit : {
-            get : function() {
-                return undefined;
-            }
-        },
-
-        /**
-         * Gets the tiling scheme used by this provider.  This function should
-         * not be called before {@link EllipsoidTerrainProvider#ready} returns true.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {GeographicTilingScheme}
-         */
-        tilingScheme : {
-            get : function() {
-                return this._tilingScheme;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the provider is ready for use.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        ready : {
-            get : function() {
-                return true;
-            }
-        },
-
-        /**
-         * Gets a promise that resolves to true when the provider is ready for use.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {Promise.<Boolean>}
-         * @readonly
-         */
-        readyPromise : {
-            get : function() {
-                return this._readyPromise;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the provider includes a water mask.  The water mask
-         * indicates which areas of the globe are water rather than land, so they can be rendered
-         * as a reflective surface with animated waves.  This function should not be
-         * called before {@link EllipsoidTerrainProvider#ready} returns true.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        hasWaterMask : {
-            get : function() {
-                return false;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the requested tiles include vertex normals.
-         * This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
-         * @memberof EllipsoidTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        hasVertexNormals : {
-            get : function() {
-                return false;
-            }
-        }
-    });
-
-    /**
-     * Requests the geometry for a given tile.  This function should not be called before
-     * {@link TerrainProvider#ready} returns true.  The result includes terrain
-     * data and indicates that all child tiles are available.
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @param {Request} [request] The request object. Intended for internal use only.
-     *
-     * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry.  If this method
-     *          returns undefined instead of a promise, it is an indication that too many requests are already
-     *          pending and the request will be retried later.
-     */
-    EllipsoidTerrainProvider.prototype.requestTileGeometry = function(x, y, level, request) {
-        var width = 16;
-        var height = 16;
-        return when.resolve(new HeightmapTerrainData({
-            buffer : new Uint8Array(width * height),
-            width : width,
-            height : height
-        }));
-    };
-
-    /**
-     * Gets the maximum geometric error allowed in a tile at a given level.
-     *
-     * @param {Number} level The tile level for which to get the maximum geometric error.
-     * @returns {Number} The maximum geometric error.
-     */
-    EllipsoidTerrainProvider.prototype.getLevelMaximumGeometricError = function(level) {
-        return this._levelZeroMaximumGeometricError / (1 << level);
-    };
-
-    /**
-     * Determines whether data for a tile is available to be loaded.
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @returns {Boolean} Undefined if not supported, otherwise true or false.
-     */
-    EllipsoidTerrainProvider.prototype.getTileDataAvailable = function(x, y, level) {
-        return undefined;
-    };
-
-    /**
-     * Makes sure we load availability data for a tile
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
-     */
-    EllipsoidTerrainProvider.prototype.loadTileDataAvailability = function(x, y, level) {
-        return undefined;
-    };
-export default EllipsoidTerrainProvider;

+ 0 - 290
Source/Core/EllipsoidalOccluder.js

@@ -1,290 +0,0 @@
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import Rectangle from './Rectangle.js';
-
-    /**
-     * Determine whether or not other objects are visible or hidden behind the visible horizon defined by
-     * an {@link Ellipsoid} and a camera position.  The ellipsoid is assumed to be located at the
-     * origin of the coordinate system.  This class uses the algorithm described in the
-     * {@link https://cesium.com/blog/2013/04/25/Horizon-culling/|Horizon Culling} blog post.
-     *
-     * @alias EllipsoidalOccluder
-     *
-     * @param {Ellipsoid} ellipsoid The ellipsoid to use as an occluder.
-     * @param {Cartesian3} [cameraPosition] The coordinate of the viewer/camera.  If this parameter is not
-     *        specified, {@link EllipsoidalOccluder#cameraPosition} must be called before
-     *        testing visibility.
-     *
-     * @constructor
-     *
-     * @example
-     * // Construct an ellipsoidal occluder with radii 1.0, 1.1, and 0.9.
-     * var cameraPosition = new Cesium.Cartesian3(5.0, 6.0, 7.0);
-     * var occluderEllipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);
-     * var occluder = new Cesium.EllipsoidalOccluder(occluderEllipsoid, cameraPosition);
-     *
-     * @private
-     */
-    function EllipsoidalOccluder(ellipsoid, cameraPosition) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('ellipsoid', ellipsoid);
-        //>>includeEnd('debug');
-
-        this._ellipsoid = ellipsoid;
-        this._cameraPosition = new Cartesian3();
-        this._cameraPositionInScaledSpace = new Cartesian3();
-        this._distanceToLimbInScaledSpaceSquared = 0.0;
-
-        // cameraPosition fills in the above values
-        if (defined(cameraPosition)) {
-            this.cameraPosition = cameraPosition;
-        }
-    }
-
-    defineProperties(EllipsoidalOccluder.prototype, {
-        /**
-         * Gets the occluding ellipsoid.
-         * @memberof EllipsoidalOccluder.prototype
-         * @type {Ellipsoid}
-         */
-        ellipsoid : {
-            get: function() {
-                return this._ellipsoid;
-            }
-        },
-        /**
-         * Gets or sets the position of the camera.
-         * @memberof EllipsoidalOccluder.prototype
-         * @type {Cartesian3}
-         */
-        cameraPosition : {
-            get : function() {
-                return this._cameraPosition;
-            },
-            set : function(cameraPosition) {
-                // See https://cesium.com/blog/2013/04/25/Horizon-culling/
-                var ellipsoid = this._ellipsoid;
-                var cv = ellipsoid.transformPositionToScaledSpace(cameraPosition, this._cameraPositionInScaledSpace);
-                var vhMagnitudeSquared = Cartesian3.magnitudeSquared(cv) - 1.0;
-
-                Cartesian3.clone(cameraPosition, this._cameraPosition);
-                this._cameraPositionInScaledSpace = cv;
-                this._distanceToLimbInScaledSpaceSquared = vhMagnitudeSquared;
-            }
-        }
-    });
-
-    var scratchCartesian = new Cartesian3();
-
-    /**
-     * Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
-     *
-     * @param {Cartesian3} occludee The point to test for visibility.
-     * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.
-     *
-     * @example
-     * var cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);
-     * var ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);
-     * var occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);
-     * var point = new Cesium.Cartesian3(0, -3, -3);
-     * occluder.isPointVisible(point); //returns true
-     */
-    EllipsoidalOccluder.prototype.isPointVisible = function(occludee) {
-        var ellipsoid = this._ellipsoid;
-        var occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace(occludee, scratchCartesian);
-        return this.isScaledSpacePointVisible(occludeeScaledSpacePosition);
-    };
-
-    /**
-     * Determines whether or not a point expressed in the ellipsoid scaled space, is hidden from view by the
-     * occluder.  To transform a Cartesian X, Y, Z position in the coordinate system aligned with the ellipsoid
-     * into the scaled space, call {@link Ellipsoid#transformPositionToScaledSpace}.
-     *
-     * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space.
-     * @returns {Boolean} <code>true</code> if the occludee is visible; otherwise <code>false</code>.
-     *
-     * @example
-     * var cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);
-     * var ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);
-     * var occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);
-     * var point = new Cesium.Cartesian3(0, -3, -3);
-     * var scaledSpacePoint = ellipsoid.transformPositionToScaledSpace(point);
-     * occluder.isScaledSpacePointVisible(scaledSpacePoint); //returns true
-     */
-    EllipsoidalOccluder.prototype.isScaledSpacePointVisible = function(occludeeScaledSpacePosition) {
-        // See https://cesium.com/blog/2013/04/25/Horizon-culling/
-        var cv = this._cameraPositionInScaledSpace;
-        var vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared;
-        var vt = Cartesian3.subtract(occludeeScaledSpacePosition, cv, scratchCartesian);
-        var vtDotVc = -Cartesian3.dot(vt, cv);
-        // If vhMagnitudeSquared < 0 then we are below the surface of the ellipsoid and
-        // in this case, set the culling plane to be on V.
-        var isOccluded = vhMagnitudeSquared < 0 ? vtDotVc > 0 : (vtDotVc > vhMagnitudeSquared &&
-                         vtDotVc * vtDotVc / Cartesian3.magnitudeSquared(vt) > vhMagnitudeSquared);
-        return !isOccluded;
-    };
-
-    /**
-     * Computes a point that can be used for horizon culling from a list of positions.  If the point is below
-     * the horizon, all of the positions are guaranteed to be below the horizon as well.  The returned point
-     * is expressed in the ellipsoid-scaled space and is suitable for use with
-     * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.
-     *
-     * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.
-     *                     A reasonable direction to use is the direction from the center of the ellipsoid to
-     *                     the center of the bounding sphere computed from the positions.  The direction need not
-     *                     be normalized.
-     * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point.  The positions
-     *                       must be expressed in a reference frame centered at the ellipsoid and aligned with the
-     *                       ellipsoid's axes.
-     * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
-     * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.
-     */
-    EllipsoidalOccluder.prototype.computeHorizonCullingPoint = function(directionToPoint, positions, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('directionToPoint', directionToPoint);
-        Check.defined('positions', positions);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        var ellipsoid = this._ellipsoid;
-        var scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint);
-        var resultMagnitude = 0.0;
-
-        for (var i = 0, len = positions.length; i < len; ++i) {
-            var position = positions[i];
-            var candidateMagnitude = computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint);
-            resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);
-        }
-
-        return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);
-    };
-
-    var positionScratch = new Cartesian3();
-
-    /**
-     * Computes a point that can be used for horizon culling from a list of positions.  If the point is below
-     * the horizon, all of the positions are guaranteed to be below the horizon as well.  The returned point
-     * is expressed in the ellipsoid-scaled space and is suitable for use with
-     * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.
-     *
-     * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.
-     *                     A reasonable direction to use is the direction from the center of the ellipsoid to
-     *                     the center of the bounding sphere computed from the positions.  The direction need not
-     *                     be normalized.
-     * @param {Number[]} vertices  The vertices from which to compute the horizon culling point.  The positions
-     *                   must be expressed in a reference frame centered at the ellipsoid and aligned with the
-     *                   ellipsoid's axes.
-     * @param {Number} [stride=3]
-     * @param {Cartesian3} [center=Cartesian3.ZERO]
-     * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
-     * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.
-     */
-    EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function(directionToPoint, vertices, stride, center, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('directionToPoint', directionToPoint);
-        Check.defined('vertices', vertices);
-        Check.typeOf.number('stride', stride);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new Cartesian3();
-        }
-
-        center = defaultValue(center, Cartesian3.ZERO);
-        var ellipsoid = this._ellipsoid;
-        var scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint);
-        var resultMagnitude = 0.0;
-
-        for (var i = 0, len = vertices.length; i < len; i += stride) {
-            positionScratch.x = vertices[i] + center.x;
-            positionScratch.y = vertices[i + 1] + center.y;
-            positionScratch.z = vertices[i + 2] + center.z;
-
-            var candidateMagnitude = computeMagnitude(ellipsoid, positionScratch, scaledSpaceDirectionToPoint);
-            resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);
-        }
-
-        return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);
-    };
-
-    var subsampleScratch = [];
-
-    /**
-     * Computes a point that can be used for horizon culling of a rectangle.  If the point is below
-     * the horizon, the ellipsoid-conforming rectangle is guaranteed to be below the horizon as well.
-     * The returned point is expressed in the ellipsoid-scaled space and is suitable for use with
-     * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.
-     *
-     * @param {Rectangle} rectangle The rectangle for which to compute the horizon culling point.
-     * @param {Ellipsoid} ellipsoid The ellipsoid on which the rectangle is defined.  This may be different from
-     *                    the ellipsoid used by this instance for occlusion testing.
-     * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
-     * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.
-     */
-    EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function(rectangle, ellipsoid, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('rectangle', rectangle);
-        //>>includeEnd('debug');
-
-        var positions = Rectangle.subsample(rectangle, ellipsoid, 0.0, subsampleScratch);
-        var bs = BoundingSphere.fromPoints(positions);
-
-        // If the bounding sphere center is too close to the center of the occluder, it doesn't make
-        // sense to try to horizon cull it.
-        if (Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) {
-            return undefined;
-        }
-
-        return this.computeHorizonCullingPoint(bs.center, positions, result);
-    };
-
-    var scaledSpaceScratch = new Cartesian3();
-    var directionScratch = new Cartesian3();
-
-    function computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) {
-        var scaledSpacePosition = ellipsoid.transformPositionToScaledSpace(position, scaledSpaceScratch);
-        var magnitudeSquared = Cartesian3.magnitudeSquared(scaledSpacePosition);
-        var magnitude = Math.sqrt(magnitudeSquared);
-        var direction = Cartesian3.divideByScalar(scaledSpacePosition, magnitude, directionScratch);
-
-        // For the purpose of this computation, points below the ellipsoid are consider to be on it instead.
-        magnitudeSquared = Math.max(1.0, magnitudeSquared);
-        magnitude = Math.max(1.0, magnitude);
-
-        var cosAlpha = Cartesian3.dot(direction, scaledSpaceDirectionToPoint);
-        var sinAlpha = Cartesian3.magnitude(Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction));
-        var cosBeta = 1.0 / magnitude;
-        var sinBeta = Math.sqrt(magnitudeSquared - 1.0) * cosBeta;
-
-        return 1.0 / (cosAlpha * cosBeta - sinAlpha * sinBeta);
-    }
-
-    function magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result) {
-        // The horizon culling point is undefined if there were no positions from which to compute it,
-        // the directionToPoint is pointing opposite all of the positions,  or if we computed NaN or infinity.
-        if (resultMagnitude <= 0.0 || resultMagnitude === 1.0 / 0.0 || resultMagnitude !== resultMagnitude) {
-            return undefined;
-        }
-
-        return Cartesian3.multiplyByScalar(scaledSpaceDirectionToPoint, resultMagnitude, result);
-    }
-
-    var directionToPointScratch = new Cartesian3();
-
-    function computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) {
-        if (Cartesian3.equals(directionToPoint, Cartesian3.ZERO)) {
-            return directionToPoint;
-        }
-
-        ellipsoid.transformPositionToScaledSpace(directionToPoint, directionToPointScratch);
-        return Cartesian3.normalize(directionToPointScratch, directionToPointScratch);
-    }
-export default EllipsoidalOccluder;

+ 0 - 170
Source/Core/EncodedCartesian3.js

@@ -1,170 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defined from './defined.js';
-
-    /**
-     * A fixed-point encoding of a {@link Cartesian3} with 64-bit floating-point components, as two {@link Cartesian3}
-     * values that, when converted to 32-bit floating-point and added, approximate the original input.
-     * <p>
-     * This is used to encode positions in vertex buffers for rendering without jittering artifacts
-     * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
-     * </p>
-     *
-     * @alias EncodedCartesian3
-     * @constructor
-     *
-     * @private
-     */
-    function EncodedCartesian3() {
-        /**
-         * The high bits for each component.  Bits 0 to 22 store the whole value.  Bits 23 to 31 are not used.
-         *
-         * @type {Cartesian3}
-         * @default {@link Cartesian3.ZERO}
-         */
-        this.high = Cartesian3.clone(Cartesian3.ZERO);
-
-        /**
-         * The low bits for each component.  Bits 7 to 22 store the whole value, and bits 0 to 6 store the fraction.  Bits 23 to 31 are not used.
-         *
-         * @type {Cartesian3}
-         * @default {@link Cartesian3.ZERO}
-         */
-        this.low = Cartesian3.clone(Cartesian3.ZERO);
-    }
-
-    /**
-     * Encodes a 64-bit floating-point value as two floating-point values that, when converted to
-     * 32-bit floating-point and added, approximate the original input.  The returned object
-     * has <code>high</code> and <code>low</code> properties for the high and low bits, respectively.
-     * <p>
-     * The fixed-point encoding follows {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
-     * </p>
-     *
-     * @param {Number} value The floating-point value to encode.
-     * @param {Object} [result] The object onto which to store the result.
-     * @returns {Object} The modified result parameter or a new instance if one was not provided.
-     *
-     * @example
-     * var value = 1234567.1234567;
-     * var splitValue = Cesium.EncodedCartesian3.encode(value);
-     */
-    EncodedCartesian3.encode = function(value, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('value', value);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = {
-                high : 0.0,
-                low : 0.0
-            };
-        }
-
-        var doubleHigh;
-        if (value >= 0.0) {
-            doubleHigh = Math.floor(value / 65536.0) * 65536.0;
-            result.high = doubleHigh;
-            result.low = value - doubleHigh;
-        } else {
-            doubleHigh = Math.floor(-value / 65536.0) * 65536.0;
-            result.high = -doubleHigh;
-            result.low = value + doubleHigh;
-        }
-
-        return result;
-    };
-
-    var scratchEncode = {
-        high : 0.0,
-        low : 0.0
-    };
-
-    /**
-     * Encodes a {@link Cartesian3} with 64-bit floating-point components as two {@link Cartesian3}
-     * values that, when converted to 32-bit floating-point and added, approximate the original input.
-     * <p>
-     * The fixed-point encoding follows {@link http://blogs.agi.com/insight3d/index.php/2008/09/03/precisions-precisions/|Precisions, Precisions}.
-     * </p>
-     *
-     * @param {Cartesian3} cartesian The cartesian to encode.
-     * @param {EncodedCartesian3} [result] The object onto which to store the result.
-     * @returns {EncodedCartesian3} The modified result parameter or a new EncodedCartesian3 instance if one was not provided.
-     *
-     * @example
-     * var cart = new Cesium.Cartesian3(-10000000.0, 0.0, 10000000.0);
-     * var encoded = Cesium.EncodedCartesian3.fromCartesian(cart);
-     */
-    EncodedCartesian3.fromCartesian = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('cartesian', cartesian);
-        //>>includeEnd('debug');
-
-        if (!defined(result)) {
-            result = new EncodedCartesian3();
-        }
-
-        var high = result.high;
-        var low = result.low;
-
-        EncodedCartesian3.encode(cartesian.x, scratchEncode);
-        high.x = scratchEncode.high;
-        low.x = scratchEncode.low;
-
-        EncodedCartesian3.encode(cartesian.y, scratchEncode);
-        high.y = scratchEncode.high;
-        low.y = scratchEncode.low;
-
-        EncodedCartesian3.encode(cartesian.z, scratchEncode);
-        high.z = scratchEncode.high;
-        low.z = scratchEncode.low;
-
-        return result;
-    };
-
-    var encodedP = new EncodedCartesian3();
-
-    /**
-     * Encodes the provided <code>cartesian</code>, and writes it to an array with <code>high</code>
-     * components followed by <code>low</code> components, i.e. <code>[high.x, high.y, high.z, low.x, low.y, low.z]</code>.
-     * <p>
-     * This is used to create interleaved high-precision position vertex attributes.
-     * </p>
-     *
-     * @param {Cartesian3} cartesian The cartesian to encode.
-     * @param {Number[]} cartesianArray The array to write to.
-     * @param {Number} index The index into the array to start writing.  Six elements will be written.
-     *
-     * @exception {DeveloperError} index must be a number greater than or equal to 0.
-     *
-     * @example
-     * var positions = [
-     *    new Cesium.Cartesian3(),
-     *    // ...
-     * ];
-     * var encodedPositions = new Float32Array(2 * 3 * positions.length);
-     * var j = 0;
-     * for (var i = 0; i < positions.length; ++i) {
-     *   Cesium.EncodedCartesian3.writeElement(positions[i], encodedPositions, j);
-     *   j += 6;
-     * }
-     */
-    EncodedCartesian3.writeElements = function(cartesian, cartesianArray, index) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('cartesianArray', cartesianArray);
-        Check.typeOf.number('index', index);
-        Check.typeOf.number.greaterThanOrEquals('index', index, 0);
-        //>>includeEnd('debug');
-
-        EncodedCartesian3.fromCartesian(cartesian, encodedP);
-        var high = encodedP.high;
-        var low = encodedP.low;
-
-        cartesianArray[index] = high.x;
-        cartesianArray[index + 1] = high.y;
-        cartesianArray[index + 2] = high.z;
-        cartesianArray[index + 3] = low.x;
-        cartesianArray[index + 4] = low.y;
-        cartesianArray[index + 5] = low.z;
-    };
-export default EncodedCartesian3;

+ 0 - 163
Source/Core/Event.js

@@ -1,163 +0,0 @@
-import Check from './Check.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-
-    /**
-     * A generic utility class for managing subscribers for a particular event.
-     * This class is usually instantiated inside of a container class and
-     * exposed as a property for others to subscribe to.
-     *
-     * @alias Event
-     * @constructor
-     * @example
-     * MyObject.prototype.myListener = function(arg1, arg2) {
-     *     this.myArg1Copy = arg1;
-     *     this.myArg2Copy = arg2;
-     * }
-     *
-     * var myObjectInstance = new MyObject();
-     * var evt = new Cesium.Event();
-     * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
-     * evt.raiseEvent('1', '2');
-     * evt.removeEventListener(MyObject.prototype.myListener);
-     */
-    function Event() {
-        this._listeners = [];
-        this._scopes = [];
-        this._toRemove = [];
-        this._insideRaiseEvent = false;
-    }
-
-    defineProperties(Event.prototype, {
-        /**
-         * The number of listeners currently subscribed to the event.
-         * @memberof Event.prototype
-         * @type {Number}
-         * @readonly
-         */
-        numberOfListeners : {
-            get : function() {
-                return this._listeners.length - this._toRemove.length;
-            }
-        }
-    });
-
-    /**
-     * Registers a callback function to be executed whenever the event is raised.
-     * An optional scope can be provided to serve as the <code>this</code> pointer
-     * in which the function will execute.
-     *
-     * @param {Function} listener The function to be executed when the event is raised.
-     * @param {Object} [scope] An optional object scope to serve as the <code>this</code>
-     *        pointer in which the listener function will execute.
-     * @returns {Event~RemoveCallback} A function that will remove this event listener when invoked.
-     *
-     * @see Event#raiseEvent
-     * @see Event#removeEventListener
-     */
-    Event.prototype.addEventListener = function(listener, scope) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.func('listener', listener);
-        //>>includeEnd('debug');
-
-        this._listeners.push(listener);
-        this._scopes.push(scope);
-
-        var event = this;
-        return function() {
-            event.removeEventListener(listener, scope);
-        };
-    };
-
-    /**
-     * Unregisters a previously registered callback.
-     *
-     * @param {Function} listener The function to be unregistered.
-     * @param {Object} [scope] The scope that was originally passed to addEventListener.
-     * @returns {Boolean} <code>true</code> if the listener was removed; <code>false</code> if the listener and scope are not registered with the event.
-     *
-     * @see Event#addEventListener
-     * @see Event#raiseEvent
-     */
-    Event.prototype.removeEventListener = function(listener, scope) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.func('listener', listener);
-        //>>includeEnd('debug');
-
-        var listeners = this._listeners;
-        var scopes = this._scopes;
-
-        var index = -1;
-        for (var i = 0; i < listeners.length; i++) {
-            if (listeners[i] === listener && scopes[i] === scope) {
-                index = i;
-                break;
-            }
-        }
-
-        if (index !== -1) {
-            if (this._insideRaiseEvent) {
-                //In order to allow removing an event subscription from within
-                //a callback, we don't actually remove the items here.  Instead
-                //remember the index they are at and undefined their value.
-                this._toRemove.push(index);
-                listeners[index] = undefined;
-                scopes[index] = undefined;
-            } else {
-                listeners.splice(index, 1);
-                scopes.splice(index, 1);
-            }
-            return true;
-        }
-
-        return false;
-    };
-
-    function compareNumber(a,b) {
-        return b - a;
-    }
-
-    /**
-     * Raises the event by calling each registered listener with all supplied arguments.
-     *
-     * @param {*} arguments This method takes any number of parameters and passes them through to the listener functions.
-     *
-     * @see Event#addEventListener
-     * @see Event#removeEventListener
-     */
-    Event.prototype.raiseEvent = function() {
-        this._insideRaiseEvent = true;
-
-        var i;
-        var listeners = this._listeners;
-        var scopes = this._scopes;
-        var length = listeners.length;
-
-        for (i = 0; i < length; i++) {
-            var listener = listeners[i];
-            if (defined(listener)) {
-                listeners[i].apply(scopes[i], arguments);
-            }
-        }
-
-        //Actually remove items removed in removeEventListener.
-        var toRemove = this._toRemove;
-        length = toRemove.length;
-        if (length > 0) {
-            toRemove.sort(compareNumber);
-            for (i = 0; i < length; i++) {
-                var index = toRemove[i];
-                listeners.splice(index, 1);
-                scopes.splice(index, 1);
-            }
-            toRemove.length = 0;
-        }
-
-        this._insideRaiseEvent = false;
-    };
-
-    /**
-     * A function that removes a listener.
-     * @callback Event~RemoveCallback
-     */
-export default Event;

+ 0 - 74
Source/Core/EventHelper.js

@@ -1,74 +0,0 @@
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * A convenience object that simplifies the common pattern of attaching event listeners
-     * to several events, then removing all those listeners at once later, for example, in
-     * a destroy method.
-     *
-     * @alias EventHelper
-     * @constructor
-     *
-     *
-     * @example
-     * var helper = new Cesium.EventHelper();
-     *
-     * helper.add(someObject.event, listener1, this);
-     * helper.add(otherObject.event, listener2, this);
-     *
-     * // later...
-     * helper.removeAll();
-     *
-     * @see Event
-     */
-    function EventHelper() {
-        this._removalFunctions = [];
-    }
-
-    /**
-     * Adds a listener to an event, and records the registration to be cleaned up later.
-     *
-     * @param {Event} event The event to attach to.
-     * @param {Function} listener The function to be executed when the event is raised.
-     * @param {Object} [scope] An optional object scope to serve as the <code>this</code>
-     *        pointer in which the listener function will execute.
-     * @returns {EventHelper~RemoveCallback} A function that will remove this event listener when invoked.
-     *
-     * @see Event#addEventListener
-     */
-    EventHelper.prototype.add = function(event, listener, scope) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(event)) {
-            throw new DeveloperError('event is required');
-        }
-        //>>includeEnd('debug');
-
-        var removalFunction = event.addEventListener(listener, scope);
-        this._removalFunctions.push(removalFunction);
-
-        var that = this;
-        return function() {
-            removalFunction();
-            var removalFunctions = that._removalFunctions;
-            removalFunctions.splice(removalFunctions.indexOf(removalFunction), 1);
-        };
-    };
-
-    /**
-     * Unregisters all previously added listeners.
-     *
-     * @see Event#removeEventListener
-     */
-    EventHelper.prototype.removeAll = function() {
-        var removalFunctions = this._removalFunctions;
-        for (var i = 0, len = removalFunctions.length; i < len; ++i) {
-            removalFunctions[i]();
-        }
-        removalFunctions.length = 0;
-    };
-
-    /**
-     * A function that removes a listener.
-     * @callback EventHelper~RemoveCallback
-     */
-export default EventHelper;

+ 0 - 36
Source/Core/ExtrapolationType.js

@@ -1,36 +0,0 @@
-import freezeObject from './freezeObject.js';
-
-    /**
-     * Constants to determine how an interpolated value is extrapolated
-     * when querying outside the bounds of available data.
-     *
-     * @exports ExtrapolationType
-     *
-     * @see SampledProperty
-     */
-    var ExtrapolationType = {
-        /**
-         * No extrapolation occurs.
-         *
-         * @type {Number}
-         * @constant
-         */
-        NONE : 0,
-
-        /**
-         * The first or last value is used when outside the range of sample data.
-         *
-         * @type {Number}
-         * @constant
-         */
-        HOLD : 1,
-
-        /**
-         * The value is extrapolated.
-         *
-         * @type {Number}
-         * @constant
-         */
-        EXTRAPOLATE : 2
-    };
-export default freezeObject(ExtrapolationType);

+ 0 - 333
Source/Core/FeatureDetection.js

@@ -1,333 +0,0 @@
-import when from '../ThirdParty/when.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Fullscreen from './Fullscreen.js';
-    /*global CanvasPixelArray*/
-
-    var theNavigator;
-    if (typeof navigator !== 'undefined') {
-        theNavigator = navigator;
-    } else {
-        theNavigator = {};
-    }
-
-    function extractVersion(versionString) {
-        var parts = versionString.split('.');
-        for (var i = 0, len = parts.length; i < len; ++i) {
-            parts[i] = parseInt(parts[i], 10);
-        }
-        return parts;
-    }
-
-    var isChromeResult;
-    var chromeVersionResult;
-    function isChrome() {
-        if (!defined(isChromeResult)) {
-            isChromeResult = false;
-            // Edge contains Chrome in the user agent too
-            if (!isEdge()) {
-                var fields = (/ Chrome\/([\.0-9]+)/).exec(theNavigator.userAgent);
-                if (fields !== null) {
-                    isChromeResult = true;
-                    chromeVersionResult = extractVersion(fields[1]);
-                }
-            }
-        }
-
-        return isChromeResult;
-    }
-
-    function chromeVersion() {
-        return isChrome() && chromeVersionResult;
-    }
-
-    var isSafariResult;
-    var safariVersionResult;
-    function isSafari() {
-        if (!defined(isSafariResult)) {
-            isSafariResult = false;
-
-            // Chrome and Edge contain Safari in the user agent too
-            if (!isChrome() && !isEdge() && (/ Safari\/[\.0-9]+/).test(theNavigator.userAgent)) {
-                var fields = (/ Version\/([\.0-9]+)/).exec(theNavigator.userAgent);
-                if (fields !== null) {
-                    isSafariResult = true;
-                    safariVersionResult = extractVersion(fields[1]);
-                }
-            }
-        }
-
-        return isSafariResult;
-    }
-
-    function safariVersion() {
-        return isSafari() && safariVersionResult;
-    }
-
-    var isWebkitResult;
-    var webkitVersionResult;
-    function isWebkit() {
-        if (!defined(isWebkitResult)) {
-            isWebkitResult = false;
-
-            var fields = (/ AppleWebKit\/([\.0-9]+)(\+?)/).exec(theNavigator.userAgent);
-            if (fields !== null) {
-                isWebkitResult = true;
-                webkitVersionResult = extractVersion(fields[1]);
-                webkitVersionResult.isNightly = !!fields[2];
-            }
-        }
-
-        return isWebkitResult;
-    }
-
-    function webkitVersion() {
-        return isWebkit() && webkitVersionResult;
-    }
-
-    var isInternetExplorerResult;
-    var internetExplorerVersionResult;
-    function isInternetExplorer() {
-        if (!defined(isInternetExplorerResult)) {
-            isInternetExplorerResult = false;
-
-            var fields;
-            if (theNavigator.appName === 'Microsoft Internet Explorer') {
-                fields = /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(theNavigator.userAgent);
-                if (fields !== null) {
-                    isInternetExplorerResult = true;
-                    internetExplorerVersionResult = extractVersion(fields[1]);
-                }
-            } else if (theNavigator.appName === 'Netscape') {
-                fields = /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(theNavigator.userAgent);
-                if (fields !== null) {
-                    isInternetExplorerResult = true;
-                    internetExplorerVersionResult = extractVersion(fields[1]);
-                }
-            }
-        }
-        return isInternetExplorerResult;
-    }
-
-    function internetExplorerVersion() {
-        return isInternetExplorer() && internetExplorerVersionResult;
-    }
-
-    var isEdgeResult;
-    var edgeVersionResult;
-    function isEdge() {
-        if (!defined(isEdgeResult)) {
-            isEdgeResult = false;
-            var fields = (/ Edge\/([\.0-9]+)/).exec(theNavigator.userAgent);
-            if (fields !== null) {
-                isEdgeResult = true;
-                edgeVersionResult = extractVersion(fields[1]);
-            }
-        }
-        return isEdgeResult;
-    }
-
-    function edgeVersion() {
-        return isEdge() && edgeVersionResult;
-    }
-
-    var isFirefoxResult;
-    var firefoxVersionResult;
-    function isFirefox() {
-        if (!defined(isFirefoxResult)) {
-            isFirefoxResult = false;
-
-            var fields = /Firefox\/([\.0-9]+)/.exec(theNavigator.userAgent);
-            if (fields !== null) {
-                isFirefoxResult = true;
-                firefoxVersionResult = extractVersion(fields[1]);
-            }
-        }
-        return isFirefoxResult;
-    }
-
-    var isWindowsResult;
-    function isWindows() {
-        if (!defined(isWindowsResult)) {
-            isWindowsResult = /Windows/i.test(theNavigator.appVersion);
-        }
-        return isWindowsResult;
-    }
-
-    function firefoxVersion() {
-        return isFirefox() && firefoxVersionResult;
-    }
-
-    var hasPointerEvents;
-    function supportsPointerEvents() {
-        if (!defined(hasPointerEvents)) {
-            //While navigator.pointerEnabled is deprecated in the W3C specification
-            //we still need to use it if it exists in order to support browsers
-            //that rely on it, such as the Windows WebBrowser control which defines
-            //PointerEvent but sets navigator.pointerEnabled to false.
-
-            //Firefox disabled because of https://github.com/AnalyticalGraphicsInc/cesium/issues/6372
-            hasPointerEvents = !isFirefox() && typeof PointerEvent !== 'undefined' && (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);
-        }
-        return hasPointerEvents;
-    }
-
-    var imageRenderingValueResult;
-    var supportsImageRenderingPixelatedResult;
-    function supportsImageRenderingPixelated() {
-        if (!defined(supportsImageRenderingPixelatedResult)) {
-            var canvas = document.createElement('canvas');
-            canvas.setAttribute('style',
-                                'image-rendering: -moz-crisp-edges;' +
-                                'image-rendering: pixelated;');
-            //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.
-            var tmp = canvas.style.imageRendering;
-            supportsImageRenderingPixelatedResult = defined(tmp) && tmp !== '';
-            if (supportsImageRenderingPixelatedResult) {
-                imageRenderingValueResult = tmp;
-            }
-        }
-        return supportsImageRenderingPixelatedResult;
-    }
-
-    function imageRenderingValue() {
-        return supportsImageRenderingPixelated() ? imageRenderingValueResult : undefined;
-    }
-
-    function supportsWebP() {
-        //>>includeStart('debug', pragmas.debug);
-        if (!supportsWebP.initialized) {
-            throw new DeveloperError('You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP');
-        }
-        //>>includeEnd('debug');
-        return supportsWebP._result;
-    }
-    supportsWebP._promise = undefined;
-    supportsWebP._result = undefined;
-    supportsWebP.initialize = function() {
-        // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp
-        if (defined(supportsWebP._promise)) {
-            return supportsWebP._promise;
-        }
-
-        var supportsWebPDeferred = when.defer();
-        supportsWebP._promise = supportsWebPDeferred.promise;
-        if (isEdge()) {
-            // Edge's WebP support with WebGL is incomplete.
-            // See bug report: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/19221241/
-            supportsWebP._result = false;
-            supportsWebPDeferred.resolve(supportsWebP._result);
-            return supportsWebPDeferred.promise;
-        }
-
-        var image = new Image();
-        image.onload = function () {
-            supportsWebP._result = (image.width > 0) && (image.height > 0);
-            supportsWebPDeferred.resolve(supportsWebP._result);
-        };
-
-        image.onerror = function () {
-            supportsWebP._result = false;
-            supportsWebPDeferred.resolve(supportsWebP._result);
-        };
-
-        image.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';
-
-        return supportsWebPDeferred.promise;
-    };
-    defineProperties(supportsWebP, {
-        initialized: {
-            get: function() {
-                return defined(supportsWebP._result);
-            }
-        }
-    });
-
-    var typedArrayTypes = [];
-    if (typeof ArrayBuffer !== 'undefined') {
-        typedArrayTypes.push(Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array);
-
-        if (typeof Uint8ClampedArray !== 'undefined') {
-            typedArrayTypes.push(Uint8ClampedArray);
-        }
-
-        if (typeof CanvasPixelArray !== 'undefined') {
-            typedArrayTypes.push(CanvasPixelArray);
-        }
-    }
-
-    /**
-     * A set of functions to detect whether the current browser supports
-     * various features.
-     *
-     * @exports FeatureDetection
-     */
-    var FeatureDetection = {
-        isChrome : isChrome,
-        chromeVersion : chromeVersion,
-        isSafari : isSafari,
-        safariVersion : safariVersion,
-        isWebkit : isWebkit,
-        webkitVersion : webkitVersion,
-        isInternetExplorer : isInternetExplorer,
-        internetExplorerVersion : internetExplorerVersion,
-        isEdge : isEdge,
-        edgeVersion : edgeVersion,
-        isFirefox : isFirefox,
-        firefoxVersion : firefoxVersion,
-        isWindows : isWindows,
-        hardwareConcurrency : defaultValue(theNavigator.hardwareConcurrency, 3),
-        supportsPointerEvents : supportsPointerEvents,
-        supportsImageRenderingPixelated: supportsImageRenderingPixelated,
-        supportsWebP: supportsWebP,
-        imageRenderingValue: imageRenderingValue,
-        typedArrayTypes: typedArrayTypes
-    };
-
-    /**
-     * Detects whether the current browser supports the full screen standard.
-     *
-     * @returns {Boolean} true if the browser supports the full screen standard, false if not.
-     *
-     * @see Fullscreen
-     * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}
-     */
-    FeatureDetection.supportsFullscreen = function() {
-        return Fullscreen.supportsFullscreen();
-    };
-
-    /**
-     * Detects whether the current browser supports typed arrays.
-     *
-     * @returns {Boolean} true if the browser supports typed arrays, false if not.
-     *
-     * @see {@link http://www.khronos.org/registry/typedarray/specs/latest/|Typed Array Specification}
-     */
-    FeatureDetection.supportsTypedArrays = function() {
-        return typeof ArrayBuffer !== 'undefined';
-    };
-
-    /**
-     * Detects whether the current browser supports Web Workers.
-     *
-     * @returns {Boolean} true if the browsers supports Web Workers, false if not.
-     *
-     * @see {@link http://www.w3.org/TR/workers/}
-     */
-    FeatureDetection.supportsWebWorkers = function() {
-        return typeof Worker !== 'undefined';
-    };
-
-    /**
-     * Detects whether the current browser supports Web Assembly.
-     *
-     * @returns {Boolean} true if the browsers supports Web Assembly, false if not.
-     *
-     * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}
-     */
-    FeatureDetection.supportsWebAssembly = function() {
-        return typeof WebAssembly !== 'undefined' && !FeatureDetection.isEdge();
-    };
-export default FeatureDetection;

+ 0 - 481
Source/Core/FrustumGeometry.js

@@ -1,481 +0,0 @@
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Cartesian4 from './Cartesian4.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import Matrix3 from './Matrix3.js';
-import Matrix4 from './Matrix4.js';
-import OrthographicFrustum from './OrthographicFrustum.js';
-import PerspectiveFrustum from './PerspectiveFrustum.js';
-import PrimitiveType from './PrimitiveType.js';
-import Quaternion from './Quaternion.js';
-import VertexFormat from './VertexFormat.js';
-
-    var PERSPECTIVE = 0;
-    var ORTHOGRAPHIC = 1;
-
-    /**
-     * Describes a frustum at the given the origin and orientation.
-     *
-     * @alias FrustumGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.
-     * @param {Cartesian3} options.origin The origin of the frustum.
-     * @param {Quaternion} options.orientation The orientation of the frustum.
-     * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
-     */
-    function FrustumGeometry(options) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('options', options);
-        Check.typeOf.object('options.frustum', options.frustum);
-        Check.typeOf.object('options.origin', options.origin);
-        Check.typeOf.object('options.orientation', options.orientation);
-        //>>includeEnd('debug');
-
-        var frustum = options.frustum;
-        var orientation = options.orientation;
-        var origin = options.origin;
-        var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);
-
-        // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by
-        // creating multiple FrustumGeometrys. This way the near plane of one frustum doesn't overlap
-        // the far plane of another.
-        var drawNearPlane = defaultValue(options._drawNearPlane, true);
-
-        var frustumType;
-        var frustumPackedLength;
-        if (frustum instanceof PerspectiveFrustum) {
-            frustumType = PERSPECTIVE;
-            frustumPackedLength = PerspectiveFrustum.packedLength;
-        } else if (frustum instanceof OrthographicFrustum) {
-            frustumType = ORTHOGRAPHIC;
-            frustumPackedLength = OrthographicFrustum.packedLength;
-        }
-
-        this._frustumType = frustumType;
-        this._frustum = frustum.clone();
-        this._origin = Cartesian3.clone(origin);
-        this._orientation = Quaternion.clone(orientation);
-        this._drawNearPlane = drawNearPlane;
-        this._vertexFormat = vertexFormat;
-        this._workerName = 'createFrustumGeometry';
-
-        /**
-         * The number of elements used to pack the object into an array.
-         * @type {Number}
-         */
-        this.packedLength = 2 + frustumPackedLength + Cartesian3.packedLength + Quaternion.packedLength + VertexFormat.packedLength;
-    }
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {FrustumGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    FrustumGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var frustumType = value._frustumType;
-        var frustum = value._frustum;
-
-        array[startingIndex++] = frustumType;
-
-        if (frustumType === PERSPECTIVE) {
-            PerspectiveFrustum.pack(frustum, array, startingIndex);
-            startingIndex += PerspectiveFrustum.packedLength;
-        } else {
-            OrthographicFrustum.pack(frustum, array, startingIndex);
-            startingIndex += OrthographicFrustum.packedLength;
-        }
-
-        Cartesian3.pack(value._origin, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-        Quaternion.pack(value._orientation, array, startingIndex);
-        startingIndex += Quaternion.packedLength;
-        VertexFormat.pack(value._vertexFormat, array, startingIndex);
-        startingIndex += VertexFormat.packedLength;
-        array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;
-
-        return array;
-    };
-
-    var scratchPackPerspective = new PerspectiveFrustum();
-    var scratchPackOrthographic = new OrthographicFrustum();
-    var scratchPackQuaternion = new Quaternion();
-    var scratchPackorigin = new Cartesian3();
-    var scratchVertexFormat = new VertexFormat();
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {FrustumGeometry} [result] The object into which to store the result.
-     */
-    FrustumGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var frustumType = array[startingIndex++];
-
-        var frustum;
-        if (frustumType === PERSPECTIVE) {
-            frustum = PerspectiveFrustum.unpack(array, startingIndex, scratchPackPerspective);
-            startingIndex += PerspectiveFrustum.packedLength;
-        } else {
-            frustum = OrthographicFrustum.unpack(array, startingIndex, scratchPackOrthographic);
-            startingIndex += OrthographicFrustum.packedLength;
-        }
-
-        var origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);
-        startingIndex += Cartesian3.packedLength;
-        var orientation = Quaternion.unpack(array, startingIndex, scratchPackQuaternion);
-        startingIndex += Quaternion.packedLength;
-        var vertexFormat = VertexFormat.unpack(array, startingIndex, scratchVertexFormat);
-        startingIndex += VertexFormat.packedLength;
-        var drawNearPlane = array[startingIndex] === 1.0;
-
-        if (!defined(result)) {
-            return new FrustumGeometry({
-                frustum : frustum,
-                origin : origin,
-                orientation : orientation,
-                vertexFormat : vertexFormat,
-                _drawNearPlane : drawNearPlane
-            });
-        }
-
-        var frustumResult = frustumType === result._frustumType ? result._frustum : undefined;
-        result._frustum = frustum.clone(frustumResult);
-
-        result._frustumType = frustumType;
-        result._origin = Cartesian3.clone(origin, result._origin);
-        result._orientation = Quaternion.clone(orientation, result._orientation);
-        result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);
-        result._drawNearPlane = drawNearPlane;
-
-        return result;
-    };
-
-    function getAttributes(offset, normals, tangents, bitangents, st, normal, tangent, bitangent) {
-        var stOffset = offset / 3 * 2;
-
-        for (var i = 0; i < 4; ++i) {
-            if (defined(normals)) {
-                normals[offset] = normal.x;
-                normals[offset + 1] = normal.y;
-                normals[offset + 2] = normal.z;
-            }
-            if (defined(tangents)) {
-                tangents[offset] = tangent.x;
-                tangents[offset + 1] = tangent.y;
-                tangents[offset + 2] = tangent.z;
-            }
-            if (defined(bitangents)) {
-                bitangents[offset] = bitangent.x;
-                bitangents[offset + 1] = bitangent.y;
-                bitangents[offset + 2] = bitangent.z;
-            }
-            offset += 3;
-        }
-
-        st[stOffset] = 0.0;
-        st[stOffset + 1] = 0.0;
-        st[stOffset + 2] = 1.0;
-        st[stOffset + 3] = 0.0;
-        st[stOffset + 4] = 1.0;
-        st[stOffset + 5] = 1.0;
-        st[stOffset + 6] = 0.0;
-        st[stOffset + 7] = 1.0;
-    }
-
-    var scratchRotationMatrix = new Matrix3();
-    var scratchViewMatrix = new Matrix4();
-    var scratchInverseMatrix = new Matrix4();
-
-    var scratchXDirection = new Cartesian3();
-    var scratchYDirection = new Cartesian3();
-    var scratchZDirection = new Cartesian3();
-    var scratchNegativeX = new Cartesian3();
-    var scratchNegativeY = new Cartesian3();
-    var scratchNegativeZ = new Cartesian3();
-
-    var frustumSplits = new Array(3);
-
-    var frustumCornersNDC = new Array(4);
-    frustumCornersNDC[0] = new Cartesian4(-1.0, -1.0, 1.0, 1.0);
-    frustumCornersNDC[1] = new Cartesian4(1.0, -1.0, 1.0, 1.0);
-    frustumCornersNDC[2] = new Cartesian4(1.0, 1.0, 1.0, 1.0);
-    frustumCornersNDC[3] = new Cartesian4(-1.0, 1.0, 1.0, 1.0);
-
-    var scratchFrustumCorners = new Array(4);
-    for (var i = 0; i < 4; ++i) {
-        scratchFrustumCorners[i] = new Cartesian4();
-    }
-
-    FrustumGeometry._computeNearFarPlanes = function(origin, orientation, frustumType, frustum, positions, xDirection, yDirection, zDirection) {
-        var rotationMatrix = Matrix3.fromQuaternion(orientation, scratchRotationMatrix);
-        var x = defaultValue(xDirection, scratchXDirection);
-        var y = defaultValue(yDirection, scratchYDirection);
-        var z = defaultValue(zDirection, scratchZDirection);
-
-        x = Matrix3.getColumn(rotationMatrix, 0, x);
-        y = Matrix3.getColumn(rotationMatrix, 1, y);
-        z = Matrix3.getColumn(rotationMatrix, 2, z);
-
-        Cartesian3.normalize(x, x);
-        Cartesian3.normalize(y, y);
-        Cartesian3.normalize(z, z);
-
-        Cartesian3.negate(x, x);
-
-        var view = Matrix4.computeView(origin, z, y, x, scratchViewMatrix);
-
-        var inverseView;
-        var inverseViewProjection;
-        if (frustumType === PERSPECTIVE) {
-            var projection = frustum.projectionMatrix;
-            var viewProjection = Matrix4.multiply(projection, view, scratchInverseMatrix);
-            inverseViewProjection = Matrix4.inverse(viewProjection, scratchInverseMatrix);
-        } else {
-            inverseView = Matrix4.inverseTransformation(view, scratchInverseMatrix);
-        }
-
-        if (defined(inverseViewProjection)) {
-            frustumSplits[0] = frustum.near;
-            frustumSplits[1] = frustum.far;
-        } else {
-            frustumSplits[0] = 0.0;
-            frustumSplits[1] = frustum.near;
-            frustumSplits[2] = frustum.far;
-        }
-
-        for (var i = 0; i < 2; ++i) {
-            for (var j = 0; j < 4; ++j) {
-                var corner = Cartesian4.clone(frustumCornersNDC[j], scratchFrustumCorners[j]);
-
-                if (!defined(inverseViewProjection)) {
-                    if (defined(frustum._offCenterFrustum)) {
-                        frustum = frustum._offCenterFrustum;
-                    }
-
-                    var near = frustumSplits[i];
-                    var far = frustumSplits[i + 1];
-
-                    corner.x = (corner.x * (frustum.right - frustum.left) + frustum.left + frustum.right) * 0.5;
-                    corner.y = (corner.y * (frustum.top - frustum.bottom) + frustum.bottom + frustum.top) * 0.5;
-                    corner.z = (corner.z * (near - far) - near - far) * 0.5;
-                    corner.w = 1.0;
-
-                    Matrix4.multiplyByVector(inverseView, corner, corner);
-                } else {
-                    corner = Matrix4.multiplyByVector(inverseViewProjection, corner, corner);
-
-                    // Reverse perspective divide
-                    var w = 1.0 / corner.w;
-                    Cartesian3.multiplyByScalar(corner, w, corner);
-
-                    Cartesian3.subtract(corner, origin, corner);
-                    Cartesian3.normalize(corner, corner);
-
-                    var fac = Cartesian3.dot(z, corner);
-                    Cartesian3.multiplyByScalar(corner, frustumSplits[i] / fac, corner);
-                    Cartesian3.add(corner, origin, corner);
-                }
-
-                positions[12 * i + j * 3] = corner.x;
-                positions[12 * i + j * 3 + 1] = corner.y;
-                positions[12 * i + j * 3 + 2] = corner.z;
-            }
-        }
-    };
-
-    /**
-     * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {FrustumGeometry} frustumGeometry A description of the frustum.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    FrustumGeometry.createGeometry = function(frustumGeometry) {
-        var frustumType = frustumGeometry._frustumType;
-        var frustum = frustumGeometry._frustum;
-        var origin = frustumGeometry._origin;
-        var orientation = frustumGeometry._orientation;
-        var drawNearPlane = frustumGeometry._drawNearPlane;
-        var vertexFormat = frustumGeometry._vertexFormat;
-
-        var numberOfPlanes = drawNearPlane ? 6 : 5;
-        var positions = new Float64Array(3 * 4 * 6);
-        FrustumGeometry._computeNearFarPlanes(origin, orientation, frustumType, frustum, positions);
-
-        // -x plane
-        var offset = 3 * 4 * 2;
-        positions[offset]      = positions[3 * 4];
-        positions[offset + 1]  = positions[3 * 4 + 1];
-        positions[offset + 2]  = positions[3 * 4 + 2];
-        positions[offset + 3]  = positions[0];
-        positions[offset + 4]  = positions[1];
-        positions[offset + 5]  = positions[2];
-        positions[offset + 6]  = positions[3 * 3];
-        positions[offset + 7]  = positions[3 * 3 + 1];
-        positions[offset + 8]  = positions[3 * 3 + 2];
-        positions[offset + 9]  = positions[3 * 7];
-        positions[offset + 10] = positions[3 * 7 + 1];
-        positions[offset + 11] = positions[3 * 7 + 2];
-
-        // -y plane
-        offset += 3 * 4;
-        positions[offset]      = positions[3 * 5];
-        positions[offset + 1]  = positions[3 * 5 + 1];
-        positions[offset + 2]  = positions[3 * 5 + 2];
-        positions[offset + 3]  = positions[3];
-        positions[offset + 4]  = positions[3 + 1];
-        positions[offset + 5]  = positions[3 + 2];
-        positions[offset + 6]  = positions[0];
-        positions[offset + 7]  = positions[1];
-        positions[offset + 8]  = positions[2];
-        positions[offset + 9]  = positions[3 * 4];
-        positions[offset + 10] = positions[3 * 4 + 1];
-        positions[offset + 11] = positions[3 * 4 + 2];
-
-        // +x plane
-        offset += 3 * 4;
-        positions[offset]      = positions[3];
-        positions[offset + 1]  = positions[3 + 1];
-        positions[offset + 2]  = positions[3 + 2];
-        positions[offset + 3]  = positions[3 * 5];
-        positions[offset + 4]  = positions[3 * 5 + 1];
-        positions[offset + 5]  = positions[3 * 5 + 2];
-        positions[offset + 6]  = positions[3 * 6];
-        positions[offset + 7]  = positions[3 * 6 + 1];
-        positions[offset + 8]  = positions[3 * 6 + 2];
-        positions[offset + 9]  = positions[3 * 2];
-        positions[offset + 10] = positions[3 * 2 + 1];
-        positions[offset + 11] = positions[3 * 2 + 2];
-
-        // +y plane
-        offset += 3 * 4;
-        positions[offset]      = positions[3 * 2];
-        positions[offset + 1]  = positions[3 * 2 + 1];
-        positions[offset + 2]  = positions[3 * 2 + 2];
-        positions[offset + 3]  = positions[3 * 6];
-        positions[offset + 4]  = positions[3 * 6 + 1];
-        positions[offset + 5]  = positions[3 * 6 + 2];
-        positions[offset + 6]  = positions[3 * 7];
-        positions[offset + 7]  = positions[3 * 7 + 1];
-        positions[offset + 8]  = positions[3 * 7 + 2];
-        positions[offset + 9]  = positions[3 * 3];
-        positions[offset + 10] = positions[3 * 3 + 1];
-        positions[offset + 11] = positions[3 * 3 + 2];
-
-        if (!drawNearPlane) {
-            positions = positions.subarray(3 * 4);
-        }
-
-        var attributes = new GeometryAttributes({
-            position : new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : positions
-            })
-        });
-
-        if (defined(vertexFormat.normal) || defined(vertexFormat.tangent) || defined(vertexFormat.bitangent) || defined(vertexFormat.st)) {
-            var normals = defined(vertexFormat.normal) ? new Float32Array(3 * 4 * numberOfPlanes) : undefined;
-            var tangents = defined(vertexFormat.tangent) ? new Float32Array(3 * 4 * numberOfPlanes) : undefined;
-            var bitangents = defined(vertexFormat.bitangent) ? new Float32Array(3 * 4 * numberOfPlanes) : undefined;
-            var st = defined(vertexFormat.st) ? new Float32Array(2 * 4 * numberOfPlanes) : undefined;
-
-            var x = scratchXDirection;
-            var y = scratchYDirection;
-            var z = scratchZDirection;
-
-            var negativeX = Cartesian3.negate(x, scratchNegativeX);
-            var negativeY = Cartesian3.negate(y, scratchNegativeY);
-            var negativeZ = Cartesian3.negate(z, scratchNegativeZ);
-
-            offset = 0;
-            if (drawNearPlane) {
-                getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y); // near
-                offset += 3 * 4;
-            }
-            getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y); // far
-            offset += 3 * 4;
-            getAttributes(offset, normals, tangents, bitangents, st, negativeX, negativeZ, y); // -x
-            offset += 3 * 4;
-            getAttributes(offset, normals, tangents, bitangents, st, negativeY, negativeZ, negativeX); // -y
-            offset += 3 * 4;
-            getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x
-            offset += 3 * 4;
-            getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX); // +y
-
-            if (defined(normals)) {
-                attributes.normal = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : normals
-                });
-            }
-            if (defined(tangents)) {
-                attributes.tangent = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : tangents
-                });
-            }
-            if (defined(bitangents)) {
-                attributes.bitangent = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 3,
-                    values : bitangents
-                });
-            }
-            if (defined(st)) {
-                attributes.st = new GeometryAttribute({
-                    componentDatatype : ComponentDatatype.FLOAT,
-                    componentsPerAttribute : 2,
-                    values : st
-                });
-            }
-        }
-
-        var indices = new Uint16Array(6 * numberOfPlanes);
-        for (var i = 0; i < numberOfPlanes; ++i) {
-            var indexOffset = i * 6;
-            var index = i * 4;
-
-            indices[indexOffset] = index;
-            indices[indexOffset + 1] = index + 1;
-            indices[indexOffset + 2] = index + 2;
-            indices[indexOffset + 3] = index;
-            indices[indexOffset + 4] = index + 2;
-            indices[indexOffset + 5] = index + 3;
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.TRIANGLES,
-            boundingSphere : BoundingSphere.fromVertices(positions)
-        });
-    };
-export default FrustumGeometry;

+ 0 - 234
Source/Core/FrustumOutlineGeometry.js

@@ -1,234 +0,0 @@
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import ComponentDatatype from './ComponentDatatype.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import FrustumGeometry from './FrustumGeometry.js';
-import Geometry from './Geometry.js';
-import GeometryAttribute from './GeometryAttribute.js';
-import GeometryAttributes from './GeometryAttributes.js';
-import OrthographicFrustum from './OrthographicFrustum.js';
-import PerspectiveFrustum from './PerspectiveFrustum.js';
-import PrimitiveType from './PrimitiveType.js';
-import Quaternion from './Quaternion.js';
-
-    var PERSPECTIVE = 0;
-    var ORTHOGRAPHIC = 1;
-
-    /**
-     * A description of the outline of a frustum with the given the origin and orientation.
-     *
-     * @alias FrustumOutlineGeometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.
-     * @param {Cartesian3} options.origin The origin of the frustum.
-     * @param {Quaternion} options.orientation The orientation of the frustum.
-     */
-    function FrustumOutlineGeometry(options) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('options', options);
-        Check.typeOf.object('options.frustum', options.frustum);
-        Check.typeOf.object('options.origin', options.origin);
-        Check.typeOf.object('options.orientation', options.orientation);
-        //>>includeEnd('debug');
-
-        var frustum = options.frustum;
-        var orientation = options.orientation;
-        var origin = options.origin;
-
-        // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by
-        // creating multiple FrustumOutlineGeometrys. This way the near plane of one frustum doesn't overlap
-        // the far plane of another.
-        var drawNearPlane = defaultValue(options._drawNearPlane, true);
-
-        var frustumType;
-        var frustumPackedLength;
-        if (frustum instanceof PerspectiveFrustum) {
-            frustumType = PERSPECTIVE;
-            frustumPackedLength = PerspectiveFrustum.packedLength;
-        } else if (frustum instanceof OrthographicFrustum) {
-            frustumType = ORTHOGRAPHIC;
-            frustumPackedLength = OrthographicFrustum.packedLength;
-        }
-
-        this._frustumType = frustumType;
-        this._frustum = frustum.clone();
-        this._origin = Cartesian3.clone(origin);
-        this._orientation = Quaternion.clone(orientation);
-        this._drawNearPlane = drawNearPlane;
-        this._workerName = 'createFrustumOutlineGeometry';
-
-        /**
-         * The number of elements used to pack the object into an array.
-         * @type {Number}
-         */
-        this.packedLength = 2 + frustumPackedLength + Cartesian3.packedLength + Quaternion.packedLength;
-    }
-
-    /**
-     * Stores the provided instance into the provided array.
-     *
-     * @param {FrustumOutlineGeometry} value The value to pack.
-     * @param {Number[]} array The array to pack into.
-     * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
-     *
-     * @returns {Number[]} The array that was packed into
-     */
-    FrustumOutlineGeometry.pack = function(value, array, startingIndex) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('value', value);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var frustumType = value._frustumType;
-        var frustum = value._frustum;
-
-        array[startingIndex++] = frustumType;
-
-        if (frustumType === PERSPECTIVE) {
-            PerspectiveFrustum.pack(frustum, array, startingIndex);
-            startingIndex += PerspectiveFrustum.packedLength;
-        } else {
-            OrthographicFrustum.pack(frustum, array, startingIndex);
-            startingIndex += OrthographicFrustum.packedLength;
-        }
-
-        Cartesian3.pack(value._origin, array, startingIndex);
-        startingIndex += Cartesian3.packedLength;
-        Quaternion.pack(value._orientation, array, startingIndex);
-        startingIndex += Quaternion.packedLength;
-        array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;
-
-        return array;
-    };
-
-    var scratchPackPerspective = new PerspectiveFrustum();
-    var scratchPackOrthographic = new OrthographicFrustum();
-    var scratchPackQuaternion = new Quaternion();
-    var scratchPackorigin = new Cartesian3();
-
-    /**
-     * Retrieves an instance from a packed array.
-     *
-     * @param {Number[]} array The packed array.
-     * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
-     * @param {FrustumOutlineGeometry} [result] The object into which to store the result.
-     */
-    FrustumOutlineGeometry.unpack = function(array, startingIndex, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('array', array);
-        //>>includeEnd('debug');
-
-        startingIndex = defaultValue(startingIndex, 0);
-
-        var frustumType = array[startingIndex++];
-
-        var frustum;
-        if (frustumType === PERSPECTIVE) {
-            frustum = PerspectiveFrustum.unpack(array, startingIndex, scratchPackPerspective);
-            startingIndex += PerspectiveFrustum.packedLength;
-        } else {
-            frustum = OrthographicFrustum.unpack(array, startingIndex, scratchPackOrthographic);
-            startingIndex += OrthographicFrustum.packedLength;
-        }
-
-        var origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);
-        startingIndex += Cartesian3.packedLength;
-        var orientation = Quaternion.unpack(array, startingIndex, scratchPackQuaternion);
-        startingIndex += Quaternion.packedLength;
-        var drawNearPlane = array[startingIndex] === 1.0;
-
-        if (!defined(result)) {
-            return new FrustumOutlineGeometry({
-                frustum : frustum,
-                origin : origin,
-                orientation : orientation,
-                _drawNearPlane : drawNearPlane
-            });
-        }
-
-        var frustumResult = frustumType === result._frustumType ? result._frustum : undefined;
-        result._frustum = frustum.clone(frustumResult);
-
-        result._frustumType = frustumType;
-        result._origin = Cartesian3.clone(origin, result._origin);
-        result._orientation = Quaternion.clone(orientation, result._orientation);
-        result._drawNearPlane = drawNearPlane;
-
-        return result;
-    };
-
-    /**
-     * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
-     *
-     * @param {FrustumOutlineGeometry} frustumGeometry A description of the frustum.
-     * @returns {Geometry|undefined} The computed vertices and indices.
-     */
-    FrustumOutlineGeometry.createGeometry = function(frustumGeometry) {
-        var frustumType = frustumGeometry._frustumType;
-        var frustum = frustumGeometry._frustum;
-        var origin = frustumGeometry._origin;
-        var orientation = frustumGeometry._orientation;
-        var drawNearPlane = frustumGeometry._drawNearPlane;
-
-        var positions = new Float64Array(3 * 4 * 2);
-        FrustumGeometry._computeNearFarPlanes(origin, orientation, frustumType, frustum, positions);
-
-        var attributes = new GeometryAttributes({
-            position : new GeometryAttribute({
-                componentDatatype : ComponentDatatype.DOUBLE,
-                componentsPerAttribute : 3,
-                values : positions
-            })
-        });
-
-        var offset;
-        var index;
-
-        var numberOfPlanes = drawNearPlane ? 2 : 1;
-        var indices = new Uint16Array(8 * (numberOfPlanes + 1));
-
-        // Build the near/far planes
-        var i = drawNearPlane ? 0 : 1;
-        for (; i < 2; ++i) {
-            offset = drawNearPlane ? i * 8 : 0;
-            index = i * 4;
-
-            indices[offset] = index;
-            indices[offset + 1] = index + 1;
-            indices[offset + 2] = index + 1;
-            indices[offset + 3] = index + 2;
-            indices[offset + 4] = index + 2;
-            indices[offset + 5] = index + 3;
-            indices[offset + 6] = index + 3;
-            indices[offset + 7] = index;
-        }
-
-        // Build the sides of the frustums
-        for (i = 0; i < 2; ++i) {
-            offset = (numberOfPlanes + i) * 8;
-            index = i * 4;
-
-            indices[offset] = index;
-            indices[offset + 1] = index + 4;
-            indices[offset + 2] = index + 1;
-            indices[offset + 3] = index + 5;
-            indices[offset + 4] = index + 2;
-            indices[offset + 5] = index + 6;
-            indices[offset + 6] = index + 3;
-            indices[offset + 7] = index + 7;
-        }
-
-        return new Geometry({
-            attributes : attributes,
-            indices : indices,
-            primitiveType : PrimitiveType.LINES,
-            boundingSphere : BoundingSphere.fromVertices(positions)
-        });
-    };
-export default FrustumOutlineGeometry;

+ 0 - 251
Source/Core/Fullscreen.js

@@ -1,251 +0,0 @@
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-
-    var _supportsFullscreen;
-    var _names = {
-        requestFullscreen : undefined,
-        exitFullscreen : undefined,
-        fullscreenEnabled : undefined,
-        fullscreenElement : undefined,
-        fullscreenchange : undefined,
-        fullscreenerror : undefined
-    };
-
-    /**
-     * Browser-independent functions for working with the standard fullscreen API.
-     *
-     * @exports Fullscreen
-     * @namespace
-     *
-     * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}
-     */
-    var Fullscreen = {};
-
-    defineProperties(Fullscreen, {
-        /**
-         * The element that is currently fullscreen, if any.  To simply check if the
-         * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
-         * @memberof Fullscreen
-         * @type {Object}
-         * @readonly
-         */
-        element : {
-            get : function() {
-                if (!Fullscreen.supportsFullscreen()) {
-                    return undefined;
-                }
-
-                return document[_names.fullscreenElement];
-            }
-        },
-
-        /**
-         * The name of the event on the document that is fired when fullscreen is
-         * entered or exited.  This event name is intended for use with addEventListener.
-         * In your event handler, to determine if the browser is in fullscreen mode or not,
-         * use {@link Fullscreen#fullscreen}.
-         * @memberof Fullscreen
-         * @type {String}
-         * @readonly
-         */
-        changeEventName : {
-            get : function() {
-                if (!Fullscreen.supportsFullscreen()) {
-                    return undefined;
-                }
-
-                return _names.fullscreenchange;
-            }
-        },
-
-        /**
-         * The name of the event that is fired when a fullscreen error
-         * occurs.  This event name is intended for use with addEventListener.
-         * @memberof Fullscreen
-         * @type {String}
-         * @readonly
-         */
-        errorEventName : {
-            get : function() {
-                if (!Fullscreen.supportsFullscreen()) {
-                    return undefined;
-                }
-
-                return _names.fullscreenerror;
-            }
-        },
-
-        /**
-         * Determine whether the browser will allow an element to be made fullscreen, or not.
-         * For example, by default, iframes cannot go fullscreen unless the containing page
-         * adds an "allowfullscreen" attribute (or prefixed equivalent).
-         * @memberof Fullscreen
-         * @type {Boolean}
-         * @readonly
-         */
-        enabled : {
-            get : function() {
-                if (!Fullscreen.supportsFullscreen()) {
-                    return undefined;
-                }
-
-                return document[_names.fullscreenEnabled];
-            }
-        },
-
-        /**
-         * Determines if the browser is currently in fullscreen mode.
-         * @memberof Fullscreen
-         * @type {Boolean}
-         * @readonly
-         */
-        fullscreen : {
-            get : function() {
-                if (!Fullscreen.supportsFullscreen()) {
-                    return undefined;
-                }
-
-                return Fullscreen.element !== null;
-            }
-        }
-    });
-
-    /**
-     * Detects whether the browser supports the standard fullscreen API.
-     *
-     * @returns {Boolean} <code>true</code> if the browser supports the standard fullscreen API,
-     * <code>false</code> otherwise.
-     */
-    Fullscreen.supportsFullscreen = function() {
-        if (defined(_supportsFullscreen)) {
-            return _supportsFullscreen;
-        }
-
-        _supportsFullscreen = false;
-
-        var body = document.body;
-        if (typeof body.requestFullscreen === 'function') {
-            // go with the unprefixed, standard set of names
-            _names.requestFullscreen = 'requestFullscreen';
-            _names.exitFullscreen = 'exitFullscreen';
-            _names.fullscreenEnabled = 'fullscreenEnabled';
-            _names.fullscreenElement = 'fullscreenElement';
-            _names.fullscreenchange = 'fullscreenchange';
-            _names.fullscreenerror = 'fullscreenerror';
-            _supportsFullscreen = true;
-            return _supportsFullscreen;
-        }
-
-        //check for the correct combination of prefix plus the various names that browsers use
-        var prefixes = ['webkit', 'moz', 'o', 'ms', 'khtml'];
-        var name;
-        for (var i = 0, len = prefixes.length; i < len; ++i) {
-            var prefix = prefixes[i];
-
-            // casing of Fullscreen differs across browsers
-            name = prefix + 'RequestFullscreen';
-            if (typeof body[name] === 'function') {
-                _names.requestFullscreen = name;
-                _supportsFullscreen = true;
-            } else {
-                name = prefix + 'RequestFullScreen';
-                if (typeof body[name] === 'function') {
-                    _names.requestFullscreen = name;
-                    _supportsFullscreen = true;
-                }
-            }
-
-            // disagreement about whether it's "exit" as per spec, or "cancel"
-            name = prefix + 'ExitFullscreen';
-            if (typeof document[name] === 'function') {
-                _names.exitFullscreen = name;
-            } else {
-                name = prefix + 'CancelFullScreen';
-                if (typeof document[name] === 'function') {
-                    _names.exitFullscreen = name;
-                }
-            }
-
-            // casing of Fullscreen differs across browsers
-            name = prefix + 'FullscreenEnabled';
-            if (document[name] !== undefined) {
-                _names.fullscreenEnabled = name;
-            } else {
-                name = prefix + 'FullScreenEnabled';
-                if (document[name] !== undefined) {
-                    _names.fullscreenEnabled = name;
-                }
-            }
-
-            // casing of Fullscreen differs across browsers
-            name = prefix + 'FullscreenElement';
-            if (document[name] !== undefined) {
-                _names.fullscreenElement = name;
-            } else {
-                name = prefix + 'FullScreenElement';
-                if (document[name] !== undefined) {
-                    _names.fullscreenElement = name;
-                }
-            }
-
-            // thankfully, event names are all lowercase per spec
-            name = prefix + 'fullscreenchange';
-            // event names do not have 'on' in the front, but the property on the document does
-            if (document['on' + name] !== undefined) {
-                //except on IE
-                if (prefix === 'ms') {
-                    name = 'MSFullscreenChange';
-                }
-                _names.fullscreenchange = name;
-            }
-
-            name = prefix + 'fullscreenerror';
-            if (document['on' + name] !== undefined) {
-                //except on IE
-                if (prefix === 'ms') {
-                    name = 'MSFullscreenError';
-                }
-                _names.fullscreenerror = name;
-            }
-        }
-
-        return _supportsFullscreen;
-    };
-
-    /**
-     * Asynchronously requests the browser to enter fullscreen mode on the given element.
-     * If fullscreen mode is not supported by the browser, does nothing.
-     *
-     * @param {Object} element The HTML element which will be placed into fullscreen mode.
-     * @param {HMDVRDevice} [vrDevice] The VR device.
-     *
-     * @example
-     * // Put the entire page into fullscreen.
-     * Cesium.Fullscreen.requestFullscreen(document.body)
-     *
-     * // Place only the Cesium canvas into fullscreen.
-     * Cesium.Fullscreen.requestFullscreen(scene.canvas)
-     */
-    Fullscreen.requestFullscreen = function(element, vrDevice) {
-        if (!Fullscreen.supportsFullscreen()) {
-            return;
-        }
-
-        element[_names.requestFullscreen]({ vrDisplay: vrDevice });
-    };
-
-    /**
-     * Asynchronously exits fullscreen mode.  If the browser is not currently
-     * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
-     */
-    Fullscreen.exitFullscreen = function() {
-        if (!Fullscreen.supportsFullscreen()) {
-            return;
-        }
-
-        document[_names.exitFullscreen]();
-    };
-
-    //For unit tests
-    Fullscreen._names = _names;
-export default Fullscreen;

+ 0 - 26
Source/Core/GeocodeType.js

@@ -1,26 +0,0 @@
-import freezeObject from '../Core/freezeObject.js';
-
-    /**
-     * The type of geocoding to be performed by a {@link GeocoderService}.
-     * @exports GeocodeType
-     * @see Geocoder
-     */
-    var GeocodeType = {
-        /**
-         * Perform a search where the input is considered complete.
-         *
-         * @type {Number}
-         * @constant
-         */
-        SEARCH: 0,
-
-        /**
-         * Perform an auto-complete using partial input, typically
-         * reserved for providing possible results as a user is typing.
-         *
-         * @type {Number}
-         * @constant
-         */
-        AUTOCOMPLETE: 1
-    };
-export default freezeObject(GeocodeType);

+ 0 - 30
Source/Core/GeocoderService.js

@@ -1,30 +0,0 @@
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * @typedef {Object} GeocoderService~Result
-     * @property {String} displayName The display name for a location
-     * @property {Rectangle|Cartesian3} destination The bounding box for a location
-     */
-
-    /**
-     * Provides geocoding through an external service. This type describes an interface and
-     * is not intended to be used.
-     * @alias GeocoderService
-     * @constructor
-     *
-     * @see BingMapsGeocoderService
-     * @see PeliasGeocoderService
-     * @see OpenCageGeocoderService
-     */
-    function GeocoderService() {
-    }
-
-    /**
-     * @function
-     *
-     * @param {String} query The query to be sent to the geocoder service
-     * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
-     * @returns {Promise<GeocoderService~Result[]>}
-     */
-    GeocoderService.prototype.geocode = DeveloperError.throwInstantiationError;
-export default GeocoderService;

+ 0 - 106
Source/Core/GeographicProjection.js

@@ -1,106 +0,0 @@
-import Cartesian3 from './Cartesian3.js';
-import Cartographic from './Cartographic.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Ellipsoid from './Ellipsoid.js';
-
-    /**
-     * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
-     * them by the {@link Ellipsoid#maximumRadius}.  This projection
-     * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée.  It
-     * is also known as EPSG:4326.
-     *
-     * @alias GeographicProjection
-     * @constructor
-     *
-     * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
-     *
-     * @see WebMercatorProjection
-     */
-    function GeographicProjection(ellipsoid) {
-        this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
-        this._semimajorAxis = this._ellipsoid.maximumRadius;
-        this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;
-    }
-
-    defineProperties(GeographicProjection.prototype, {
-        /**
-         * Gets the {@link Ellipsoid}.
-         *
-         * @memberof GeographicProjection.prototype
-         *
-         * @type {Ellipsoid}
-         * @readonly
-         */
-        ellipsoid : {
-            get : function() {
-                return this._ellipsoid;
-            }
-        }
-    });
-
-    /**
-     * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
-     * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
-     * ellipsoid.  Z is the unmodified height.
-     *
-     * @param {Cartographic} cartographic The coordinates to project.
-     * @param {Cartesian3} [result] An instance into which to copy the result.  If this parameter is
-     *        undefined, a new instance is created and returned.
-     * @returns {Cartesian3} The projected coordinates.  If the result parameter is not undefined, the
-     *          coordinates are copied there and that instance is returned.  Otherwise, a new instance is
-     *          created and returned.
-     */
-    GeographicProjection.prototype.project = function(cartographic, result) {
-        // Actually this is the special case of equidistant cylindrical called the plate carree
-        var semimajorAxis = this._semimajorAxis;
-        var x = cartographic.longitude * semimajorAxis;
-        var y = cartographic.latitude * semimajorAxis;
-        var z = cartographic.height;
-
-        if (!defined(result)) {
-            return new Cartesian3(x, y, z);
-        }
-
-        result.x = x;
-        result.y = y;
-        result.z = z;
-        return result;
-    };
-
-    /**
-     * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
-     * coordinates, in radians.  Longitude and Latitude are the X and Y coordinates, respectively,
-     * divided by the maximum radius of the ellipsoid.  Height is the unmodified Z coordinate.
-     *
-     * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.
-     * @param {Cartographic} [result] An instance into which to copy the result.  If this parameter is
-     *        undefined, a new instance is created and returned.
-     * @returns {Cartographic} The unprojected coordinates.  If the result parameter is not undefined, the
-     *          coordinates are copied there and that instance is returned.  Otherwise, a new instance is
-     *          created and returned.
-     */
-    GeographicProjection.prototype.unproject = function(cartesian, result) {
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(cartesian)) {
-            throw new DeveloperError('cartesian is required');
-        }
-        //>>includeEnd('debug');
-
-        var oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
-        var longitude = cartesian.x * oneOverEarthSemimajorAxis;
-        var latitude = cartesian.y * oneOverEarthSemimajorAxis;
-        var height = cartesian.z;
-
-        if (!defined(result)) {
-            return new Cartographic(longitude, latitude, height);
-        }
-
-        result.longitude = longitude;
-        result.latitude = latitude;
-        result.height = height;
-        return result;
-    };
-export default GeographicProjection;

+ 0 - 228
Source/Core/GeographicTilingScheme.js

@@ -1,228 +0,0 @@
-import Cartesian2 from './Cartesian2.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import Ellipsoid from './Ellipsoid.js';
-import GeographicProjection from './GeographicProjection.js';
-import CesiumMath from './Math.js';
-import Rectangle from './Rectangle.js';
-
-    /**
-     * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
-     * longitude and latitude are directly mapped to X and Y.  This projection is commonly
-     * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
-     *
-     * @alias GeographicTilingScheme
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to
-     * the WGS84 ellipsoid.
-     * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme.
-     * @param {Number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of
-     * the tile tree.
-     * @param {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of
-     * the tile tree.
-     */
-    function GeographicTilingScheme(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);
-        this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);
-        this._projection = new GeographicProjection(this._ellipsoid);
-        this._numberOfLevelZeroTilesX = defaultValue(options.numberOfLevelZeroTilesX, 2);
-        this._numberOfLevelZeroTilesY = defaultValue(options.numberOfLevelZeroTilesY, 1);
-    }
-
-    defineProperties(GeographicTilingScheme.prototype, {
-        /**
-         * Gets the ellipsoid that is tiled by this tiling scheme.
-         * @memberof GeographicTilingScheme.prototype
-         * @type {Ellipsoid}
-         */
-        ellipsoid : {
-            get : function() {
-                return this._ellipsoid;
-            }
-        },
-
-        /**
-         * Gets the rectangle, in radians, covered by this tiling scheme.
-         * @memberof GeographicTilingScheme.prototype
-         * @type {Rectangle}
-         */
-        rectangle : {
-            get : function() {
-                return this._rectangle;
-            }
-        },
-
-        /**
-         * Gets the map projection used by this tiling scheme.
-         * @memberof GeographicTilingScheme.prototype
-         * @type {MapProjection}
-         */
-        projection : {
-            get : function() {
-                return this._projection;
-            }
-        }
-    });
-
-    /**
-     * Gets the total number of tiles in the X direction at a specified level-of-detail.
-     *
-     * @param {Number} level The level-of-detail.
-     * @returns {Number} The number of tiles in the X direction at the given level.
-     */
-    GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function(level) {
-        return this._numberOfLevelZeroTilesX << level;
-    };
-
-    /**
-     * Gets the total number of tiles in the Y direction at a specified level-of-detail.
-     *
-     * @param {Number} level The level-of-detail.
-     * @returns {Number} The number of tiles in the Y direction at the given level.
-     */
-    GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function(level) {
-        return this._numberOfLevelZeroTilesY << level;
-    };
-
-    /**
-     * Transforms a rectangle specified in geodetic radians to the native coordinate system
-     * of this tiling scheme.
-     *
-     * @param {Rectangle} rectangle The rectangle to transform.
-     * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance
-     *        should be created.
-     * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'
-     *          is undefined.
-     */
-    GeographicTilingScheme.prototype.rectangleToNativeRectangle = function(rectangle, result) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.defined('rectangle', rectangle);
-        //>>includeEnd('debug');
-
-        var west = CesiumMath.toDegrees(rectangle.west);
-        var south = CesiumMath.toDegrees(rectangle.south);
-        var east = CesiumMath.toDegrees(rectangle.east);
-        var north = CesiumMath.toDegrees(rectangle.north);
-
-        if (!defined(result)) {
-            return new Rectangle(west, south, east, north);
-        }
-
-        result.west = west;
-        result.south = south;
-        result.east = east;
-        result.north = north;
-        return result;
-    };
-
-    /**
-     * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
-     * of the tiling scheme.
-     *
-     * @param {Number} x The integer x coordinate of the tile.
-     * @param {Number} y The integer y coordinate of the tile.
-     * @param {Number} level The tile level-of-detail.  Zero is the least detailed.
-     * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance
-     *        should be created.
-     * @returns {Rectangle} The specified 'result', or a new object containing the rectangle
-     *          if 'result' is undefined.
-     */
-    GeographicTilingScheme.prototype.tileXYToNativeRectangle = function(x, y, level, result) {
-        var rectangleRadians = this.tileXYToRectangle(x, y, level, result);
-        rectangleRadians.west = CesiumMath.toDegrees(rectangleRadians.west);
-        rectangleRadians.south = CesiumMath.toDegrees(rectangleRadians.south);
-        rectangleRadians.east = CesiumMath.toDegrees(rectangleRadians.east);
-        rectangleRadians.north = CesiumMath.toDegrees(rectangleRadians.north);
-        return rectangleRadians;
-    };
-
-    /**
-     * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
-     *
-     * @param {Number} x The integer x coordinate of the tile.
-     * @param {Number} y The integer y coordinate of the tile.
-     * @param {Number} level The tile level-of-detail.  Zero is the least detailed.
-     * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance
-     *        should be created.
-     * @returns {Rectangle} The specified 'result', or a new object containing the rectangle
-     *          if 'result' is undefined.
-     */
-    GeographicTilingScheme.prototype.tileXYToRectangle = function(x, y, level, result) {
-        var rectangle = this._rectangle;
-
-        var xTiles = this.getNumberOfXTilesAtLevel(level);
-        var yTiles = this.getNumberOfYTilesAtLevel(level);
-
-        var xTileWidth = rectangle.width / xTiles;
-        var west = x * xTileWidth + rectangle.west;
-        var east = (x + 1) * xTileWidth + rectangle.west;
-
-        var yTileHeight = rectangle.height / yTiles;
-        var north = rectangle.north - y * yTileHeight;
-        var south = rectangle.north - (y + 1) * yTileHeight;
-
-        if (!defined(result)) {
-            result = new Rectangle(west, south, east, north);
-        }
-
-        result.west = west;
-        result.south = south;
-        result.east = east;
-        result.north = north;
-        return result;
-    };
-
-    /**
-     * Calculates the tile x, y coordinates of the tile containing
-     * a given cartographic position.
-     *
-     * @param {Cartographic} position The position.
-     * @param {Number} level The tile level-of-detail.  Zero is the least detailed.
-     * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance
-     *        should be created.
-     * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates
-     *          if 'result' is undefined.
-     */
-    GeographicTilingScheme.prototype.positionToTileXY = function(position, level, result) {
-        var rectangle = this._rectangle;
-        if (!Rectangle.contains(rectangle, position)) {
-            // outside the bounds of the tiling scheme
-            return undefined;
-        }
-
-        var xTiles = this.getNumberOfXTilesAtLevel(level);
-        var yTiles = this.getNumberOfYTilesAtLevel(level);
-
-        var xTileWidth = rectangle.width / xTiles;
-        var yTileHeight = rectangle.height / yTiles;
-
-        var longitude = position.longitude;
-        if (rectangle.east < rectangle.west) {
-            longitude += CesiumMath.TWO_PI;
-        }
-
-        var xTileCoordinate = (longitude - rectangle.west) / xTileWidth | 0;
-        if (xTileCoordinate >= xTiles) {
-            xTileCoordinate = xTiles - 1;
-        }
-
-        var yTileCoordinate = (rectangle.north - position.latitude) / yTileHeight | 0;
-        if (yTileCoordinate >= yTiles) {
-            yTileCoordinate = yTiles - 1;
-        }
-
-        if (!defined(result)) {
-            return new Cartesian2(xTileCoordinate, yTileCoordinate);
-        }
-
-        result.x = xTileCoordinate;
-        result.y = yTileCoordinate;
-        return result;
-    };
-export default GeographicTilingScheme;

+ 0 - 329
Source/Core/Geometry.js

@@ -1,329 +0,0 @@
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Cartographic from './Cartographic.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import GeometryType from './GeometryType.js';
-import Matrix2 from './Matrix2.js';
-import Matrix3 from './Matrix3.js';
-import Matrix4 from './Matrix4.js';
-import PrimitiveType from './PrimitiveType.js';
-import Quaternion from './Quaternion.js';
-import Rectangle from './Rectangle.js';
-import Transforms from './Transforms.js';
-
-    /**
-     * A geometry representation with attributes forming vertices and optional index data
-     * defining primitives.  Geometries and an {@link Appearance}, which describes the shading,
-     * can be assigned to a {@link Primitive} for visualization.  A <code>Primitive</code> can
-     * be created from many heterogeneous - in many cases - geometries for performance.
-     * <p>
-     * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.
-     * </p>
-     *
-     * @alias Geometry
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices.
-     * @param {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry.
-     * @param {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry.
-     * @param {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.
-     *
-     * @see PolygonGeometry
-     * @see RectangleGeometry
-     * @see EllipseGeometry
-     * @see CircleGeometry
-     * @see WallGeometry
-     * @see SimplePolylineGeometry
-     * @see BoxGeometry
-     * @see EllipsoidGeometry
-     *
-     * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo}
-     *
-     * @example
-     * // Create geometry with a position attribute and indexed lines.
-     * var positions = new Float64Array([
-     *   0.0, 0.0, 0.0,
-     *   7500000.0, 0.0, 0.0,
-     *   0.0, 7500000.0, 0.0
-     * ]);
-     *
-     * var geometry = new Cesium.Geometry({
-     *   attributes : {
-     *     position : new Cesium.GeometryAttribute({
-     *       componentDatatype : Cesium.ComponentDatatype.DOUBLE,
-     *       componentsPerAttribute : 3,
-     *       values : positions
-     *     })
-     *   },
-     *   indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
-     *   primitiveType : Cesium.PrimitiveType.LINES,
-     *   boundingSphere : Cesium.BoundingSphere.fromVertices(positions)
-     * });
-     */
-    function Geometry(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('options.attributes', options.attributes);
-        //>>includeEnd('debug');
-
-        /**
-         * Attributes, which make up the geometry's vertices.  Each property in this object corresponds to a
-         * {@link GeometryAttribute} containing the attribute's data.
-         * <p>
-         * Attributes are always stored non-interleaved in a Geometry.
-         * </p>
-         * <p>
-         * There are reserved attribute names with well-known semantics.  The following attributes
-         * are created by a Geometry (depending on the provided {@link VertexFormat}.
-         * <ul>
-         *    <li><code>position</code> - 3D vertex position.  64-bit floating-point (for precision).  3 components per attribute.  See {@link VertexFormat#position}.</li>
-         *    <li><code>normal</code> - Normal (normalized), commonly used for lighting.  32-bit floating-point.  3 components per attribute.  See {@link VertexFormat#normal}.</li>
-         *    <li><code>st</code> - 2D texture coordinate.  32-bit floating-point.  2 components per attribute.  See {@link VertexFormat#st}.</li>
-         *    <li><code>bitangent</code> - Bitangent (normalized), used for tangent-space effects like bump mapping.  32-bit floating-point.  3 components per attribute.  See {@link VertexFormat#bitangent}.</li>
-         *    <li><code>tangent</code> - Tangent (normalized), used for tangent-space effects like bump mapping.  32-bit floating-point.  3 components per attribute.  See {@link VertexFormat#tangent}.</li>
-         * </ul>
-         * </p>
-         * <p>
-         * The following attribute names are generally not created by a Geometry, but are added
-         * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare
-         * the geometry for rendering.
-         * <ul>
-         *    <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>
-         *    <li><code>position3DLow</code> - Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>
-         *    <li><code>position3DHigh</code> - High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>
-         *    <li><code>position2DLow</code> - Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}.  32-bit floating-point.  4 components per attribute.</li>
-         *    <li><code>color</code> - RGBA color (normalized) usually from {@link GeometryInstance#color}.  32-bit floating-point.  4 components per attribute.</li>
-         *    <li><code>pickColor</code> - RGBA color used for picking.  32-bit floating-point.  4 components per attribute.</li>
-         * </ul>
-         * </p>
-         *
-         * @type GeometryAttributes
-         *
-         * @default undefined
-         *
-         *
-         * @example
-         * geometry.attributes.position = new Cesium.GeometryAttribute({
-         *   componentDatatype : Cesium.ComponentDatatype.FLOAT,
-         *   componentsPerAttribute : 3,
-         *   values : new Float32Array(0)
-         * });
-         *
-         * @see GeometryAttribute
-         * @see VertexFormat
-         */
-        this.attributes = options.attributes;
-
-        /**
-         * Optional index data that - along with {@link Geometry#primitiveType} -
-         * determines the primitives in the geometry.
-         *
-         * @type Array
-         *
-         * @default undefined
-         */
-        this.indices = options.indices;
-
-        /**
-         * The type of primitives in the geometry.  This is most often {@link PrimitiveType.TRIANGLES},
-         * but can varying based on the specific geometry.
-         *
-         * @type PrimitiveType
-         *
-         * @default undefined
-         */
-        this.primitiveType = defaultValue(options.primitiveType, PrimitiveType.TRIANGLES);
-
-        /**
-         * An optional bounding sphere that fully encloses the geometry.  This is
-         * commonly used for culling.
-         *
-         * @type BoundingSphere
-         *
-         * @default undefined
-         */
-        this.boundingSphere = options.boundingSphere;
-
-        /**
-         * @private
-         */
-        this.geometryType = defaultValue(options.geometryType, GeometryType.NONE);
-
-        /**
-         * @private
-         */
-        this.boundingSphereCV = options.boundingSphereCV;
-
-        /**
-         * @private
-         * Used for computing the bounding sphere for geometry using the applyOffset vertex attribute
-         */
-        this.offsetAttribute = options.offsetAttribute;
-    }
-
-    /**
-     * Computes the number of vertices in a geometry.  The runtime is linear with
-     * respect to the number of attributes in a vertex, not the number of vertices.
-     *
-     * @param {Geometry} geometry The geometry.
-     * @returns {Number} The number of vertices in the geometry.
-     *
-     * @example
-     * var numVertices = Cesium.Geometry.computeNumberOfVertices(geometry);
-     */
-    Geometry.computeNumberOfVertices = function(geometry) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('geometry', geometry);
-        //>>includeEnd('debug');
-
-        var numberOfVertices = -1;
-        for ( var property in geometry.attributes) {
-            if (geometry.attributes.hasOwnProperty(property) &&
-                    defined(geometry.attributes[property]) &&
-                    defined(geometry.attributes[property].values)) {
-
-                var attribute = geometry.attributes[property];
-                var num = attribute.values.length / attribute.componentsPerAttribute;
-                //>>includeStart('debug', pragmas.debug);
-                if ((numberOfVertices !== num) && (numberOfVertices !== -1)) {
-                    throw new DeveloperError('All attribute lists must have the same number of attributes.');
-                }
-                //>>includeEnd('debug');
-                numberOfVertices = num;
-            }
-        }
-
-        return numberOfVertices;
-    };
-
-    var rectangleCenterScratch = new Cartographic();
-    var enuCenterScratch = new Cartesian3();
-    var fixedFrameToEnuScratch = new Matrix4();
-    var boundingRectanglePointsCartographicScratch = [new Cartographic(), new Cartographic(), new Cartographic()];
-    var boundingRectanglePointsEnuScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];
-    var points2DScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];
-    var pointEnuScratch = new Cartesian3();
-    var enuRotationScratch = new Quaternion();
-    var enuRotationMatrixScratch = new Matrix4();
-    var rotation2DScratch = new Matrix2();
-
-    /**
-     * For remapping texture coordinates when rendering GroundPrimitives with materials.
-     * GroundPrimitive texture coordinates are computed to align with the cartographic coordinate system on the globe.
-     * However, EllipseGeometry, RectangleGeometry, and PolygonGeometry all bake rotations to per-vertex texture coordinates
-     * using different strategies.
-     *
-     * This method is used by EllipseGeometry and PolygonGeometry to approximate the same visual effect.
-     * We encapsulate rotation and scale by computing a "transformed" texture coordinate system and computing
-     * a set of reference points from which "cartographic" texture coordinates can be remapped to the "transformed"
-     * system using distances to lines in 2D.
-     *
-     * This approximation becomes less accurate as the covered area increases, especially for GroundPrimitives near the poles,
-     * but is generally reasonable for polygons and ellipses around the size of USA states.
-     *
-     * RectangleGeometry has its own version of this method that computes remapping coordinates using cartographic space
-     * as an intermediary instead of local ENU, which is more accurate for large-area rectangles.
-     *
-     * @param {Cartesian3[]} positions Array of positions outlining the geometry
-     * @param {Number} stRotation Texture coordinate rotation.
-     * @param {Ellipsoid} ellipsoid Ellipsoid for projecting and generating local vectors.
-     * @param {Rectangle} boundingRectangle Bounding rectangle around the positions.
-     * @returns {Number[]} An array of 6 numbers specifying [minimum point, u extent, v extent] as points in the "cartographic" system.
-     * @private
-     */
-    Geometry._textureCoordinateRotationPoints = function(positions, stRotation, ellipsoid, boundingRectangle) {
-        var i;
-
-        // Create a local east-north-up coordinate system centered on the polygon's bounding rectangle.
-        // Project the southwest, northwest, and southeast corners of the bounding rectangle into the plane of ENU as 2D points.
-        // These are the equivalents of (0,0), (0,1), and (1,0) in the texture coordiante system computed in ShadowVolumeAppearanceFS,
-        // aka "ENU texture space."
-        var rectangleCenter = Rectangle.center(boundingRectangle, rectangleCenterScratch);
-        var enuCenter = Cartographic.toCartesian(rectangleCenter, ellipsoid, enuCenterScratch);
-        var enuToFixedFrame = Transforms.eastNorthUpToFixedFrame(enuCenter, ellipsoid, fixedFrameToEnuScratch);
-        var fixedFrameToEnu = Matrix4.inverse(enuToFixedFrame, fixedFrameToEnuScratch);
-
-        var boundingPointsEnu = boundingRectanglePointsEnuScratch;
-        var boundingPointsCarto = boundingRectanglePointsCartographicScratch;
-
-        boundingPointsCarto[0].longitude = boundingRectangle.west;
-        boundingPointsCarto[0].latitude = boundingRectangle.south;
-
-        boundingPointsCarto[1].longitude = boundingRectangle.west;
-        boundingPointsCarto[1].latitude = boundingRectangle.north;
-
-        boundingPointsCarto[2].longitude = boundingRectangle.east;
-        boundingPointsCarto[2].latitude = boundingRectangle.south;
-
-        var posEnu = pointEnuScratch;
-
-        for (i = 0; i < 3; i++) {
-            Cartographic.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);
-            posEnu = Matrix4.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);
-            boundingPointsEnu[i].x = posEnu.x;
-            boundingPointsEnu[i].y = posEnu.y;
-        }
-
-        // Rotate each point in the polygon around the up vector in the ENU by -stRotation and project into ENU as 2D.
-        // Compute the bounding box of these rotated points in the 2D ENU plane.
-        // Rotate the corners back by stRotation, then compute their equivalents in the ENU texture space using the corners computed earlier.
-        var rotation = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, -stRotation, enuRotationScratch);
-        var textureMatrix = Matrix3.fromQuaternion(rotation, enuRotationMatrixScratch);
-
-        var positionsLength = positions.length;
-        var enuMinX = Number.POSITIVE_INFINITY;
-        var enuMinY = Number.POSITIVE_INFINITY;
-        var enuMaxX = Number.NEGATIVE_INFINITY;
-        var enuMaxY = Number.NEGATIVE_INFINITY;
-        for (i = 0; i < positionsLength; i++) {
-            posEnu = Matrix4.multiplyByPointAsVector(fixedFrameToEnu, positions[i], posEnu);
-            posEnu = Matrix3.multiplyByVector(textureMatrix, posEnu, posEnu);
-
-            enuMinX = Math.min(enuMinX, posEnu.x);
-            enuMinY = Math.min(enuMinY, posEnu.y);
-            enuMaxX = Math.max(enuMaxX, posEnu.x);
-            enuMaxY = Math.max(enuMaxY, posEnu.y);
-        }
-
-        var toDesiredInComputed = Matrix2.fromRotation(stRotation, rotation2DScratch);
-
-        var points2D = points2DScratch;
-        points2D[0].x = enuMinX;
-        points2D[0].y = enuMinY;
-
-        points2D[1].x = enuMinX;
-        points2D[1].y = enuMaxY;
-
-        points2D[2].x = enuMaxX;
-        points2D[2].y = enuMinY;
-
-        var boundingEnuMin = boundingPointsEnu[0];
-        var boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;
-        var boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;
-
-        for (i = 0; i < 3; i++) {
-            var point2D = points2D[i];
-            // rotate back
-            Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);
-
-            // Convert point into east-north texture coordinate space
-            point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;
-            point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;
-        }
-
-        var minXYCorner = points2D[0];
-        var maxYCorner = points2D[1];
-        var maxXCorner = points2D[2];
-        var result = new Array(6);
-        Cartesian2.pack(minXYCorner, result);
-        Cartesian2.pack(maxYCorner, result, 2);
-        Cartesian2.pack(maxXCorner, result, 4);
-
-        return result;
-    };
-export default Geometry;

+ 0 - 133
Source/Core/GeometryAttribute.js

@@ -1,133 +0,0 @@
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * Values and type information for geometry attributes.  A {@link Geometry}
-     * generally contains one or more attributes.  All attributes together form
-     * the geometry's vertices.
-     *
-     * @alias GeometryAttribute
-     * @constructor
-     *
-     * @param {Object} [options] Object with the following properties:
-     * @param {ComponentDatatype} [options.componentDatatype] The datatype of each component in the attribute, e.g., individual elements in values.
-     * @param {Number} [options.componentsPerAttribute] A number between 1 and 4 that defines the number of components in an attributes.
-     * @param {Boolean} [options.normalize=false] When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
-     * @param {TypedArray} [options.values] The values for the attributes stored in a typed array.
-     *
-     * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.
-     *
-     *
-     * @example
-     * var geometry = new Cesium.Geometry({
-     *   attributes : {
-     *     position : new Cesium.GeometryAttribute({
-     *       componentDatatype : Cesium.ComponentDatatype.FLOAT,
-     *       componentsPerAttribute : 3,
-     *       values : new Float32Array([
-     *         0.0, 0.0, 0.0,
-     *         7500000.0, 0.0, 0.0,
-     *         0.0, 7500000.0, 0.0
-     *       ])
-     *     })
-     *   },
-     *   primitiveType : Cesium.PrimitiveType.LINE_LOOP
-     * });
-     *
-     * @see Geometry
-     */
-    function GeometryAttribute(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(options.componentDatatype)) {
-            throw new DeveloperError('options.componentDatatype is required.');
-        }
-        if (!defined(options.componentsPerAttribute)) {
-            throw new DeveloperError('options.componentsPerAttribute is required.');
-        }
-        if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
-            throw new DeveloperError('options.componentsPerAttribute must be between 1 and 4.');
-        }
-        if (!defined(options.values)) {
-            throw new DeveloperError('options.values is required.');
-        }
-        //>>includeEnd('debug');
-
-        /**
-         * The datatype of each component in the attribute, e.g., individual elements in
-         * {@link GeometryAttribute#values}.
-         *
-         * @type ComponentDatatype
-         *
-         * @default undefined
-         */
-        this.componentDatatype = options.componentDatatype;
-
-        /**
-         * A number between 1 and 4 that defines the number of components in an attributes.
-         * For example, a position attribute with x, y, and z components would have 3 as
-         * shown in the code example.
-         *
-         * @type Number
-         *
-         * @default undefined
-         *
-         * @example
-         * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
-         * attribute.componentsPerAttribute = 3;
-         * attribute.values = new Float32Array([
-         *   0.0, 0.0, 0.0,
-         *   7500000.0, 0.0, 0.0,
-         *   0.0, 7500000.0, 0.0
-         * ]);
-         */
-        this.componentsPerAttribute = options.componentsPerAttribute;
-
-        /**
-         * When <code>true</code> and <code>componentDatatype</code> is an integer format,
-         * indicate that the components should be mapped to the range [0, 1] (unsigned)
-         * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
-         * <p>
-         * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
-         * </p>
-         *
-         * @type Boolean
-         *
-         * @default false
-         *
-         * @example
-         * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
-         * attribute.componentsPerAttribute = 4;
-         * attribute.normalize = true;
-         * attribute.values = new Uint8Array([
-         *   Cesium.Color.floatToByte(color.red),
-         *   Cesium.Color.floatToByte(color.green),
-         *   Cesium.Color.floatToByte(color.blue),
-         *   Cesium.Color.floatToByte(color.alpha)
-         * ]);
-         */
-        this.normalize = defaultValue(options.normalize, false);
-
-        /**
-         * The values for the attributes stored in a typed array.  In the code example,
-         * every three elements in <code>values</code> defines one attributes since
-         * <code>componentsPerAttribute</code> is 3.
-         *
-         * @type TypedArray
-         *
-         * @default undefined
-         *
-         * @example
-         * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
-         * attribute.componentsPerAttribute = 3;
-         * attribute.values = new Float32Array([
-         *   0.0, 0.0, 0.0,
-         *   7500000.0, 0.0, 0.0,
-         *   0.0, 7500000.0, 0.0
-         * ]);
-         */
-        this.values = options.values;
-    }
-export default GeometryAttribute;

+ 0 - 88
Source/Core/GeometryAttributes.js

@@ -1,88 +0,0 @@
-import defaultValue from './defaultValue.js';
-
-    /**
-     * Attributes, which make up a geometry's vertices.  Each property in this object corresponds to a
-     * {@link GeometryAttribute} containing the attribute's data.
-     * <p>
-     * Attributes are always stored non-interleaved in a Geometry.
-     * </p>
-     *
-     * @alias GeometryAttributes
-     * @constructor
-     */
-    function GeometryAttributes(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        /**
-         * The 3D position attribute.
-         * <p>
-         * 64-bit floating-point (for precision).  3 components per attribute.
-         * </p>
-         *
-         * @type GeometryAttribute
-         *
-         * @default undefined
-         */
-        this.position = options.position;
-
-        /**
-         * The normal attribute (normalized), which is commonly used for lighting.
-         * <p>
-         * 32-bit floating-point.  3 components per attribute.
-         * </p>
-         *
-         * @type GeometryAttribute
-         *
-         * @default undefined
-         */
-        this.normal = options.normal;
-
-        /**
-         * The 2D texture coordinate attribute.
-         * <p>
-         * 32-bit floating-point.  2 components per attribute
-         * </p>
-         *
-         * @type GeometryAttribute
-         *
-         * @default undefined
-         */
-        this.st = options.st;
-
-        /**
-         * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
-         * <p>
-         * 32-bit floating-point.  3 components per attribute.
-         * </p>
-         *
-         * @type GeometryAttribute
-         *
-         * @default undefined
-         */
-        this.bitangent = options.bitangent;
-
-        /**
-         * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
-         * <p>
-         * 32-bit floating-point.  3 components per attribute.
-         * </p>
-         *
-         * @type GeometryAttribute
-         *
-         * @default undefined
-         */
-        this.tangent = options.tangent;
-
-        /**
-         * The color attribute.
-         * <p>
-         * 8-bit unsigned integer. 4 components per attribute.
-         * </p>
-         *
-         * @type GeometryAttribute
-         *
-         * @default undefined
-         */
-        this.color = options.color;
-    }
-export default GeometryAttributes;

+ 0 - 119
Source/Core/GeometryInstance.js

@@ -1,119 +0,0 @@
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-import Matrix4 from './Matrix4.js';
-
-    /**
-     * Geometry instancing allows one {@link Geometry} object to be positions in several
-     * different locations and colored uniquely.  For example, one {@link BoxGeometry} can
-     * be instanced several times, each with a different <code>modelMatrix</code> to change
-     * its position, rotation, and scale.
-     *
-     * @alias GeometryInstance
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Geometry} options.geometry The geometry to instance.
-     * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.
-     * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.
-     * @param {Object} [options.attributes] Per-instance attributes like a show or color attribute shown in the example below.
-     *
-     *
-     * @example
-     * // Create geometry for a box, and two instances that refer to it.
-     * // One instance positions the box on the bottom and colored aqua.
-     * // The other instance positions the box on the top and color white.
-     * var geometry = Cesium.BoxGeometry.fromDimensions({
-     *   vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
-     *   dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
-     * });
-     * var instanceBottom = new Cesium.GeometryInstance({
-     *   geometry : geometry,
-     *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
-     *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
-     *   attributes : {
-     *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
-     *   },
-     *   id : 'bottom'
-     * });
-     * var instanceTop = new Cesium.GeometryInstance({
-     *   geometry : geometry,
-     *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
-     *     Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
-     *   attributes : {
-     *     color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
-     *   },
-     *   id : 'top'
-     * });
-     *
-     * @see Geometry
-     */
-    function GeometryInstance(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(options.geometry)) {
-            throw new DeveloperError('options.geometry is required.');
-        }
-        //>>includeEnd('debug');
-
-        /**
-         * The geometry being instanced.
-         *
-         * @type Geometry
-         *
-         * @default undefined
-         */
-        this.geometry = options.geometry;
-
-        /**
-         * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
-         * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
-         * Local reference frames can be used by providing a different transformation matrix, like that returned
-         * by {@link Transforms.eastNorthUpToFixedFrame}.
-         *
-         * @type Matrix4
-         *
-         * @default Matrix4.IDENTITY
-         */
-        this.modelMatrix = Matrix4.clone(defaultValue(options.modelMatrix, Matrix4.IDENTITY));
-
-        /**
-         * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
-         *
-         * @type Object
-         *
-         * @default undefined
-         *
-         * @see Scene#pick
-         * @see Primitive#getGeometryInstanceAttributes
-         */
-        this.id = options.id;
-
-        /**
-         * Used for picking primitives that wrap geometry instances.
-         *
-         * @private
-         */
-        this.pickPrimitive = options.pickPrimitive;
-
-        /**
-         * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
-         * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
-         *
-         * @type Object
-         *
-         * @default undefined
-         */
-        this.attributes = defaultValue(options.attributes, {});
-
-        /**
-         * @private
-         */
-        this.westHemisphereGeometry = undefined;
-        /**
-         * @private
-         */
-        this.eastHemisphereGeometry = undefined;
-    }
-export default GeometryInstance;

+ 0 - 133
Source/Core/GeometryInstanceAttribute.js

@@ -1,133 +0,0 @@
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import DeveloperError from './DeveloperError.js';
-
-    /**
-     * Values and type information for per-instance geometry attributes.
-     *
-     * @alias GeometryInstanceAttribute
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {ComponentDatatype} options.componentDatatype The datatype of each component in the attribute, e.g., individual elements in values.
-     * @param {Number} options.componentsPerAttribute A number between 1 and 4 that defines the number of components in an attributes.
-     * @param {Boolean} [options.normalize=false] When <code>true</code> and <code>componentDatatype</code> is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
-     * @param {Number[]} options.value The value for the attribute.
-     *
-     * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.
-     *
-     *
-     * @example
-     * var instance = new Cesium.GeometryInstance({
-     *   geometry : Cesium.BoxGeometry.fromDimensions({
-     *     dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
-     *   }),
-     *   modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
-     *     Cesium.Cartesian3.fromDegrees(0.0, 0.0)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
-     *   id : 'box',
-     *   attributes : {
-     *     color : new Cesium.GeometryInstanceAttribute({
-     *       componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
-     *       componentsPerAttribute : 4,
-     *       normalize : true,
-     *       value : [255, 255, 0, 255]
-     *     })
-     *   }
-     * });
-     *
-     * @see ColorGeometryInstanceAttribute
-     * @see ShowGeometryInstanceAttribute
-     * @see DistanceDisplayConditionGeometryInstanceAttribute
-     */
-    function GeometryInstanceAttribute(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!defined(options.componentDatatype)) {
-            throw new DeveloperError('options.componentDatatype is required.');
-        }
-        if (!defined(options.componentsPerAttribute)) {
-            throw new DeveloperError('options.componentsPerAttribute is required.');
-        }
-        if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
-            throw new DeveloperError('options.componentsPerAttribute must be between 1 and 4.');
-        }
-        if (!defined(options.value)) {
-            throw new DeveloperError('options.value is required.');
-        }
-        //>>includeEnd('debug');
-
-        /**
-         * The datatype of each component in the attribute, e.g., individual elements in
-         * {@link GeometryInstanceAttribute#value}.
-         *
-         * @type ComponentDatatype
-         *
-         * @default undefined
-         */
-        this.componentDatatype = options.componentDatatype;
-
-        /**
-         * A number between 1 and 4 that defines the number of components in an attributes.
-         * For example, a position attribute with x, y, and z components would have 3 as
-         * shown in the code example.
-         *
-         * @type Number
-         *
-         * @default undefined
-         *
-         * @example
-         * show : new Cesium.GeometryInstanceAttribute({
-         *   componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
-         *   componentsPerAttribute : 1,
-         *   normalize : true,
-         *   value : [1.0]
-         * })
-         */
-        this.componentsPerAttribute = options.componentsPerAttribute;
-
-        /**
-         * When <code>true</code> and <code>componentDatatype</code> is an integer format,
-         * indicate that the components should be mapped to the range [0, 1] (unsigned)
-         * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
-         * <p>
-         * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.
-         * </p>
-         *
-         * @type Boolean
-         *
-         * @default false
-         *
-         * @example
-         * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;
-         * attribute.componentsPerAttribute = 4;
-         * attribute.normalize = true;
-         * attribute.value = [
-         *   Cesium.Color.floatToByte(color.red),
-         *   Cesium.Color.floatToByte(color.green),
-         *   Cesium.Color.floatToByte(color.blue),
-         *   Cesium.Color.floatToByte(color.alpha)
-         * ];
-         */
-        this.normalize = defaultValue(options.normalize, false);
-
-        /**
-         * The values for the attributes stored in a typed array.  In the code example,
-         * every three elements in <code>values</code> defines one attributes since
-         * <code>componentsPerAttribute</code> is 3.
-         *
-         * @type {Number[]}
-         *
-         * @default undefined
-         *
-         * @example
-         * show : new Cesium.GeometryInstanceAttribute({
-         *   componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
-         *   componentsPerAttribute : 1,
-         *   normalize : true,
-         *   value : [1.0]
-         * })
-         */
-        this.value = options.value;
-    }
-export default GeometryInstanceAttribute;

+ 0 - 12
Source/Core/GeometryOffsetAttribute.js

@@ -1,12 +0,0 @@
-import freezeObject from '../Core/freezeObject.js';
-
-    /**
-     * Represents which vertices should have a value of `true` for the `applyOffset` attribute
-     * @private
-     */
-    var GeometryOffsetAttribute = {
-        NONE : 0,
-        TOP : 1,
-        ALL : 2
-    };
-export default freezeObject(GeometryOffsetAttribute);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 2592
Source/Core/GeometryPipeline.js


+ 0 - 12
Source/Core/GeometryType.js

@@ -1,12 +0,0 @@
-import freezeObject from './freezeObject.js';
-
-    /**
-     * @private
-     */
-    var GeometryType = {
-        NONE : 0,
-        TRIANGLES : 1,
-        LINES : 2,
-        POLYLINES : 3
-    };
-export default freezeObject(GeometryType);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 550
Source/Core/GoogleEarthEnterpriseMetadata.js


+ 0 - 494
Source/Core/GoogleEarthEnterpriseTerrainData.js

@@ -1,494 +0,0 @@
-import BoundingSphere from './BoundingSphere.js';
-import Cartesian2 from './Cartesian2.js';
-import Cartesian3 from './Cartesian3.js';
-import Check from './Check.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import IndexDatatype from './IndexDatatype.js';
-import Intersections2D from './Intersections2D.js';
-import CesiumMath from './Math.js';
-import OrientedBoundingBox from './OrientedBoundingBox.js';
-import QuantizedMeshTerrainData from './QuantizedMeshTerrainData.js';
-import Rectangle from './Rectangle.js';
-import TaskProcessor from './TaskProcessor.js';
-import TerrainEncoding from './TerrainEncoding.js';
-import TerrainMesh from './TerrainMesh.js';
-
-    /**
-     * Terrain data for a single tile from a Google Earth Enterprise server.
-     *
-     * @alias GoogleEarthEnterpriseTerrainData
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {ArrayBuffer} options.buffer The buffer containing terrain data.
-     * @param {Number} options.negativeAltitudeExponentBias Multiplier for negative terrain heights that are encoded as very small positive values.
-     * @param {Number} options.negativeElevationThreshold Threshold for negative values
-     * @param {Number} [options.childTileMask=15] A bit mask indicating which of this tile's four children exist.
-     *                 If a child's bit is set, geometry will be requested for that tile as well when it
-     *                 is needed.  If the bit is cleared, the child tile is not requested and geometry is
-     *                 instead upsampled from the parent.  The bit values are as follows:
-     *                 <table>
-     *                  <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr>
-     *                  <tr><td>0</td><td>1</td><td>Southwest</td></tr>
-     *                  <tr><td>1</td><td>2</td><td>Southeast</td></tr>
-     *                  <tr><td>2</td><td>4</td><td>Northeast</td></tr>
-     *                  <tr><td>3</td><td>8</td><td>Northwest</td></tr>
-     *                 </table>
-     * @param {Boolean} [options.createdByUpsampling=false] True if this instance was created by upsampling another instance;
-     *                  otherwise, false.
-     * @param {Credit[]} [options.credits] Array of credits for this tile.
-     *
-     *
-     * @example
-     * var buffer = ...
-     * var childTileMask = ...
-     * var terrainData = new Cesium.GoogleEarthEnterpriseTerrainData({
-     *   buffer : heightBuffer,
-     *   childTileMask : childTileMask
-     * });
-     *
-     * @see TerrainData
-     * @see HeightTerrainData
-     * @see QuantizedMeshTerrainData
-     */
-    function GoogleEarthEnterpriseTerrainData(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('options.buffer', options.buffer);
-        Check.typeOf.number('options.negativeAltitudeExponentBias', options.negativeAltitudeExponentBias);
-        Check.typeOf.number('options.negativeElevationThreshold', options.negativeElevationThreshold);
-        //>>includeEnd('debug');
-
-        this._buffer = options.buffer;
-        this._credits = options.credits;
-        this._negativeAltitudeExponentBias = options.negativeAltitudeExponentBias;
-        this._negativeElevationThreshold = options.negativeElevationThreshold;
-
-        // Convert from google layout to layout of other providers
-        // 3 2 -> 2 3
-        // 0 1 -> 0 1
-        var googleChildTileMask = defaultValue(options.childTileMask, 15);
-        var childTileMask = googleChildTileMask & 3; // Bottom row is identical
-        childTileMask |= (googleChildTileMask & 4) ? 8 : 0; // NE
-        childTileMask |= (googleChildTileMask & 8) ? 4 : 0; // NW
-
-        this._childTileMask = childTileMask;
-
-        this._createdByUpsampling = defaultValue(options.createdByUpsampling, false);
-
-        this._skirtHeight = undefined;
-        this._bufferType = this._buffer.constructor;
-        this._mesh = undefined;
-        this._minimumHeight = undefined;
-        this._maximumHeight = undefined;
-        this._vertexCountWithoutSkirts = undefined;
-        this._skirtIndex = undefined;
-    }
-
-    defineProperties(GoogleEarthEnterpriseTerrainData.prototype, {
-        /**
-         * An array of credits for this tile
-         * @memberof GoogleEarthEnterpriseTerrainData.prototype
-         * @type {Credit[]}
-         */
-        credits : {
-            get : function() {
-                return this._credits;
-            }
-        },
-        /**
-         * The water mask included in this terrain data, if any.  A water mask is a rectangular
-         * Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land.
-         * Values in between 0 and 255 are allowed as well to smoothly blend between land and water.
-         * @memberof GoogleEarthEnterpriseTerrainData.prototype
-         * @type {Uint8Array|Image|Canvas}
-         */
-        waterMask : {
-            get : function() {
-                return undefined;
-            }
-        }
-    });
-
-    var taskProcessor = new TaskProcessor('createVerticesFromGoogleEarthEnterpriseBuffer');
-
-    var nativeRectangleScratch = new Rectangle();
-    var rectangleScratch = new Rectangle();
-
-    /**
-     * Creates a {@link TerrainMesh} from this terrain data.
-     *
-     * @private
-     *
-     * @param {TilingScheme} tilingScheme The tiling scheme to which this tile belongs.
-     * @param {Number} x The X coordinate of the tile for which to create the terrain data.
-     * @param {Number} y The Y coordinate of the tile for which to create the terrain data.
-     * @param {Number} level The level of the tile for which to create the terrain data.
-     * @param {Number} [exaggeration=1.0] The scale used to exaggerate the terrain.
-     * @returns {Promise.<TerrainMesh>|undefined} A promise for the terrain mesh, or undefined if too many
-     *          asynchronous mesh creations are already in progress and the operation should
-     *          be retried later.
-     */
-    GoogleEarthEnterpriseTerrainData.prototype.createMesh = function(tilingScheme, x, y, level, exaggeration) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('tilingScheme', tilingScheme);
-        Check.typeOf.number('x', x);
-        Check.typeOf.number('y', y);
-        Check.typeOf.number('level', level);
-        //>>includeEnd('debug');
-
-        var ellipsoid = tilingScheme.ellipsoid;
-        tilingScheme.tileXYToNativeRectangle(x, y, level, nativeRectangleScratch);
-        tilingScheme.tileXYToRectangle(x, y, level, rectangleScratch);
-        exaggeration = defaultValue(exaggeration, 1.0);
-
-        // Compute the center of the tile for RTC rendering.
-        var center = ellipsoid.cartographicToCartesian(Rectangle.center(rectangleScratch));
-
-        var levelZeroMaxError = 40075.16; // From Google's Doc
-        var thisLevelMaxError = levelZeroMaxError / (1 << level);
-        this._skirtHeight = Math.min(thisLevelMaxError * 8.0, 1000.0);
-
-        var verticesPromise = taskProcessor.scheduleTask({
-            buffer : this._buffer,
-            nativeRectangle : nativeRectangleScratch,
-            rectangle : rectangleScratch,
-            relativeToCenter : center,
-            ellipsoid : ellipsoid,
-            skirtHeight : this._skirtHeight,
-            exaggeration : exaggeration,
-            includeWebMercatorT : true,
-            negativeAltitudeExponentBias: this._negativeAltitudeExponentBias,
-            negativeElevationThreshold: this._negativeElevationThreshold
-        });
-
-        if (!defined(verticesPromise)) {
-            // Postponed
-            return undefined;
-        }
-
-        var that = this;
-        return verticesPromise
-            .then(function(result) {
-                // Clone complex result objects because the transfer from the web worker
-                // has stripped them down to JSON-style objects.
-                that._mesh = new TerrainMesh(
-                    center,
-                    new Float32Array(result.vertices),
-                    new Uint16Array(result.indices),
-                    result.minimumHeight,
-                    result.maximumHeight,
-                    BoundingSphere.clone(result.boundingSphere3D),
-                    Cartesian3.clone(result.occludeePointInScaledSpace),
-                    result.numberOfAttributes,
-                    OrientedBoundingBox.clone(result.orientedBoundingBox),
-                    TerrainEncoding.clone(result.encoding),
-                    exaggeration,
-                    result.westIndicesSouthToNorth,
-                    result.southIndicesEastToWest,
-                    result.eastIndicesNorthToSouth,
-                    result.northIndicesWestToEast);
-
-                that._vertexCountWithoutSkirts = result.vertexCountWithoutSkirts;
-                that._skirtIndex = result.skirtIndex;
-                that._minimumHeight = result.minimumHeight;
-                that._maximumHeight = result.maximumHeight;
-
-                // Free memory received from server after mesh is created.
-                that._buffer = undefined;
-                return that._mesh;
-            });
-    };
-
-    /**
-     * Computes the terrain height at a specified longitude and latitude.
-     *
-     * @param {Rectangle} rectangle The rectangle covered by this terrain data.
-     * @param {Number} longitude The longitude in radians.
-     * @param {Number} latitude The latitude in radians.
-     * @returns {Number} The terrain height at the specified position.  If the position
-     *          is outside the rectangle, this method will extrapolate the height, which is likely to be wildly
-     *          incorrect for positions far outside the rectangle.
-     */
-    GoogleEarthEnterpriseTerrainData.prototype.interpolateHeight = function(rectangle, longitude, latitude) {
-        var u = CesiumMath.clamp((longitude - rectangle.west) / rectangle.width, 0.0, 1.0);
-        var v = CesiumMath.clamp((latitude - rectangle.south) / rectangle.height, 0.0, 1.0);
-
-        if (!defined(this._mesh)) {
-            return interpolateHeight(this, u, v, rectangle);
-        }
-
-        return interpolateMeshHeight(this, u, v);
-    };
-
-    var upsampleTaskProcessor = new TaskProcessor('upsampleQuantizedTerrainMesh');
-
-    /**
-     * Upsamples this terrain data for use by a descendant tile.  The resulting instance will contain a subset of the
-     * height samples in this instance, interpolated if necessary.
-     *
-     * @param {TilingScheme} tilingScheme The tiling scheme of this terrain data.
-     * @param {Number} thisX The X coordinate of this tile in the tiling scheme.
-     * @param {Number} thisY The Y coordinate of this tile in the tiling scheme.
-     * @param {Number} thisLevel The level of this tile in the tiling scheme.
-     * @param {Number} descendantX The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
-     * @param {Number} descendantY The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
-     * @param {Number} descendantLevel The level within the tiling scheme of the descendant tile for which we are upsampling.
-     * @returns {Promise.<HeightmapTerrainData>|undefined} A promise for upsampled heightmap terrain data for the descendant tile,
-     *          or undefined if too many asynchronous upsample operations are in progress and the request has been
-     *          deferred.
-     */
-    GoogleEarthEnterpriseTerrainData.prototype.upsample = function(tilingScheme, thisX, thisY, thisLevel, descendantX, descendantY, descendantLevel) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.object('tilingScheme', tilingScheme);
-        Check.typeOf.number('thisX', thisX);
-        Check.typeOf.number('thisY', thisY);
-        Check.typeOf.number('thisLevel', thisLevel);
-        Check.typeOf.number('descendantX', descendantX);
-        Check.typeOf.number('descendantY', descendantY);
-        Check.typeOf.number('descendantLevel', descendantLevel);
-        var levelDifference = descendantLevel - thisLevel;
-        if (levelDifference > 1) {
-            throw new DeveloperError('Upsampling through more than one level at a time is not currently supported.');
-        }
-        //>>includeEnd('debug');
-
-        var mesh = this._mesh;
-        if (!defined(this._mesh)) {
-            return undefined;
-        }
-
-        var isEastChild = thisX * 2 !== descendantX;
-        var isNorthChild = thisY * 2 === descendantY;
-
-        var ellipsoid = tilingScheme.ellipsoid;
-        var childRectangle = tilingScheme.tileXYToRectangle(descendantX, descendantY, descendantLevel);
-
-        var upsamplePromise = upsampleTaskProcessor.scheduleTask({
-            vertices : mesh.vertices,
-            vertexCountWithoutSkirts : this._vertexCountWithoutSkirts,
-            indices : mesh.indices,
-            skirtIndex : this._skirtIndex,
-            encoding : mesh.encoding,
-            minimumHeight : this._minimumHeight,
-            maximumHeight : this._maximumHeight,
-            isEastChild : isEastChild,
-            isNorthChild : isNorthChild,
-            childRectangle : childRectangle,
-            ellipsoid : ellipsoid,
-            exaggeration : mesh.exaggeration
-        });
-
-        if (!defined(upsamplePromise)) {
-            // Postponed
-            return undefined;
-        }
-
-        var that = this;
-        return upsamplePromise
-            .then(function(result) {
-                var quantizedVertices = new Uint16Array(result.vertices);
-                var indicesTypedArray = IndexDatatype.createTypedArray(quantizedVertices.length / 3, result.indices);
-
-                var skirtHeight = that._skirtHeight;
-
-                // Use QuantizedMeshTerrainData since we have what we need already parsed
-                return new QuantizedMeshTerrainData({
-                    quantizedVertices : quantizedVertices,
-                    indices : indicesTypedArray,
-                    minimumHeight : result.minimumHeight,
-                    maximumHeight : result.maximumHeight,
-                    boundingSphere : BoundingSphere.clone(result.boundingSphere),
-                    orientedBoundingBox : OrientedBoundingBox.clone(result.orientedBoundingBox),
-                    horizonOcclusionPoint : Cartesian3.clone(result.horizonOcclusionPoint),
-                    westIndices : result.westIndices,
-                    southIndices : result.southIndices,
-                    eastIndices : result.eastIndices,
-                    northIndices : result.northIndices,
-                    westSkirtHeight : skirtHeight,
-                    southSkirtHeight : skirtHeight,
-                    eastSkirtHeight : skirtHeight,
-                    northSkirtHeight : skirtHeight,
-                    childTileMask : 0,
-                    createdByUpsampling : true,
-                    credits : that._credits
-                });
-            });
-    };
-
-    /**
-     * Determines if a given child tile is available, based on the
-     * {@link HeightmapTerrainData.childTileMask}.  The given child tile coordinates are assumed
-     * to be one of the four children of this tile.  If non-child tile coordinates are
-     * given, the availability of the southeast child tile is returned.
-     *
-     * @param {Number} thisX The tile X coordinate of this (the parent) tile.
-     * @param {Number} thisY The tile Y coordinate of this (the parent) tile.
-     * @param {Number} childX The tile X coordinate of the child tile to check for availability.
-     * @param {Number} childY The tile Y coordinate of the child tile to check for availability.
-     * @returns {Boolean} True if the child tile is available; otherwise, false.
-     */
-    GoogleEarthEnterpriseTerrainData.prototype.isChildAvailable = function(thisX, thisY, childX, childY) {
-        //>>includeStart('debug', pragmas.debug);
-        Check.typeOf.number('thisX', thisX);
-        Check.typeOf.number('thisY', thisY);
-        Check.typeOf.number('childX', childX);
-        Check.typeOf.number('childY', childY);
-        //>>includeEnd('debug');
-
-        var bitNumber = 2; // northwest child
-        if (childX !== thisX * 2) {
-            ++bitNumber; // east child
-        }
-        if (childY !== thisY * 2) {
-            bitNumber -= 2; // south child
-        }
-
-        return (this._childTileMask & (1 << bitNumber)) !== 0;
-    };
-
-    /**
-     * Gets a value indicating whether or not this terrain data was created by upsampling lower resolution
-     * terrain data.  If this value is false, the data was obtained from some other source, such
-     * as by downloading it from a remote server.  This method should return true for instances
-     * returned from a call to {@link HeightmapTerrainData#upsample}.
-     *
-     * @returns {Boolean} True if this instance was created by upsampling; otherwise, false.
-     */
-    GoogleEarthEnterpriseTerrainData.prototype.wasCreatedByUpsampling = function() {
-        return this._createdByUpsampling;
-    };
-
-    var texCoordScratch0 = new Cartesian2();
-    var texCoordScratch1 = new Cartesian2();
-    var texCoordScratch2 = new Cartesian2();
-    var barycentricCoordinateScratch = new Cartesian3();
-
-    function interpolateMeshHeight(terrainData, u, v) {
-        var mesh = terrainData._mesh;
-        var vertices = mesh.vertices;
-        var encoding = mesh.encoding;
-        var indices = mesh.indices;
-
-        for (var i = 0, len = indices.length; i < len; i += 3) {
-            var i0 = indices[i];
-            var i1 = indices[i + 1];
-            var i2 = indices[i + 2];
-
-            var uv0 = encoding.decodeTextureCoordinates(vertices, i0, texCoordScratch0);
-            var uv1 = encoding.decodeTextureCoordinates(vertices, i1, texCoordScratch1);
-            var uv2 = encoding.decodeTextureCoordinates(vertices, i2, texCoordScratch2);
-
-            var barycentric = Intersections2D.computeBarycentricCoordinates(u, v, uv0.x, uv0.y, uv1.x, uv1.y, uv2.x, uv2.y, barycentricCoordinateScratch);
-            if (barycentric.x >= -1e-15 && barycentric.y >= -1e-15 && barycentric.z >= -1e-15) {
-                var h0 = encoding.decodeHeight(vertices, i0);
-                var h1 = encoding.decodeHeight(vertices, i1);
-                var h2 = encoding.decodeHeight(vertices, i2);
-                return barycentric.x * h0 + barycentric.y * h1 + barycentric.z * h2;
-            }
-        }
-
-        // Position does not lie in any triangle in this mesh.
-        return undefined;
-    }
-
-    var sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;
-    var sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;
-    var sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;
-    var sizeOfFloat = Float32Array.BYTES_PER_ELEMENT;
-    var sizeOfDouble = Float64Array.BYTES_PER_ELEMENT;
-
-    function interpolateHeight(terrainData, u, v, rectangle) {
-        var buffer = terrainData._buffer;
-        var quad = 0; // SW
-        var uStart = 0.0;
-        var vStart = 0.0;
-        if (v > 0.5) { // Upper row
-            if (u > 0.5) { // NE
-                quad = 2;
-                uStart = 0.5;
-            } else { // NW
-                quad = 3;
-            }
-            vStart = 0.5;
-        } else if (u > 0.5) { // SE
-            quad = 1;
-            uStart = 0.5;
-        }
-
-        var dv = new DataView(buffer);
-        var offset = 0;
-        for (var q = 0; q < quad; ++q) {
-            offset += dv.getUint32(offset, true);
-            offset += sizeOfUint32;
-        }
-        offset += sizeOfUint32; // Skip length of quad
-        offset += 2 * sizeOfDouble; // Skip origin
-
-        // Read sizes
-        var xSize = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);
-        offset += sizeOfDouble;
-        var ySize = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);
-        offset += sizeOfDouble;
-
-        // Samples per quad
-        var xScale = rectangle.width / xSize / 2;
-        var yScale = rectangle.height / ySize / 2;
-
-        // Number of points
-        var numPoints = dv.getInt32(offset, true);
-        offset += sizeOfInt32;
-
-        // Number of faces
-        var numIndices = dv.getInt32(offset, true) * 3;
-        offset += sizeOfInt32;
-
-        offset += sizeOfInt32; // Skip Level
-
-        var uBuffer = new Array(numPoints);
-        var vBuffer = new Array(numPoints);
-        var heights = new Array(numPoints);
-        var i;
-        for (i = 0; i < numPoints; ++i) {
-            uBuffer[i] = uStart + (dv.getUint8(offset++) * xScale);
-            vBuffer[i] = vStart + (dv.getUint8(offset++) * yScale);
-
-            // Height is stored in units of (1/EarthRadius) or (1/6371010.0)
-            heights[i] = (dv.getFloat32(offset, true) * 6371010.0);
-            offset += sizeOfFloat;
-        }
-
-        var indices = new Array(numIndices);
-        for (i = 0; i < numIndices; ++i) {
-            indices[i] = dv.getUint16(offset, true);
-            offset += sizeOfUint16;
-        }
-
-        for (i = 0; i < numIndices; i += 3) {
-            var i0 = indices[i];
-            var i1 = indices[i + 1];
-            var i2 = indices[i + 2];
-
-            var u0 = uBuffer[i0];
-            var u1 = uBuffer[i1];
-            var u2 = uBuffer[i2];
-
-            var v0 = vBuffer[i0];
-            var v1 = vBuffer[i1];
-            var v2 = vBuffer[i2];
-
-            var barycentric = Intersections2D.computeBarycentricCoordinates(u, v, u0, v0, u1, v1, u2, v2, barycentricCoordinateScratch);
-            if (barycentric.x >= -1e-15 && barycentric.y >= -1e-15 && barycentric.z >= -1e-15) {
-                return barycentric.x * heights[i0] +
-                       barycentric.y * heights[i1] +
-                       barycentric.z * heights[i2];
-            }
-        }
-
-        // Position does not lie in any triangle in this mesh.
-        return undefined;
-    }
-export default GoogleEarthEnterpriseTerrainData;

+ 0 - 581
Source/Core/GoogleEarthEnterpriseTerrainProvider.js

@@ -1,581 +0,0 @@
-import when from '../ThirdParty/when.js';
-import Credit from './Credit.js';
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-import defineProperties from './defineProperties.js';
-import DeveloperError from './DeveloperError.js';
-import Event from './Event.js';
-import GeographicTilingScheme from './GeographicTilingScheme.js';
-import GoogleEarthEnterpriseMetadata from './GoogleEarthEnterpriseMetadata.js';
-import GoogleEarthEnterpriseTerrainData from './GoogleEarthEnterpriseTerrainData.js';
-import HeightmapTerrainData from './HeightmapTerrainData.js';
-import JulianDate from './JulianDate.js';
-import CesiumMath from './Math.js';
-import Rectangle from './Rectangle.js';
-import Request from './Request.js';
-import RequestState from './RequestState.js';
-import RequestType from './RequestType.js';
-import Resource from './Resource.js';
-import RuntimeError from './RuntimeError.js';
-import TaskProcessor from './TaskProcessor.js';
-import TileProviderError from './TileProviderError.js';
-
-    var TerrainState = {
-        UNKNOWN : 0,
-        NONE : 1,
-        SELF : 2,
-        PARENT : 3
-    };
-
-    var julianDateScratch = new JulianDate();
-
-    function TerrainCache() {
-        this._terrainCache = {};
-        this._lastTidy = JulianDate.now();
-    }
-
-    TerrainCache.prototype.add = function(quadKey, buffer) {
-        this._terrainCache[quadKey] = {
-            buffer : buffer,
-            timestamp : JulianDate.now()
-        };
-    };
-
-    TerrainCache.prototype.get = function(quadKey) {
-        var terrainCache = this._terrainCache;
-        var result = terrainCache[quadKey];
-        if (defined(result)) {
-            delete this._terrainCache[quadKey];
-            return result.buffer;
-        }
-    };
-
-    TerrainCache.prototype.tidy = function() {
-        JulianDate.now(julianDateScratch);
-        if (JulianDate.secondsDifference(julianDateScratch, this._lastTidy) > 10) {
-            var terrainCache = this._terrainCache;
-            var keys = Object.keys(terrainCache);
-            var count = keys.length;
-            for (var i = 0; i < count; ++i) {
-                var k = keys[i];
-                var e = terrainCache[k];
-                if (JulianDate.secondsDifference(julianDateScratch, e.timestamp) > 10) {
-                    delete terrainCache[k];
-                }
-            }
-
-            JulianDate.clone(julianDateScratch, this._lastTidy);
-        }
-    };
-
-    /**
-     * Provides tiled terrain using the Google Earth Enterprise REST API.
-     *
-     * @alias GoogleEarthEnterpriseTerrainProvider
-     * @constructor
-     *
-     * @param {Object} options Object with the following properties:
-     * @param {Resource|String} options.url The url of the Google Earth Enterprise server hosting the imagery.
-     * @param {GoogleEarthEnterpriseMetadata} options.metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
-     * @param {Ellipsoid} [options.ellipsoid] The ellipsoid.  If not specified, the WGS84 ellipsoid is used.
-     * @param {Credit|String} [options.credit] A credit for the data source, which is displayed on the canvas.
-     *
-     * @see GoogleEarthEnterpriseImageryProvider
-     * @see CesiumTerrainProvider
-     *
-     * @example
-     * var geeMetadata = new GoogleEarthEnterpriseMetadata('http://www.earthenterprise.org/3d');
-     * var gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
-     *     metadata : geeMetadata
-     * });
-     *
-     * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
-     */
-    function GoogleEarthEnterpriseTerrainProvider(options) {
-        options = defaultValue(options, defaultValue.EMPTY_OBJECT);
-
-        //>>includeStart('debug', pragmas.debug);
-        if (!(defined(options.url) || defined(options.metadata))) {
-            throw new DeveloperError('options.url or options.metadata is required.');
-        }
-        //>>includeEnd('debug');
-
-        var metadata;
-        if (defined(options.metadata)) {
-            metadata = options.metadata;
-        } else {
-            var resource = Resource.createIfNeeded(options.url);
-            metadata = new GoogleEarthEnterpriseMetadata(resource);
-        }
-
-        this._metadata = metadata;
-        this._tilingScheme = new GeographicTilingScheme({
-            numberOfLevelZeroTilesX : 2,
-            numberOfLevelZeroTilesY : 2,
-            rectangle : new Rectangle(-CesiumMath.PI, -CesiumMath.PI, CesiumMath.PI, CesiumMath.PI),
-            ellipsoid : options.ellipsoid
-        });
-
-        var credit = options.credit;
-        if (typeof credit === 'string') {
-            credit = new Credit(credit);
-        }
-        this._credit = credit;
-
-        // Pulled from Google's documentation
-        this._levelZeroMaximumGeometricError = 40075.16;
-
-        this._terrainCache = new TerrainCache();
-        this._terrainPromises = {};
-        this._terrainRequests = {};
-
-        this._errorEvent = new Event();
-
-        this._ready = false;
-        var that = this;
-        var metadataError;
-        this._readyPromise = metadata.readyPromise
-            .then(function(result) {
-                if (!metadata.terrainPresent) {
-                    var e = new RuntimeError('The server ' + metadata.url + ' doesn\'t have terrain');
-                    metadataError = TileProviderError.handleError(metadataError, that, that._errorEvent, e.message, undefined, undefined, undefined, e);
-                    return when.reject(e);
-                }
-
-                TileProviderError.handleSuccess(metadataError);
-                that._ready = result;
-                return result;
-            })
-            .otherwise(function(e) {
-                metadataError = TileProviderError.handleError(metadataError, that, that._errorEvent, e.message, undefined, undefined, undefined, e);
-                return when.reject(e);
-            });
-    }
-
-    defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
-        /**
-         * Gets the name of the Google Earth Enterprise server url hosting the imagery.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {String}
-         * @readonly
-         */
-        url : {
-            get : function() {
-                return this._metadata.url;
-            }
-        },
-
-        /**
-         * Gets the proxy used by this provider.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Proxy}
-         * @readonly
-         */
-        proxy : {
-            get : function() {
-                return this._metadata.proxy;
-            }
-        },
-
-        /**
-         * Gets the tiling scheme used by this provider.  This function should
-         * not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {TilingScheme}
-         * @readonly
-         */
-        tilingScheme : {
-            get : function() {
-                //>>includeStart('debug', pragmas.debug);
-                if (!this._ready) {
-                    throw new DeveloperError('tilingScheme must not be called before the imagery provider is ready.');
-                }
-                //>>includeEnd('debug');
-
-                return this._tilingScheme;
-            }
-        },
-
-        /**
-         * Gets an event that is raised when the imagery provider encounters an asynchronous error.  By subscribing
-         * to the event, you will be notified of the error and can potentially recover from it.  Event listeners
-         * are passed an instance of {@link TileProviderError}.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Event}
-         * @readonly
-         */
-        errorEvent : {
-            get : function() {
-                return this._errorEvent;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the provider is ready for use.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Boolean}
-         * @readonly
-         */
-        ready : {
-            get : function() {
-                return this._ready;
-            }
-        },
-
-        /**
-         * Gets a promise that resolves to true when the provider is ready for use.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Promise.<Boolean>}
-         * @readonly
-         */
-        readyPromise : {
-            get : function() {
-                return this._readyPromise;
-            }
-        },
-
-        /**
-         * Gets the credit to display when this terrain provider is active.  Typically this is used to credit
-         * the source of the terrain.  This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Credit}
-         * @readonly
-         */
-        credit : {
-            get : function() {
-                return this._credit;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the provider includes a water mask.  The water mask
-         * indicates which areas of the globe are water rather than land, so they can be rendered
-         * as a reflective surface with animated waves.  This function should not be
-         * called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        hasWaterMask : {
-            get : function() {
-                return false;
-            }
-        },
-
-        /**
-         * Gets a value indicating whether or not the requested tiles include vertex normals.
-         * This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {Boolean}
-         */
-        hasVertexNormals : {
-            get : function() {
-                return false;
-            }
-        },
-
-        /**
-         * Gets an object that can be used to determine availability of terrain from this provider, such as
-         * at points and in rectangles.  This function should not be called before
-         * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.  This property may be undefined if availability
-         * information is not available.
-         * @memberof GoogleEarthEnterpriseTerrainProvider.prototype
-         * @type {TileAvailability}
-         */
-        availability : {
-            get : function() {
-                return undefined;
-            }
-        }
-    });
-
-    var taskProcessor = new TaskProcessor('decodeGoogleEarthEnterprisePacket', Number.POSITIVE_INFINITY);
-
-    // If the tile has its own terrain, then you can just use its child bitmask. If it was requested using it's parent
-    //  then you need to check all of its children to see if they have terrain.
-    function computeChildMask(quadKey, info, metadata) {
-        var childMask = info.getChildBitmask();
-        if (info.terrainState === TerrainState.PARENT) {
-            childMask = 0;
-            for (var i = 0; i < 4; ++i) {
-                var child = metadata.getTileInformationFromQuadKey(quadKey + i.toString());
-                if (defined(child) && child.hasTerrain()) {
-                    childMask |= (1 << i);
-                }
-            }
-        }
-
-        return childMask;
-    }
-
-    /**
-     * Requests the geometry for a given tile.  This function should not be called before
-     * {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.  The result must include terrain data and
-     * may optionally include a water mask and an indication of which child tiles are available.
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @param {Request} [request] The request object. Intended for internal use only.
-     * @returns {Promise.<TerrainData>|undefined} A promise for the requested geometry.  If this method
-     *          returns undefined instead of a promise, it is an indication that too many requests are already
-     *          pending and the request will be retried later.
-     *
-     * @exception {DeveloperError} This function must not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready}
-     *            returns true.
-     */
-    GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function(x, y, level, request) {
-        //>>includeStart('debug', pragmas.debug)
-        if (!this._ready) {
-            throw new DeveloperError('requestTileGeometry must not be called before the terrain provider is ready.');
-        }
-        //>>includeEnd('debug');
-
-        var quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);
-        var terrainCache = this._terrainCache;
-        var metadata = this._metadata;
-        var info = metadata.getTileInformationFromQuadKey(quadKey);
-
-        // Check if this tile is even possibly available
-        if (!defined(info)) {
-            return when.reject(new RuntimeError('Terrain tile doesn\'t exist'));
-        }
-
-        var terrainState = info.terrainState;
-        if (!defined(terrainState)) {
-            // First time we have tried to load this tile, so set terrain state to UNKNOWN
-            terrainState = info.terrainState = TerrainState.UNKNOWN;
-        }
-
-        // If its in the cache, return it
-        var buffer = terrainCache.get(quadKey);
-        if (defined(buffer)) {
-            var credit = metadata.providers[info.terrainProvider];
-            return when.resolve(new GoogleEarthEnterpriseTerrainData({
-                buffer : buffer,
-                childTileMask : computeChildMask(quadKey, info, metadata),
-                credits : defined(credit) ? [credit] : undefined,
-                negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias,
-                negativeElevationThreshold: metadata.negativeAltitudeThreshold
-            }));
-        }
-
-        // Clean up the cache
-        terrainCache.tidy();
-
-        // We have a tile, check to see if no ancestors have terrain or that we know for sure it doesn't
-        if (!info.ancestorHasTerrain) {
-            // We haven't reached a level with terrain, so return the ellipsoid
-            return when.resolve(new HeightmapTerrainData({
-                buffer : new Uint8Array(16 * 16),
-                width : 16,
-                height : 16
-            }));
-        } else if (terrainState === TerrainState.NONE) {
-            // Already have info and there isn't any terrain here
-            return when.reject(new RuntimeError('Terrain tile doesn\'t exist'));
-        }
-
-        // Figure out where we are getting the terrain and what version
-        var parentInfo;
-        var q = quadKey;
-        var terrainVersion = -1;
-        switch (terrainState) {
-            case TerrainState.SELF: // We have terrain and have retrieved it before
-                terrainVersion = info.terrainVersion;
-                break;
-            case TerrainState.PARENT: // We have terrain in our parent
-                q = q.substring(0, q.length - 1);
-                parentInfo = metadata.getTileInformationFromQuadKey(q);
-                terrainVersion = parentInfo.terrainVersion;
-                break;
-            case TerrainState.UNKNOWN: // We haven't tried to retrieve terrain yet
-                if (info.hasTerrain()) {
-                    terrainVersion = info.terrainVersion; // We should have terrain
-                } else {
-                    q = q.substring(0, q.length - 1);
-                    parentInfo = metadata.getTileInformationFromQuadKey(q);
-                    if (defined(parentInfo) && parentInfo.hasTerrain()) {
-                        terrainVersion = parentInfo.terrainVersion; // Try checking in the parent
-                    }
-                }
-                break;
-        }
-
-        // We can't figure out where to get the terrain
-        if (terrainVersion < 0) {
-            return when.reject(new RuntimeError('Terrain tile doesn\'t exist'));
-        }
-
-        // Load that terrain
-        var terrainPromises = this._terrainPromises;
-        var terrainRequests = this._terrainRequests;
-        var sharedPromise;
-        var sharedRequest;
-        if (defined(terrainPromises[q])) { // Already being loaded possibly from another child, so return existing promise
-            sharedPromise = terrainPromises[q];
-            sharedRequest = terrainRequests[q];
-        } else { // Create new request for terrain
-            sharedRequest = request;
-            var requestPromise = buildTerrainResource(this, q, terrainVersion, sharedRequest).fetchArrayBuffer();
-
-            if (!defined(requestPromise)) {
-                return undefined; // Throttled
-            }
-
-            sharedPromise = requestPromise
-                .then(function(terrain) {
-                    if (defined(terrain)) {
-                        return taskProcessor.scheduleTask({
-                            buffer : terrain,
-                            type : 'Terrain',
-                            key : metadata.key
-                        }, [terrain])
-                            .then(function(terrainTiles) {
-                                // Add requested tile and mark it as SELF
-                                var requestedInfo = metadata.getTileInformationFromQuadKey(q);
-                                requestedInfo.terrainState = TerrainState.SELF;
-                                terrainCache.add(q, terrainTiles[0]);
-                                var provider = requestedInfo.terrainProvider;
-
-                                // Add children to cache
-                                var count = terrainTiles.length - 1;
-                                for (var j = 0; j < count; ++j) {
-                                    var childKey = q + j.toString();
-                                    var child = metadata.getTileInformationFromQuadKey(childKey);
-                                    if (defined(child)) {
-                                        terrainCache.add(childKey, terrainTiles[j + 1]);
-                                        child.terrainState = TerrainState.PARENT;
-                                        if (child.terrainProvider === 0) {
-                                            child.terrainProvider = provider;
-                                        }
-                                    }
-                                }
-                            });
-                    }
-
-                    return when.reject(new RuntimeError('Failed to load terrain.'));
-                });
-
-            terrainPromises[q] = sharedPromise; // Store promise without delete from terrainPromises
-            terrainRequests[q] = sharedRequest;
-
-            // Set promise so we remove from terrainPromises just one time
-            sharedPromise = sharedPromise
-                .always(function() {
-                    delete terrainPromises[q];
-                    delete terrainRequests[q];
-                });
-        }
-
-        return sharedPromise
-            .then(function() {
-                var buffer = terrainCache.get(quadKey);
-                if (defined(buffer)) {
-                    var credit = metadata.providers[info.terrainProvider];
-                    return new GoogleEarthEnterpriseTerrainData({
-                        buffer : buffer,
-                        childTileMask : computeChildMask(quadKey, info, metadata),
-                        credits : defined(credit) ? [credit] : undefined,
-                        negativeAltitudeExponentBias: metadata.negativeAltitudeExponentBias,
-                        negativeElevationThreshold: metadata.negativeAltitudeThreshold
-                    });
-                }
-
-                return when.reject(new RuntimeError('Failed to load terrain.'));
-            })
-            .otherwise(function(error) {
-                if (sharedRequest.state === RequestState.CANCELLED) {
-                    request.state = sharedRequest.state;
-                    return when.reject(error);
-                }
-                info.terrainState = TerrainState.NONE;
-                return when.reject(error);
-            });
-    };
-
-    /**
-     * Gets the maximum geometric error allowed in a tile at a given level.
-     *
-     * @param {Number} level The tile level for which to get the maximum geometric error.
-     * @returns {Number} The maximum geometric error.
-     */
-    GoogleEarthEnterpriseTerrainProvider.prototype.getLevelMaximumGeometricError = function(level) {
-        return this._levelZeroMaximumGeometricError / (1 << level);
-    };
-
-    /**
-     * Determines whether data for a tile is available to be loaded.
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @returns {Boolean} Undefined if not supported, otherwise true or false.
-     */
-    GoogleEarthEnterpriseTerrainProvider.prototype.getTileDataAvailable = function(x, y, level) {
-        var metadata = this._metadata;
-        var quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);
-
-        var info = metadata.getTileInformation(x, y, level);
-        if (info === null) {
-            return false;
-        }
-
-        if (defined(info)) {
-            if (!info.ancestorHasTerrain) {
-                return true; // We'll just return the ellipsoid
-            }
-
-            var terrainState = info.terrainState;
-            if (terrainState === TerrainState.NONE) {
-                return false; // Terrain is not available
-            }
-
-            if (!defined(terrainState) || (terrainState === TerrainState.UNKNOWN)) {
-                info.terrainState = TerrainState.UNKNOWN;
-                if (!info.hasTerrain()) {
-                    quadKey = quadKey.substring(0, quadKey.length - 1);
-                    var parentInfo = metadata.getTileInformationFromQuadKey(quadKey);
-                    if (!defined(parentInfo) || !parentInfo.hasTerrain()) {
-                        return false;
-                    }
-                }
-            }
-
-            return true;
-        }
-
-        if (metadata.isValid(quadKey)) {
-            // We will need this tile, so request metadata and return false for now
-            var request = new Request({
-                throttle : true,
-                throttleByServer : true,
-                type : RequestType.TERRAIN
-            });
-            metadata.populateSubtree(x, y, level, request);
-        }
-        return false;
-    };
-
-    /**
-     * Makes sure we load availability data for a tile
-     *
-     * @param {Number} x The X coordinate of the tile for which to request geometry.
-     * @param {Number} y The Y coordinate of the tile for which to request geometry.
-     * @param {Number} level The level of the tile for which to request geometry.
-     * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
-     */
-    GoogleEarthEnterpriseTerrainProvider.prototype.loadTileDataAvailability = function(x, y, level) {
-        return undefined;
-    };
-
-    //
-    // Functions to handle imagery packets
-    //
-    function buildTerrainResource(terrainProvider, quadKey, version, request) {
-        version = (defined(version) && version > 0) ? version : 1;
-        return terrainProvider._metadata.resource.getDerivedResource({
-            url: 'flatfile?f1c-0' + quadKey + '-t.' + version.toString(),
-            request: request
-        });
-    }
-export default GoogleEarthEnterpriseTerrainProvider;

+ 0 - 123
Source/Core/GoogleEarthEnterpriseTileInformation.js

@@ -1,123 +0,0 @@
-import defined from './defined.js';
-import isBitSet from './isBitSet.js';
-
-    // Bitmask for checking tile properties
-    var childrenBitmasks = [0x01, 0x02, 0x04, 0x08];
-    var anyChildBitmask = 0x0F;
-    var cacheFlagBitmask = 0x10; // True if there is a child subtree
-    var imageBitmask = 0x40;
-    var terrainBitmask = 0x80;
-
-    /**
-     * Contains information about each tile from a Google Earth Enterprise server
-     *
-     * @param {Number} bits Bitmask that contains the type of data and available children for each tile.
-     * @param {Number} cnodeVersion Version of the request for subtree metadata.
-     * @param {Number} imageryVersion Version of the request for imagery tile.
-     * @param {Number} terrainVersion Version of the request for terrain tile.
-     * @param {Number} imageryProvider Id of imagery provider.
-     * @param {Number} terrainProvider Id of terrain provider.
-     *
-     * @private
-     */
-    function GoogleEarthEnterpriseTileInformation(bits, cnodeVersion, imageryVersion, terrainVersion, imageryProvider, terrainProvider) {
-        this._bits = bits;
-        this.cnodeVersion = cnodeVersion;
-        this.imageryVersion = imageryVersion;
-        this.terrainVersion = terrainVersion;
-        this.imageryProvider = imageryProvider;
-        this.terrainProvider = terrainProvider;
-        this.ancestorHasTerrain = false; // Set it later once we find its parent
-        this.terrainState = undefined;
-    }
-
-    /**
-     * Creates GoogleEarthEnterpriseTileInformation from an object
-     *
-     * @param {Object} info Object to be cloned
-     * @param {GoogleEarthEnterpriseTileInformation} [result] The object onto which to store the result.
-     * @returns {GoogleEarthEnterpriseTileInformation} The modified result parameter or a new GoogleEarthEnterpriseTileInformation instance if none was provided.
-     */
-    GoogleEarthEnterpriseTileInformation.clone = function(info, result) {
-        if (!defined(result)) {
-            result = new GoogleEarthEnterpriseTileInformation(info._bits, info.cnodeVersion, info.imageryVersion, info.terrainVersion,
-                info.imageryProvider, info.terrainProvider);
-        } else {
-            result._bits = info._bits;
-            result.cnodeVersion = info.cnodeVersion;
-            result.imageryVersion = info.imageryVersion;
-            result.terrainVersion = info.terrainVersion;
-            result.imageryProvider = info.imageryProvider;
-            result.terrainProvider = info.terrainProvider;
-        }
-        result.ancestorHasTerrain = info.ancestorHasTerrain;
-        result.terrainState = info.terrainState;
-
-        return result;
-    };
-
-    /**
-     * Sets the parent for the tile
-     *
-     * @param {GoogleEarthEnterpriseTileInformation} parent Parent tile
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.setParent = function(parent) {
-        this.ancestorHasTerrain = parent.ancestorHasTerrain || this.hasTerrain();
-    };
-
-    /**
-     * Gets whether a subtree is available
-     *
-     * @returns {Boolean} true if subtree is available, false otherwise.
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.hasSubtree = function() {
-        return isBitSet(this._bits, cacheFlagBitmask);
-    };
-
-    /**
-     * Gets whether imagery is available
-     *
-     * @returns {Boolean} true if imagery is available, false otherwise.
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.hasImagery = function() {
-        return isBitSet(this._bits, imageBitmask);
-    };
-
-    /**
-     * Gets whether terrain is available
-     *
-     * @returns {Boolean} true if terrain is available, false otherwise.
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.hasTerrain = function() {
-        return isBitSet(this._bits, terrainBitmask);
-    };
-
-    /**
-     * Gets whether any children are present
-     *
-     * @returns {Boolean} true if any children are available, false otherwise.
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.hasChildren = function() {
-        return isBitSet(this._bits, anyChildBitmask);
-    };
-
-    /**
-     * Gets whether a specified child is available
-     *
-     * @param {Number} index Index of child tile
-     *
-     * @returns {Boolean} true if child is available, false otherwise
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.hasChild = function(index) {
-        return isBitSet(this._bits, childrenBitmasks[index]);
-    };
-
-    /**
-     * Gets bitmask containing children
-     *
-     * @returns {Number} Children bitmask
-     */
-    GoogleEarthEnterpriseTileInformation.prototype.getChildBitmask = function() {
-        return this._bits & anyChildBitmask;
-    };
-export default GoogleEarthEnterpriseTileInformation;

+ 0 - 52
Source/Core/GregorianDate.js

@@ -1,52 +0,0 @@
-
-    /**
-     * Represents a Gregorian date in a more precise format than the JavaScript Date object.
-     * In addition to submillisecond precision, this object can also represent leap seconds.
-     * @alias GregorianDate
-     * @constructor
-     *
-     * @see JulianDate#toGregorianDate
-     */
-    function GregorianDate(year, month, day, hour, minute, second, millisecond, isLeapSecond) {
-        /**
-         * Gets or sets the year as a whole number.
-         * @type {Number}
-         */
-        this.year = year;
-        /**
-         * Gets or sets the month as a whole number with range [1, 12].
-         * @type {Number}
-         */
-        this.month = month;
-        /**
-         * Gets or sets the day of the month as a whole number starting at 1.
-         * @type {Number}
-         */
-        this.day = day;
-        /**
-         * Gets or sets the hour as a whole number with range [0, 23].
-         * @type {Number}
-         */
-        this.hour = hour;
-        /**
-         * Gets or sets the minute of the hour as a whole number with range [0, 59].
-         * @type {Number}
-         */
-        this.minute = minute;
-        /**
-         * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
-         * @type {Number}
-         */
-        this.second = second;
-        /**
-         * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
-         * @type {Number}
-         */
-        this.millisecond = millisecond;
-        /**
-         * Gets or sets whether this time is during a leap second.
-         * @type {Boolean}
-         */
-        this.isLeapSecond = isLeapSecond;
-    }
-export default GregorianDate;

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 1149
Source/Core/GroundPolylineGeometry.js


+ 0 - 57
Source/Core/HeadingPitchRange.js

@@ -1,57 +0,0 @@
-import defaultValue from './defaultValue.js';
-import defined from './defined.js';
-
-    /**
-     * Defines a heading angle, pitch angle, and range in a local frame.
-     * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
-     * Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
-     * angles are below the plane. Range is the distance from the center of the frame.
-     * @alias HeadingPitchRange
-     * @constructor
-     *
-     * @param {Number} [heading=0.0] The heading angle in radians.
-     * @param {Number} [pitch=0.0] The pitch angle in radians.
-     * @param {Number} [range=0.0] The distance from the center in meters.
-     */
-    function HeadingPitchRange(heading, pitch, range) {
-        /**
-         * Heading is the rotation from the local north direction where a positive angle is increasing eastward.
-         * @type {Number}
-         */
-        this.heading = defaultValue(heading, 0.0);
-
-        /**
-         * Pitch is the rotation from the local xy-plane. Positive pitch angles
-         * are above the plane. Negative pitch angles are below the plane.
-         * @type {Number}
-         */
-        this.pitch = defaultValue(pitch, 0.0);
-
-        /**
-         * Range is the distance from the center of the local frame.
-         * @type {Number}
-         */
-        this.range = defaultValue(range, 0.0);
-    }
-
-    /**
-     * Duplicates a HeadingPitchRange instance.
-     *
-     * @param {HeadingPitchRange} hpr The HeadingPitchRange to duplicate.
-     * @param {HeadingPitchRange} [result] The object onto which to store the result.
-     * @returns {HeadingPitchRange} The modified result parameter or a new HeadingPitchRange instance if one was not provided. (Returns undefined if hpr is undefined)
-     */
-    HeadingPitchRange.clone = function(hpr, result) {
-        if (!defined(hpr)) {
-            return undefined;
-        }
-        if (!defined(result)) {
-            result = new HeadingPitchRange();
-        }
-
-        result.heading = hpr.heading;
-        result.pitch = hpr.pitch;
-        result.range = hpr.range;
-        return result;
-    };
-export default HeadingPitchRange;

+ 0 - 0
Source/Core/HeadingPitchRoll.js


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است