From 9b58ea4577731a56ffdba31dd41f5b8a4c61533e Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Tue, 19 Feb 2019 14:09:50 -0500 Subject: [PATCH 1/7] Change usage of followSurface to arcType. Add CZML property for it --- Apps/SampleData/simple.czml | 6 +++--- Apps/Sandcastle/gallery/CZML Polyline.html | 2 +- Apps/Sandcastle/gallery/Clamp to Terrain.html | 2 +- Apps/Sandcastle/gallery/Custom DataSource.html | 2 +- .../gallery/Sample Height from 3D Tiles.html | 2 +- Apps/Sandcastle/gallery/Star Burst.html | 2 +- .../gallery/development/Pick From Ray.html | 2 +- Apps/Sandcastle/gallery/development/Polyline.html | 4 ++-- .../gallery/development/Simple Polyline.html | 4 ++-- Source/Core/PolylineGeometry.js | 2 +- Source/Core/SimplePolylineGeometry.js | 2 +- Source/DataSources/CzmlDataSource.js | 7 +++++++ Source/DataSources/KmlDataSource.js | 4 +++- Specs/Core/SimplePolylineGeometrySpec.js | 10 +++++----- Specs/Data/CZML/ValidationDocument.czml | 5 ++++- Specs/DataSources/CzmlDataSourceSpec.js | 6 ++++-- Specs/DataSources/KmlDataSourceSpec.js | 12 +++++++----- Specs/Scene/GeometryRenderingSpec.js | 6 ++++-- Specs/Scene/PolylineColorAppearanceSpec.js | 3 ++- Specs/Scene/PolylineMaterialAppearanceSpec.js | 4 +++- 20 files changed, 54 insertions(+), 33 deletions(-) diff --git a/Apps/SampleData/simple.czml b/Apps/SampleData/simple.czml index 39098a311c5f..073be16a5790 100644 --- a/Apps/SampleData/simple.czml +++ b/Apps/SampleData/simple.czml @@ -122,7 +122,7 @@ } } }, - "followSurface":false, + "arcType":"NONE", "positions":{ "references":[ "Satellite/Geoeye1#position","Satellite/ISS#position" @@ -207,7 +207,7 @@ } } }, - "followSurface":false, + "arcType":"NONE", "positions":{ "references":[ "Facility/AGI#position","Satellite/ISS#position" @@ -232,7 +232,7 @@ } } }, - "followSurface":false, + "arcType":"NONE", "positions":{ "references":[ "Facility/AGI#position","Satellite/Geoeye1/Sensor/Sensor#position" diff --git a/Apps/Sandcastle/gallery/CZML Polyline.html b/Apps/Sandcastle/gallery/CZML Polyline.html index a506213fb7e2..8629392cf01b 100644 --- a/Apps/Sandcastle/gallery/CZML Polyline.html +++ b/Apps/Sandcastle/gallery/CZML Polyline.html @@ -112,7 +112,7 @@ } } }, - "followSurface" : false, + "arcType" : "NONE", "width" : 10 } }, { diff --git a/Apps/Sandcastle/gallery/Clamp to Terrain.html b/Apps/Sandcastle/gallery/Clamp to Terrain.html index fc695c504c9e..0f139299f16a 100644 --- a/Apps/Sandcastle/gallery/Clamp to Terrain.html +++ b/Apps/Sandcastle/gallery/Clamp to Terrain.html @@ -197,7 +197,7 @@ viewer.entities.add({ polyline : { positions : Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(samples), - followSurface : false, + arcType : Cesium.ArcType.NONE, width : 5, material : new Cesium.PolylineOutlineMaterialProperty({ color : Cesium.Color.ORANGE, diff --git a/Apps/Sandcastle/gallery/Custom DataSource.html b/Apps/Sandcastle/gallery/Custom DataSource.html index 9b4c51e8e511..a16afafce250 100644 --- a/Apps/Sandcastle/gallery/Custom DataSource.html +++ b/Apps/Sandcastle/gallery/Custom DataSource.html @@ -319,7 +319,7 @@ var polyline = new Cesium.PolylineGraphics(); polyline.material = new Cesium.ColorMaterialProperty(color); polyline.width = new Cesium.ConstantProperty(2); - polyline.followSurface = new Cesium.ConstantProperty(false); + polyline.arcType = new Cesium.ConstantProperty(Cesium.ArcType.NONE); polyline.positions = new Cesium.ConstantProperty([surfacePosition, heightPosition]); //The polyline instance itself needs to be on an entity. diff --git a/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html b/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html index c8ee45d89b89..ec22b0873b7f 100644 --- a/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html +++ b/Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html @@ -81,7 +81,7 @@ viewer.entities.add({ polyline : { positions : clampedCartesians, - followSurface : false, + arcType : Cesium.ArcType.NONE, width : 2, material : new Cesium.PolylineOutlineMaterialProperty({ color : Cesium.Color.YELLOW diff --git a/Apps/Sandcastle/gallery/Star Burst.html b/Apps/Sandcastle/gallery/Star Burst.html index 9f43819f437b..2677e03355cb 100644 --- a/Apps/Sandcastle/gallery/Star Burst.html +++ b/Apps/Sandcastle/gallery/Star Burst.html @@ -208,7 +208,7 @@ instances.push(new Cesium.GeometryInstance({ geometry : new Cesium.SimplePolylineGeometry({ positions : [starBurstState.center, lines[i]], - followSurface : false, + arcType : Cesium.ArcType.NONE, granularity : Cesium.Math.PI_OVER_FOUR }), attributes : { diff --git a/Apps/Sandcastle/gallery/development/Pick From Ray.html b/Apps/Sandcastle/gallery/development/Pick From Ray.html index 648daf4f343e..c89536a3ad19 100644 --- a/Apps/Sandcastle/gallery/development/Pick From Ray.html +++ b/Apps/Sandcastle/gallery/development/Pick From Ray.html @@ -85,7 +85,7 @@ polyline : { positions : arrowPositions, width : 10, - followSurface : false, + arcType : Cesium.ArcType.NONE, material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.YELLOW) } }); diff --git a/Apps/Sandcastle/gallery/development/Polyline.html b/Apps/Sandcastle/gallery/development/Polyline.html index e6f13782a0d0..690b0eb74a92 100644 --- a/Apps/Sandcastle/gallery/development/Polyline.html +++ b/Apps/Sandcastle/gallery/development/Polyline.html @@ -52,7 +52,7 @@ // Example 2: Draw a straight blue polyline -// Setting the followSurface option to false will allow +// Setting the arcType option to false will allow // you to draw a straight polyline. Otherwise, it will // curve to the globe surface. scene.primitives.add(new Cesium.Primitive({ @@ -64,7 +64,7 @@ ]), width : 5.0, vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT, - followSurface: false + arcType: Cesium.ArcType.NONE }), attributes: { color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE) diff --git a/Apps/Sandcastle/gallery/development/Simple Polyline.html b/Apps/Sandcastle/gallery/development/Simple Polyline.html index b37588a1061e..61324bc37d68 100644 --- a/Apps/Sandcastle/gallery/development/Simple Polyline.html +++ b/Apps/Sandcastle/gallery/development/Simple Polyline.html @@ -53,13 +53,13 @@ } // For per segment coloring, provide the colors options with an // array of colors where the length is equal to the number of positions. -// Setting followSurface to false will draw straight lines. +// Setting arcType to false will draw straight lines. // Otherwise, the polyline curves to the surface of the globe. var perSegmentPolyline = new Cesium.GeometryInstance({ geometry : new Cesium.SimplePolylineGeometry({ positions : positions, colors : colors, - followSurface: false + arcType: Cesium.ArcType.NONE }) }); diff --git a/Source/Core/PolylineGeometry.js b/Source/Core/PolylineGeometry.js index a4232b8833e4..1439124713f7 100644 --- a/Source/Core/PolylineGeometry.js +++ b/Source/Core/PolylineGeometry.js @@ -143,7 +143,7 @@ define([ this._followSurface = defaultValue(options.followSurface, true); if (defined(options.followSurface)) { - deprecationWarning('PolylineGeometry.followSurface', 'PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.55. Use PolylineGeometry.arcType instead.'); + deprecationWarning('PolylineGeometry.followSurface', 'PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.57. Use PolylineGeometry.arcType instead.'); options.arcType = options.followSurface ? ArcType.GEODESIC : ArcType.NONE; } this._arcType = defaultValue(options.arcType, ArcType.GEODESIC); diff --git a/Source/Core/SimplePolylineGeometry.js b/Source/Core/SimplePolylineGeometry.js index 65187d9d6c6c..7168c3b6b8ba 100644 --- a/Source/Core/SimplePolylineGeometry.js +++ b/Source/Core/SimplePolylineGeometry.js @@ -128,7 +128,7 @@ define([ this._followSurface = defaultValue(options.followSurface, true); if (defined(options.followSurface)) { - deprecationWarning('PolylineGeometry.followSurface', 'PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.55. Use PolylineGeometry.arcType instead.'); + deprecationWarning('PolylineGeometry.followSurface', 'PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.57. Use PolylineGeometry.arcType instead.'); options.arcType = options.followSurface ? ArcType.GEODESIC : ArcType.NONE; } this._arcType = defaultValue(options.arcType, ArcType.GEODESIC); diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js index ba3597cad1c6..96eba71a80c2 100644 --- a/Source/DataSources/CzmlDataSource.js +++ b/Source/DataSources/CzmlDataSource.js @@ -1,4 +1,5 @@ define([ + '../Core/ArcType', '../Core/BoundingRectangle', '../Core/Cartesian2', '../Core/Cartesian3', @@ -86,6 +87,7 @@ define([ './VelocityVectorProperty', './WallGraphics' ], function( + ArcType, BoundingRectangle, Cartesian2, Cartesian3, @@ -501,6 +503,8 @@ define([ } else if (czmlInterval.hasOwnProperty('rgba') || czmlInterval.hasOwnProperty('rgbaf')) { return Color; + } else if (czmlInterval.hasOwnProperty('arcType')) { + return ArcType; } else if (czmlInterval.hasOwnProperty('colorBlendMode')) { return ColorBlendMode; } else if (czmlInterval.hasOwnProperty('cornerType')) { @@ -546,6 +550,8 @@ define([ // The associations in this function need to be kept in sync with the // associations in getPropertyType switch (type) { + case ArcType: + return ArcType[defaultValue(czmlInterval.arcType, czmlInterval)]; case Array: return czmlInterval.array; case Boolean: @@ -1795,6 +1801,7 @@ define([ processMaterialPacketData(polyline, 'material', polylineData.material, interval, sourceUri, entityCollection); processMaterialPacketData(polyline, 'depthFailMaterial', polylineData.depthFailMaterial, interval, sourceUri, entityCollection); processPacketData(Boolean, polyline, 'followSurface', polylineData.followSurface, interval, sourceUri, entityCollection); + processPacketData(ArcType, polyline, 'arcType', polylineData.arcType, interval, sourceUri, entityCollection); processPacketData(Boolean, polyline, 'clampToGround', polylineData.clampToGround, interval, sourceUri, entityCollection); processPacketData(ShadowMode, polyline, 'shadows', polylineData.shadows, interval, sourceUri, entityCollection); processPacketData(DistanceDisplayCondition, polyline, 'distanceDisplayCondition', polylineData.distanceDisplayCondition, interval, sourceUri, entityCollection); diff --git a/Source/DataSources/KmlDataSource.js b/Source/DataSources/KmlDataSource.js index 55f9469e219f..4ef9027a7e3b 100644 --- a/Source/DataSources/KmlDataSource.js +++ b/Source/DataSources/KmlDataSource.js @@ -1,4 +1,5 @@ define([ + '../Core/ArcType', '../Core/AssociativeArray', '../Core/BoundingRectangle', '../Core/Cartesian2', @@ -64,6 +65,7 @@ define([ './TimeIntervalCollectionProperty', './WallGraphics' ], function( + ArcType, AssociativeArray, BoundingRectangle, Cartesian2, @@ -1287,7 +1289,7 @@ define([ entity.polyline = polyline; polyline.positions = createPositionPropertyArrayFromAltitudeMode(coordinates, altitudeMode, gxAltitudeMode, ellipsoid); if (!tessellate || canExtrude) { - polyline.followSurface = false; + polyline.arcType = ArcType.NONE; } } diff --git a/Specs/Core/SimplePolylineGeometrySpec.js b/Specs/Core/SimplePolylineGeometrySpec.js index 193136e948e6..4e951f2c371c 100644 --- a/Specs/Core/SimplePolylineGeometrySpec.js +++ b/Specs/Core/SimplePolylineGeometrySpec.js @@ -116,7 +116,7 @@ defineSuite([ var positions = [new Cartesian3(), new Cartesian3(1.0, 0.0, 0.0), new Cartesian3(2.0, 0.0, 0.0)]; var line = SimplePolylineGeometry.createGeometry(new SimplePolylineGeometry({ positions : positions, - followSurface: false + arcType: ArcType.NONE })); expect(line.attributes.position.values).toEqual([0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0]); @@ -131,7 +131,7 @@ defineSuite([ var line = SimplePolylineGeometry.createGeometry(new SimplePolylineGeometry({ positions : positions, colors : colors, - followSurface: false + arcType : ArcType.NONE })); expect(line.attributes.color).toBeDefined(); @@ -147,7 +147,7 @@ defineSuite([ positions : positions, colors : colors, colorsPerVertex : true, - followSurface: false + arcType : ArcType.NONE })); expect(line.attributes.color).toBeDefined(); @@ -161,7 +161,7 @@ defineSuite([ positions : positions, colors : [Color.RED, Color.LIME, Color.BLUE], colorsPerVertex : true, - followSurface : false, + arcType : ArcType.NONE, granularity : 11, ellipsoid : new Ellipsoid(12, 13, 14) }); @@ -171,7 +171,7 @@ defineSuite([ line = new SimplePolylineGeometry({ positions : positions, colorsPerVertex : false, - followSurface : false, + arcType : ArcType.NONE, granularity : 11, ellipsoid : new Ellipsoid(12, 13, 14) }); diff --git a/Specs/Data/CZML/ValidationDocument.czml b/Specs/Data/CZML/ValidationDocument.czml index 0bf1a8df0c59..8b959a351d2e 100644 --- a/Specs/Data/CZML/ValidationDocument.czml +++ b/Specs/Data/CZML/ValidationDocument.czml @@ -474,7 +474,7 @@ } } }, - "followSurface":true, + "arcType":"GEODESIC", "shadows":"CAST_ONLY", "depthFailMaterial":{ "solidColor":{ @@ -6313,6 +6313,9 @@ "followSurface":{ "reference":"Constant#polyline.followSurface" }, + "arcType":{ + "reference":"Constant#polyline.arcType" + }, "shadows":{ "reference":"Constant#polyline.shadows" }, diff --git a/Specs/DataSources/CzmlDataSourceSpec.js b/Specs/DataSources/CzmlDataSourceSpec.js index 23e8c16ce113..397f69f870d1 100644 --- a/Specs/DataSources/CzmlDataSourceSpec.js +++ b/Specs/DataSources/CzmlDataSourceSpec.js @@ -1,5 +1,6 @@ defineSuite([ 'DataSources/CzmlDataSource', + 'Core/ArcType', 'Core/BoundingRectangle', 'Core/Cartesian2', 'Core/Cartesian3', @@ -38,6 +39,7 @@ defineSuite([ 'ThirdParty/when' ], function( CzmlDataSource, + ArcType, BoundingRectangle, Cartesian2, Cartesian3, @@ -3775,7 +3777,7 @@ defineSuite([ expect(e.polyline.width.getValue(date)).toEqual(14667.0); expect(e.polyline.granularity.getValue(date)).toEqual(53395.0); expect(e.polyline.material.color.getValue(date)).toEqual(Color.fromBytes(88, 0, 232, 230)); - expect(e.polyline.followSurface.getValue(date)).toEqual(true); + expect(e.polyline.arcType.getValue(date)).toEqual(ArcType.GEODESIC); expect(e.polyline.shadows.getValue(date)).toEqual(ShadowMode.CAST_ONLY); expect(e.polyline.depthFailMaterial.color.getValue(date)).toEqual(Color.fromBytes(197, 195, 115, 198)); expect(e.polyline.distanceDisplayCondition.getValue(date)).toEqual(new DistanceDisplayCondition(5807, 30486)); @@ -4584,7 +4586,7 @@ defineSuite([ expect(e.polyline.width.getValue(date)).toEqual(constant.polyline.width.getValue(date)); expect(e.polyline.granularity.getValue(date)).toEqual(constant.polyline.granularity.getValue(date)); expect(e.polyline.material.color.getValue(date)).toEqual(constant.polyline.material.color.getValue(date)); - expect(e.polyline.followSurface.getValue(date)).toEqual(constant.polyline.followSurface.getValue(date)); + expect(e.polyline.arcType.getValue(date)).toEqual(constant.polyline.arcType.getValue(date)); expect(e.polyline.shadows.getValue(date)).toEqual(constant.polyline.shadows.getValue(date)); expect(e.polyline.depthFailMaterial.color.getValue(date)).toEqual(constant.polyline.depthFailMaterial.color.getValue(date)); expect(e.polyline.distanceDisplayCondition.getValue(date)).toEqual(constant.polyline.distanceDisplayCondition.getValue(date)); diff --git a/Specs/DataSources/KmlDataSourceSpec.js b/Specs/DataSources/KmlDataSourceSpec.js index 628e6fe9755f..58b6afda68a0 100644 --- a/Specs/DataSources/KmlDataSourceSpec.js +++ b/Specs/DataSources/KmlDataSourceSpec.js @@ -1,5 +1,6 @@ defineSuite([ 'DataSources/KmlDataSource', + 'Core/ArcType', 'Core/BoundingRectangle', 'Core/Cartesian2', 'Core/Cartesian3', @@ -38,6 +39,7 @@ defineSuite([ 'ThirdParty/when' ], function( KmlDataSource, + ArcType, BoundingRectangle, Cartesian2, Cartesian3, @@ -2161,7 +2163,7 @@ defineSuite([ expect(polyline).toBeDefined(); expect(polyline.positions).toBeUndefined(); - expect(polyline.followSurface).toBeUndefined(); + expect(polyline.arcType).toBeUndefined(); expect(polyline.width).toBeUndefined(); expect(polyline.show).toBeUndefined(); expect(polyline.material).toBeUndefined(); @@ -2899,7 +2901,7 @@ defineSuite([ var entity = entities[0]; expect(entity.wall).toBeUndefined(); expect(entity.polyline).toBeDefined(); - expect(entity.polyline.followSurface.getValue()).toEqual(false); + expect(entity.polyline.arcType.getValue()).toEqual(ArcType.NONE); }); }); @@ -2923,7 +2925,7 @@ defineSuite([ var positions = entity.polyline.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon([Cartesian3.fromDegrees(1, 2), Cartesian3.fromDegrees(4, 5)], CesiumMath.EPSILON10); - expect(entity.polyline.followSurface.getValue()).toEqual(false); + expect(entity.polyline.arcType.getValue()).toEqual(ArcType.NONE); }); }); @@ -2968,7 +2970,7 @@ defineSuite([ expect(entities.length).toEqual(1); var entity = entities[0]; - expect(entity.polyline.followSurface).toBeUndefined(); + expect(entity.polyline.arcType).toBeUndefined(); var positions = entity.polyline.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon([Cartesian3.fromDegrees(1, 2), Cartesian3.fromDegrees(4, 5)], CesiumMath.EPSILON10); }); @@ -2991,7 +2993,7 @@ defineSuite([ expect(entities.length).toEqual(1); var entity = entities[0]; - expect(entity.polyline.followSurface).toBeUndefined(); + expect(entity.polyline.arcType).toBeUndefined(); var positions = entity.polyline.positions.getValue(Iso8601.MINIMUM_VALUE); expect(positions).toEqualEpsilon([Cartesian3.fromDegrees(1, 2), Cartesian3.fromDegrees(4, 5)], CesiumMath.EPSILON10); }); diff --git a/Specs/Scene/GeometryRenderingSpec.js b/Specs/Scene/GeometryRenderingSpec.js index d766f50e6894..fb2662ac6159 100644 --- a/Specs/Scene/GeometryRenderingSpec.js +++ b/Specs/Scene/GeometryRenderingSpec.js @@ -1,4 +1,5 @@ defineSuite([ + 'Core/ArcType', 'Core/BoundingSphere', 'Core/BoxGeometry', 'Core/PlaneGeometry', @@ -41,6 +42,7 @@ defineSuite([ 'Specs/createScene', 'Specs/pollToPromise' ], 'Scene/GeometryRendering', function( + ArcType, BoundingSphere, BoxGeometry, PlaneGeometry, @@ -1563,7 +1565,7 @@ defineSuite([ ]), width : 20.0, colors : [new Color(1.0, 0.0, 0.0, 1.0), new Color(0.0, 1.0, 0.0, 1.0)], - followSurface: false + arcType : ArcType.NONE }), id : 'polyline' }); @@ -1582,7 +1584,7 @@ defineSuite([ width : 20.0, colors : [new Color(1.0, 0.0, 0.0, 1.0), new Color(0.0, 1.0, 0.0, 1.0)], colorsPerVertex : true, - followSurface: false + arcType : ArcType.NONE }), id : 'polyline' }); diff --git a/Specs/Scene/PolylineColorAppearanceSpec.js b/Specs/Scene/PolylineColorAppearanceSpec.js index b2983c6d2ba3..a9022cbf42b7 100644 --- a/Specs/Scene/PolylineColorAppearanceSpec.js +++ b/Specs/Scene/PolylineColorAppearanceSpec.js @@ -1,5 +1,6 @@ defineSuite([ 'Scene/PolylineColorAppearance', + 'Core/ArcType', 'Core/Cartesian3', 'Core/Color', 'Core/ColorGeometryInstanceAttribute', @@ -59,7 +60,7 @@ defineSuite([ ], width : 10.0, vertexFormat : PolylineColorAppearance.VERTEX_FORMAT, - followSurface: false + arcType : ArcType.NONE }), attributes : { color : ColorGeometryInstanceAttribute.fromColor(new Color(1.0, 1.0, 0.0, 1.0)) diff --git a/Specs/Scene/PolylineMaterialAppearanceSpec.js b/Specs/Scene/PolylineMaterialAppearanceSpec.js index 8f0250777878..5ae00f21daac 100644 --- a/Specs/Scene/PolylineMaterialAppearanceSpec.js +++ b/Specs/Scene/PolylineMaterialAppearanceSpec.js @@ -1,5 +1,6 @@ defineSuite([ 'Scene/PolylineMaterialAppearance', + 'Core/ArcType', 'Core/Cartesian3', 'Core/GeometryInstance', 'Core/PolylineGeometry', @@ -9,6 +10,7 @@ defineSuite([ 'Specs/createScene' ], function( PolylineMaterialAppearance, + ArcType, Cartesian3, GeometryInstance, PolylineGeometry, @@ -58,7 +60,7 @@ defineSuite([ ], width : 10.0, vertexFormat : PolylineMaterialAppearance.VERTEX_FORMAT, - followSurface: false + arcType : ArcType.NONE }) }), appearance : new PolylineMaterialAppearance({ From 7f3aa0a5e0d742c675de2b452b25c703cbcad0a8 Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Tue, 19 Feb 2019 14:14:35 -0500 Subject: [PATCH 2/7] Update changes.md --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index e1465f5fdadc..1bf5bed856fe 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Change Log ##### Additions :tada: * `czm_materialInput.aspect` was added as an angle in radians between 0 and 2pi (east, north, west to south). +* Added support for `arcType` to CZML Data Source. [#7582](https://github.com/AnalyticalGraphicsInc/cesium/issues/7582) ##### Fixes :wrench: * Fixed an issue where models would cause a crash on load if some primitives were Draco encoded and others were not. [#7383](https://github.com/AnalyticalGraphicsInc/cesium/issues/7383) @@ -19,6 +20,7 @@ Change Log * Fixed model silhouette colors when rendering with high dynamic range. [#7563](https://github.com/AnalyticalGraphicsInc/cesium/pull/7563) * Fixed an issue with ground polylines on globes that use ellipsoids other than WGS84. [#7552](https://github.com/AnalyticalGraphicsInc/cesium/issues/7552) * Fixed an issue where Draco compressed models with RGB per-vertex color would not load in Cesium. [#7576](https://github.com/AnalyticalGraphicsInc/cesium/issues/7576) +* Changed usage of deprecated property `followSurface` to use `arcType`. [#7572](https://github.com/AnalyticalGraphicsInc/cesium/issues/7572) ### 1.54 - 2019-02-01 From af4649dab67c4ba0108a787b4400c843c264ad66 Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Tue, 19 Feb 2019 14:28:03 -0500 Subject: [PATCH 3/7] Fix missing definition for ArcType --- Specs/Scene/PolylineColorAppearanceSpec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Specs/Scene/PolylineColorAppearanceSpec.js b/Specs/Scene/PolylineColorAppearanceSpec.js index a9022cbf42b7..b1fbb025fd85 100644 --- a/Specs/Scene/PolylineColorAppearanceSpec.js +++ b/Specs/Scene/PolylineColorAppearanceSpec.js @@ -11,6 +11,7 @@ defineSuite([ 'Specs/createScene' ], function( PolylineColorAppearance, + ArcType, Cartesian3, Color, ColorGeometryInstanceAttribute, From 13e90126c733b1d1ce9b2eb6112efedae8bbb58e Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Wed, 20 Feb 2019 18:30:16 -0500 Subject: [PATCH 4/7] Fix missed comment changes --- Apps/Sandcastle/gallery/development/Polyline.html | 2 +- Apps/Sandcastle/gallery/development/Simple Polyline.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Apps/Sandcastle/gallery/development/Polyline.html b/Apps/Sandcastle/gallery/development/Polyline.html index 690b0eb74a92..f7b2ba49a975 100644 --- a/Apps/Sandcastle/gallery/development/Polyline.html +++ b/Apps/Sandcastle/gallery/development/Polyline.html @@ -52,7 +52,7 @@ // Example 2: Draw a straight blue polyline -// Setting the arcType option to false will allow +// Setting the arcType option to ArcType.NONE will allow // you to draw a straight polyline. Otherwise, it will // curve to the globe surface. scene.primitives.add(new Cesium.Primitive({ diff --git a/Apps/Sandcastle/gallery/development/Simple Polyline.html b/Apps/Sandcastle/gallery/development/Simple Polyline.html index 61324bc37d68..26f214227ec9 100644 --- a/Apps/Sandcastle/gallery/development/Simple Polyline.html +++ b/Apps/Sandcastle/gallery/development/Simple Polyline.html @@ -53,7 +53,7 @@ } // For per segment coloring, provide the colors options with an // array of colors where the length is equal to the number of positions. -// Setting arcType to false will draw straight lines. +// Setting arcType to ArcType.NONE will draw straight lines. // Otherwise, the polyline curves to the surface of the globe. var perSegmentPolyline = new Cesium.GeometryInstance({ geometry : new Cesium.SimplePolylineGeometry({ From f4ab9748e96c8aac753e3f67adb68a1667591f69 Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Wed, 20 Feb 2019 18:30:25 -0500 Subject: [PATCH 5/7] Revert "Update changes.md" This reverts commit 7f3aa0a5e0d742c675de2b452b25c703cbcad0a8. --- CHANGES.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1bf5bed856fe..e1465f5fdadc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,6 @@ Change Log ##### Additions :tada: * `czm_materialInput.aspect` was added as an angle in radians between 0 and 2pi (east, north, west to south). -* Added support for `arcType` to CZML Data Source. [#7582](https://github.com/AnalyticalGraphicsInc/cesium/issues/7582) ##### Fixes :wrench: * Fixed an issue where models would cause a crash on load if some primitives were Draco encoded and others were not. [#7383](https://github.com/AnalyticalGraphicsInc/cesium/issues/7383) @@ -20,7 +19,6 @@ Change Log * Fixed model silhouette colors when rendering with high dynamic range. [#7563](https://github.com/AnalyticalGraphicsInc/cesium/pull/7563) * Fixed an issue with ground polylines on globes that use ellipsoids other than WGS84. [#7552](https://github.com/AnalyticalGraphicsInc/cesium/issues/7552) * Fixed an issue where Draco compressed models with RGB per-vertex color would not load in Cesium. [#7576](https://github.com/AnalyticalGraphicsInc/cesium/issues/7576) -* Changed usage of deprecated property `followSurface` to use `arcType`. [#7572](https://github.com/AnalyticalGraphicsInc/cesium/issues/7572) ### 1.54 - 2019-02-01 From d0653e1878e7c67cdcb8e2a7125af2f19cfeb35d Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Wed, 20 Feb 2019 18:33:33 -0500 Subject: [PATCH 6/7] Add compatibity from polyline.followSurface to polyline.arcType --- Source/DataSources/CzmlDataSource.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js index 96eba71a80c2..0506084c17a9 100644 --- a/Source/DataSources/CzmlDataSource.js +++ b/Source/DataSources/CzmlDataSource.js @@ -1800,8 +1800,17 @@ define([ processPacketData(Number, polyline, 'granularity', polylineData.granularity, interval, sourceUri, entityCollection); processMaterialPacketData(polyline, 'material', polylineData.material, interval, sourceUri, entityCollection); processMaterialPacketData(polyline, 'depthFailMaterial', polylineData.depthFailMaterial, interval, sourceUri, entityCollection); - processPacketData(Boolean, polyline, 'followSurface', polylineData.followSurface, interval, sourceUri, entityCollection); - processPacketData(ArcType, polyline, 'arcType', polylineData.arcType, interval, sourceUri, entityCollection); + // Don't want to break CZML spec to keep this workaround even after followSurface has been deprecated from geometry. + // See https://github.com/AnalyticalGraphicsInc/cesium/pull/7582#discussion_r258695385 + if (defined(polylineData.followSurface) && !defined(polylineData.arcType)) { + if (polyline.followSurface) { + processPacketData(ArcType, polyline, 'arcType', ArcType.GEODESIC, interval, sourceUri, entityCollection); + } else { + processPacketData(ArcType, polyline, 'arcType', ArcType.NONE, interval, sourceUri, entityCollection); + } + } else { + processPacketData(ArcType, polyline, 'arcType', polylineData.arcType, interval, sourceUri, entityCollection); + } processPacketData(Boolean, polyline, 'clampToGround', polylineData.clampToGround, interval, sourceUri, entityCollection); processPacketData(ShadowMode, polyline, 'shadows', polylineData.shadows, interval, sourceUri, entityCollection); processPacketData(DistanceDisplayCondition, polyline, 'distanceDisplayCondition', polylineData.distanceDisplayCondition, interval, sourceUri, entityCollection); From 0cbd2d3bc68bef6fcd994bf7e1ff71739e689aba Mon Sep 17 00:00:00 2001 From: Shehzan Mohammed Date: Wed, 20 Feb 2019 18:39:17 -0500 Subject: [PATCH 7/7] Add arcType property to CZML's polygon process --- Source/DataSources/CzmlDataSource.js | 1 + Specs/Data/CZML/ValidationDocument.czml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Source/DataSources/CzmlDataSource.js b/Source/DataSources/CzmlDataSource.js index 0506084c17a9..44f6d1318731 100644 --- a/Source/DataSources/CzmlDataSource.js +++ b/Source/DataSources/CzmlDataSource.js @@ -1771,6 +1771,7 @@ define([ processPacketData(Boolean, polygon, 'perPositionHeight', polygonData.perPositionHeight, interval, sourceUri, entityCollection); processPacketData(Boolean, polygon, 'closeTop', polygonData.closeTop, interval, sourceUri, entityCollection); processPacketData(Boolean, polygon, 'closeBottom', polygonData.closeBottom, interval, sourceUri, entityCollection); + processPacketData(ArcType, polygon, 'arcType', polygonData.arcType, interval, sourceUri, entityCollection); processPacketData(ShadowMode, polygon, 'shadows', polygonData.shadows, interval, sourceUri, entityCollection); processPacketData(DistanceDisplayCondition, polygon, 'distanceDisplayCondition', polygonData.distanceDisplayCondition, interval, sourceUri, entityCollection); processPacketData(Number, polygon, 'zIndex', polygonData.zIndex, interval, sourceUri, entityCollection); diff --git a/Specs/Data/CZML/ValidationDocument.czml b/Specs/Data/CZML/ValidationDocument.czml index 8b959a351d2e..e012e00a4278 100644 --- a/Specs/Data/CZML/ValidationDocument.czml +++ b/Specs/Data/CZML/ValidationDocument.czml @@ -449,6 +449,7 @@ "perPositionHeight":true, "closeTop":true, "closeBottom":true, + "arcType":"GEODESIC", "shadows":"CAST_ONLY", "distanceDisplayCondition":{ "distanceDisplayCondition":[ @@ -6281,6 +6282,9 @@ "closeBottom":{ "reference":"Constant#polygon.closeBottom" }, + "arcType":{ + "reference":"Constant#polygon.arcType" + }, "shadows":{ "reference":"Constant#polygon.shadows" },