From 9daba86f5a2848ab71e5a550d51929fa3ea4fbf9 Mon Sep 17 00:00:00 2001 From: Rikku Date: Fri, 19 Oct 2018 17:32:51 +0300 Subject: [PATCH] #6674 rename ApproximateTerrainHeights functions --- Source/Core/ApproximateTerrainHeights.js | 4 ++-- Source/Core/GroundPolylineGeometry.js | 2 +- Source/DataSources/CorridorGeometryUpdater.js | 4 ++-- Source/DataSources/EllipseGeometryUpdater.js | 4 ++-- Source/DataSources/PolygonGeometryUpdater.js | 4 ++-- .../DataSources/RectangleGeometryUpdater.js | 4 ++-- Source/Scene/GroundPrimitive.js | 4 ++-- Specs/Core/ApproximateTerrainHeightsSpec.js | 24 +++++++++---------- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Source/Core/ApproximateTerrainHeights.js b/Source/Core/ApproximateTerrainHeights.js index 0072ae79e55c..7ecd5b9bd93f 100644 --- a/Source/Core/ApproximateTerrainHeights.js +++ b/Source/Core/ApproximateTerrainHeights.js @@ -72,7 +72,7 @@ define([ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid * @return {{minimumTerrainHeight: Number, maximumTerrainHeight: Number}} */ - ApproximateTerrainHeights.getApproximateTerrainHeights = function(rectangle, ellipsoid) { + ApproximateTerrainHeights.getMinimumMaximumHeights = function(rectangle, ellipsoid) { //>>includeStart('debug', pragmas.debug); Check.defined('rectangle', rectangle); if (!defined(ApproximateTerrainHeights._terrainHeights)) { @@ -124,7 +124,7 @@ define([ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid * @return {BoundingSphere} The result bounding sphere */ - ApproximateTerrainHeights.getInstanceBoundingSphere = function(rectangle, ellipsoid) { + ApproximateTerrainHeights.getBoundingSphere = function(rectangle, ellipsoid) { //>>includeStart('debug', pragmas.debug); Check.defined('rectangle', rectangle); if (!defined(ApproximateTerrainHeights._terrainHeights)) { diff --git a/Source/Core/GroundPolylineGeometry.js b/Source/Core/GroundPolylineGeometry.js index 1c03744df648..42580fcd316f 100644 --- a/Source/Core/GroundPolylineGeometry.js +++ b/Source/Core/GroundPolylineGeometry.js @@ -994,7 +994,7 @@ define([ var adjustHeightEndTop = adjustHeightEndTopScratch; var getHeightsRectangle = Rectangle.fromCartographicArray(getHeightCartographics, getHeightRectangleScratch); - var minMaxHeights = ApproximateTerrainHeights.getApproximateTerrainHeights(getHeightsRectangle, ellipsoid); + var minMaxHeights = ApproximateTerrainHeights.getMinimumMaximumHeights(getHeightsRectangle, ellipsoid); var minHeight = minMaxHeights.minimumTerrainHeight; var maxHeight = minMaxHeights.maximumTerrainHeight; diff --git a/Source/DataSources/CorridorGeometryUpdater.js b/Source/DataSources/CorridorGeometryUpdater.js index 69a6a65ac7f3..5f6c35f33c4d 100644 --- a/Source/DataSources/CorridorGeometryUpdater.js +++ b/Source/DataSources/CorridorGeometryUpdater.js @@ -235,7 +235,7 @@ define([ var extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, Iso8601.MINIMUM_VALUE); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(CorridorGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(CorridorGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; @@ -276,7 +276,7 @@ define([ var extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, time); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(CorridorGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(CorridorGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; diff --git a/Source/DataSources/EllipseGeometryUpdater.js b/Source/DataSources/EllipseGeometryUpdater.js index 30fe5088f920..3044cb041dec 100644 --- a/Source/DataSources/EllipseGeometryUpdater.js +++ b/Source/DataSources/EllipseGeometryUpdater.js @@ -242,7 +242,7 @@ define([ var extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, Iso8601.MINIMUM_VALUE); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(EllipseGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(EllipseGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; @@ -286,7 +286,7 @@ define([ var extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, time); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(EllipseGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(EllipseGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; diff --git a/Source/DataSources/PolygonGeometryUpdater.js b/Source/DataSources/PolygonGeometryUpdater.js index fc2e20fbf371..0b6b5d6214ed 100644 --- a/Source/DataSources/PolygonGeometryUpdater.js +++ b/Source/DataSources/PolygonGeometryUpdater.js @@ -308,7 +308,7 @@ define([ extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, Iso8601.MINIMUM_VALUE); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(PolygonGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(PolygonGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; @@ -371,7 +371,7 @@ define([ extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, time); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(PolygonGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(PolygonGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; diff --git a/Source/DataSources/RectangleGeometryUpdater.js b/Source/DataSources/RectangleGeometryUpdater.js index 9206ba1eb4df..e69efd87fa3f 100644 --- a/Source/DataSources/RectangleGeometryUpdater.js +++ b/Source/DataSources/RectangleGeometryUpdater.js @@ -237,7 +237,7 @@ define([ var extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, Iso8601.MINIMUM_VALUE); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(RectangleGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(RectangleGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; @@ -283,7 +283,7 @@ define([ var extrudedHeightValue = GroundGeometryUpdater.getGeometryExtrudedHeight(extrudedHeight, extrudedHeightReference, time); if (extrudedHeightValue === GroundGeometryUpdater.CLAMP_TO_GROUND) { - extrudedHeightValue = ApproximateTerrainHeights.getApproximateTerrainHeights(RectangleGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; + extrudedHeightValue = ApproximateTerrainHeights.getMinimumMaximumHeights(RectangleGeometry.computeRectangle(options, scratchRectangle)).minimumTerrainHeight; } options.extrudedHeight = extrudedHeightValue; diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js index 2df59183af5a..e6ff8c4a348e 100644 --- a/Source/Scene/GroundPrimitive.js +++ b/Source/Scene/GroundPrimitive.js @@ -481,7 +481,7 @@ define([ } function setMinMaxTerrainHeights(primitive, rectangle, ellipsoid) { - var result = ApproximateTerrainHeights.getApproximateTerrainHeights(rectangle, ellipsoid); + var result = ApproximateTerrainHeights.getMinimumMaximumHeights(rectangle, ellipsoid); primitive._minTerrainHeight = result.minimumTerrainHeight; primitive._maxTerrainHeight = result.maximumTerrainHeight; @@ -687,7 +687,7 @@ define([ var id = instance.id; if (defined(id) && defined(instanceRectangle)) { - var boundingSphere = ApproximateTerrainHeights.getInstanceBoundingSphere(instanceRectangle, ellipsoid); + var boundingSphere = ApproximateTerrainHeights.getBoundingSphere(instanceRectangle, ellipsoid); this._boundingSpheresKeys.push(id); this._boundingSpheres.push(boundingSphere); } diff --git a/Specs/Core/ApproximateTerrainHeightsSpec.js b/Specs/Core/ApproximateTerrainHeightsSpec.js index df85d432a348..c716284c6483 100644 --- a/Specs/Core/ApproximateTerrainHeightsSpec.js +++ b/Specs/Core/ApproximateTerrainHeightsSpec.js @@ -26,44 +26,44 @@ defineSuite([ }); }); - it('getApproximateTerrainHeights computes minimum and maximum terrain heights', function() { - var result = ApproximateTerrainHeights.getApproximateTerrainHeights(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); + it('getMinimumMaximumHeights computes minimum and maximum terrain heights', function() { + var result = ApproximateTerrainHeights.getMinimumMaximumHeights(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); expect(result.minimumTerrainHeight).toEqualEpsilon(-476.125711887558, CesiumMath.EPSILON10); expect(result.maximumTerrainHeight).toEqualEpsilon(-28.53441619873047, CesiumMath.EPSILON10); }); - it('getApproximateTerrainHeights throws with no rectangle', function() { + it('getMinimumMaximumHeights throws with no rectangle', function() { expect(function() { - return ApproximateTerrainHeights.getApproximateTerrainHeights(); + return ApproximateTerrainHeights.getMinimumMaximumHeights(); }).toThrowDeveloperError(); }); - it('getApproximateTerrainHeights throws if ApproximateTerrainHeights was not initialized first', function() { + it('getMinimumMaximumHeights throws if ApproximateTerrainHeights was not initialized first', function() { var heights = ApproximateTerrainHeights._terrainHeights; ApproximateTerrainHeights._terrainHeights = undefined; expect(function() { - return ApproximateTerrainHeights.getApproximateTerrainHeights(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); + return ApproximateTerrainHeights.getMinimumMaximumHeights(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); }); ApproximateTerrainHeights._terrainHeights = heights; }); - it('getInstanceBoundingSphere computes a bounding sphere', function() { - var result = ApproximateTerrainHeights.getInstanceBoundingSphere(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); + it('getBoundingSphere computes a bounding sphere', function() { + var result = ApproximateTerrainHeights.getBoundingSphere(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); expect(result.center).toEqualEpsilon(new Cartesian3(-3183013.8480289434, -5403772.557261968, 1154581.5817616477), CesiumMath.EPSILON10); expect(result.radius).toEqualEpsilon(77884.16539096291, CesiumMath.EPSILON10); }); - it('getInstanceBoundingSphere throws with no rectangle', function() { + it('getBoundingSphere throws with no rectangle', function() { expect(function() { - return ApproximateTerrainHeights.getInstanceBoundingSphere(); + return ApproximateTerrainHeights.getBoundingSphere(); }).toThrowDeveloperError(); }); - it('getInstanceBoundingSphere throws if ApproximateTerrainHeights was not initialized first', function() { + it('getBoundingSphere throws if ApproximateTerrainHeights was not initialized first', function() { var heights = ApproximateTerrainHeights._terrainHeights; ApproximateTerrainHeights._terrainHeights = undefined; expect(function() { - return ApproximateTerrainHeights.getInstanceBoundingSphere(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); + return ApproximateTerrainHeights.getBoundingSphere(Rectangle.fromDegrees(-121.0, 10.0, -120.0, 11.0)); }); ApproximateTerrainHeights._terrainHeights = heights; });