Skip to content

Commit e656a8d

Browse files
author
hpinkos
committed
fix classification type
1 parent 8d7902c commit e656a8d

10 files changed

+20
-22
lines changed

Apps/Sandcastle/gallery/Z-Indexing Geometry.html

+6-12
Original file line numberDiff line numberDiff line change
@@ -35,53 +35,47 @@
3535
rectangle : {
3636
coordinates : Cesium.Rectangle.fromDegrees(-110.0, 20.0, -100.5, 30.0),
3737
material : Cesium.Color.RED,
38-
zIndex: 1,
39-
classificationType : Cesium.ClassificationType.TERRAIN
38+
zIndex: 1
4039
}
4140
});
4241

4342
viewer.entities.add({
4443
rectangle : {
4544
coordinates : Cesium.Rectangle.fromDegrees(-112.0, 25.0, -102.5, 35.0),
4645
material : '../images/Cesium_Logo_Color.jpg',
47-
zIndex: 2,
48-
classificationType : Cesium.ClassificationType.TERRAIN
46+
zIndex: 2
4947
}
5048
});
5149

5250
viewer.entities.add({
5351
rectangle : {
5452
coordinates : Cesium.Rectangle.fromDegrees(-110.0, 31.0, -100.5, 41.0),
5553
material : Cesium.Color.BLUE,
56-
zIndex: 3,
57-
classificationType : Cesium.ClassificationType.TERRAIN
54+
zIndex: 3
5855
}
5956
});
6057

6158
viewer.entities.add({
6259
rectangle : {
6360
coordinates : Cesium.Rectangle.fromDegrees(-99.5, 20.0, -90.0, 30.0),
6461
material : '../images/Cesium_Logo_Color.jpg',
65-
zIndex: 3,
66-
classificationType : Cesium.ClassificationType.TERRAIN
62+
zIndex: 3
6763
}
6864
});
6965

7066
viewer.entities.add({
7167
rectangle : {
7268
coordinates : Cesium.Rectangle.fromDegrees(-97.5, 25.0, -88.0, 35.0),
7369
material : Cesium.Color.GREEN,
74-
zIndex: 2,
75-
classificationType : Cesium.ClassificationType.TERRAIN
70+
zIndex: 2
7671
}
7772
});
7873

7974
viewer.entities.add({
8075
rectangle : {
8176
coordinates : Cesium.Rectangle.fromDegrees(-99.5, 31.0, -90.0, 41.0),
8277
material : Cesium.Color.BLUE,
83-
zIndex: 1,
84-
classificationType : Cesium.ClassificationType.TERRAIN
78+
zIndex: 1
8579
}
8680
});
8781

2.93 KB
Loading

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Change Log
1717
* Added `PostProcessStageComposite` for multi-stage post-processes like depth of field.
1818
* Added a new Sandcastle label `Post Processing` to showcase the different built-in post-process stages.
1919
* Added `Rectangle.equalsEpsilon` for comparing the equality of two rectangles [#6533](https://github.com/AnalyticalGraphicsInc/cesium/pull/6533)
20+
* Added `zIndex` for ground geometry, including corridor, ellipse, polygon and rectangle entities. [#6362](https://github.com/AnalyticalGraphicsInc/cesium/pull/6362)
2021

2122
##### Fixes :wrench:
2223
* Fixed a bug causing custom TilingScheme classes to not be able to use a GeographicProjection. [#6524](https://github.com/AnalyticalGraphicsInc/cesium/pull/6524)
@@ -30,6 +31,7 @@ Change Log
3031

3132
##### Breaking Changes :mega:
3233
* Removed `Scene.copyGlobeDepth`. Globe depth will now be copied by default when supported. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393)
34+
* The default `classificationType` for `GroundPrimitive`, `CorridorGraphics`, `EllipseGraphics`, `PolygonGraphics` and `RectangleGraphics` is now `ClassificationType.TERRAIN`. If you wish the geometry to color both terrain and 3D tiles, pass in the option `classificationType: Cesium.ClassificationType.BOTH`.
3335

3436
##### Additions :tada:
3537
* Added support for materials on terrain entities (entities with unspecified `height`) and `GroundPrimitives`. [#6393](https://github.com/AnalyticalGraphicsInc/cesium/pull/6393)

Source/DataSources/CorridorGraphics.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ define([
210210
* Gets or sets the {@link ClassificationType} Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
211211
* @memberof CorridorGraphics.prototype
212212
* @type {Property}
213-
* @default ClassificationType.BOTH
213+
* @default ClassificationType.TERRAIN
214214
*/
215215
classificationType : createPropertyDescriptor('classificationType'),
216216

Source/DataSources/EllipseGraphics.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ define([
232232
* Gets or sets the {@link ClassificationType} Property specifying whether this ellipse will classify terrain, 3D Tiles, or both when on the ground.
233233
* @memberof EllipseGraphics.prototype
234234
* @type {Property}
235-
* @default ClassificationType.BOTH
235+
* @default ClassificationType.TERRAIN
236236
*/
237237
classificationType : createPropertyDescriptor('classificationType'),
238238

Source/DataSources/GeometryUpdater.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ define([
4343
var defaultOutlineColor = new ConstantProperty(Color.BLACK);
4444
var defaultShadows = new ConstantProperty(ShadowMode.DISABLED);
4545
var defaultDistanceDisplayCondition = new ConstantProperty(new DistanceDisplayCondition());
46-
var defaultClassificationType = new ConstantProperty(ClassificationType.BOTH);
46+
var defaultClassificationType = new ConstantProperty(ClassificationType.TERRAIN);
4747

4848
/**
4949
* An abstract class for updating geometry entites.

Source/DataSources/PolygonGraphics.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ define([
233233
* Gets or sets the {@link ClassificationType} Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
234234
* @memberof PolygonGraphics.prototype
235235
* @type {Property}
236-
* @default ClassificationType.BOTH
236+
* @default ClassificationType.TERRAIN
237237
*/
238238
classificationType : createPropertyDescriptor('classificationType'),
239239

Source/DataSources/RectangleGraphics.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ define([
212212
* Gets or sets the {@link ClassificationType} Property specifying whether this rectangle will classify terrain, 3D Tiles, or both when on the ground.
213213
* @memberof RectangleGraphics.prototype
214214
* @type {Property}
215-
* @default ClassificationType.BOTH
215+
* @default ClassificationType.TERRAIN
216216
*/
217217
classificationType : createPropertyDescriptor('classificationType'),
218218

Source/Scene/GroundPrimitive.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ define([
103103
* @param {Boolean} [options.releaseGeometryInstances=true] When <code>true</code>, the primitive does not keep a reference to the input <code>geometryInstances</code> to save memory.
104104
* @param {Boolean} [options.allowPicking=true] When <code>true</code>, each geometry instance will only be pickable with {@link Scene#pick}. When <code>false</code>, GPU memory is saved.
105105
* @param {Boolean} [options.asynchronous=true] Determines if the primitive will be created asynchronously or block until ready. If false initializeTerrainHeights() must be called first.
106-
* @param {ClassificationType} [options.classificationType=ClassificationType.BOTH] Determines whether terrain, 3D Tiles or both will be classified.
106+
* @param {ClassificationType} [options.classificationType=ClassificationType.TERRAIN] Determines whether terrain, 3D Tiles or both will be classified.
107107
* @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Determines if this primitive's commands' bounding spheres are shown.
108108
* @param {Boolean} [options.debugShowShadowVolume=false] For debugging only. Determines if the shadow volume for each geometry in the primitive is drawn. Must be <code>true</code> on
109109
* creation for the volumes to be created before the geometry is released or options.releaseGeometryInstance must be <code>false</code>.
@@ -208,9 +208,9 @@ define([
208208
*
209209
* @type {ClassificationType}
210210
*
211-
* @default ClassificationType.BOTH
211+
* @default ClassificationType.TERRAIN
212212
*/
213-
this.classificationType = defaultValue(options.classificationType, ClassificationType.BOTH);
213+
this.classificationType = defaultValue(options.classificationType, ClassificationType.TERRAIN);
214214
/**
215215
* This property is for debugging only; it is not for production use nor is it optimized.
216216
* <p>

Specs/Scene/GroundPrimitiveSpec.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,8 @@ defineSuite([
542542

543543
primitive = new GroundPrimitive({
544544
geometryInstances : rectangleInstance,
545-
asynchronous : false
545+
asynchronous : false,
546+
classificationType: ClassificationType.BOTH
546547
});
547548

548549
scene.camera.setView({ destination : rectangle });
@@ -582,7 +583,8 @@ defineSuite([
582583

583584
primitive = new GroundPrimitive({
584585
geometryInstances : rectangleInstance,
585-
asynchronous : false
586+
asynchronous : false,
587+
classificationType: ClassificationType.BOTH
586588
});
587589

588590
scene.camera.setView({ destination : rectangle });

0 commit comments

Comments
 (0)