Skip to content

Commit 5352b53

Browse files
author
Hannah
authored
Merge pull request #7053 from cleroux/master
Fix entity show issues, issue #7048
2 parents db69cb9 + 36bb4ec commit 5352b53

8 files changed

+8
-108
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Change Log
1717
* Fixed an issue in the 3D Tiles traversal where empty tiles would be selected instead of their nearest loaded ancestors. [#7011](https://github.com/AnalyticalGraphicsInc/cesium/pull/7011)
1818
* Fixed an issue where scaling near zero with an model animation could cause rendering to stop. [#6954](https://github.com/AnalyticalGraphicsInc/cesium/pull/6954)
1919
* Fixed bug where credits weren't displaying correctly if more than one viewer was initialized [#6965](expect(https://github.com/AnalyticalGraphicsInc/cesium/issues/6965)
20+
* Fixed entity show issues. [#7048](https://github.com/AnalyticalGraphicsInc/cesium/issues/7048)
2021
* Fixed a bug where polylines on terrain covering very large portions of the globe would cull incorrectly in 3d-only scenes. [#7043](https://github.com/AnalyticalGraphicsInc/cesium/issues/7043)
2122
* Fixed bug causing crash on entity geometry material change [#7047](https://github.com/AnalyticalGraphicsInc/cesium/pull/7047)
2223

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
192192
* [Mark Erikson](https://github.com/markerikson)
193193
* [Hannah Bollar](https://github.com/hanbollar)
194194
* [Felix Palmer](https://github.com/felixpalmer)
195+
* [Cedric Le Roux](https://github.com/cleroux)

Source/DataSources/StaticGeometryColorBatch.js

+1-20
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ define([
117117
var removedCount = 0;
118118
var primitive = this.primitive;
119119
var primitives = this.primitives;
120-
var attributes;
121120
var i;
122121

123122
if (this.createPrimitive) {
@@ -132,24 +131,6 @@ define([
132131
}
133132
}
134133

135-
for (i = 0; i < geometriesLength; i++) {
136-
var geometryItem = geometries[i];
137-
var originalAttributes = geometryItem.attributes;
138-
attributes = this.attributes.get(geometryItem.id.id);
139-
140-
if (defined(attributes)) {
141-
if (defined(originalAttributes.show)) {
142-
attributes.show = originalAttributes.show.value;
143-
}
144-
if (defined(originalAttributes.color)) {
145-
attributes.color = originalAttributes.color.value;
146-
}
147-
if (defined(originalAttributes.depthFailColor)) {
148-
attributes.depthFailColor = originalAttributes.depthFailColor.value;
149-
}
150-
}
151-
}
152-
153134
var depthFailAppearance;
154135
if (defined(this.depthFailAppearanceType)) {
155136
if (defined(this.depthFailMaterialProperty)) {
@@ -210,7 +191,7 @@ define([
210191
var updater = updatersWithAttributes[i];
211192
var instance = this.geometry.get(updater.id);
212193

213-
attributes = this.attributes.get(instance.id.id);
194+
var attributes = this.attributes.get(instance.id.id);
214195
if (!defined(attributes)) {
215196
attributes = primitive.getGeometryInstanceAttributes(instance.id);
216197
this.attributes.set(instance.id.id, attributes);

Source/DataSources/StaticGeometryPerMaterialBatch.js

+1-20
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ define([
115115
var primitive = this.primitive;
116116
var primitives = this.primitives;
117117
var geometries = this.geometry.values;
118-
var attributes;
119118
var i;
120119

121120
if (this.createPrimitive) {
@@ -129,24 +128,6 @@ define([
129128
}
130129
}
131130

132-
for (i = 0; i < geometriesLength; i++) {
133-
var geometry = geometries[i];
134-
var originalAttributes = geometry.attributes;
135-
attributes = this.attributes.get(geometry.id.id);
136-
137-
if (defined(attributes)) {
138-
if (defined(originalAttributes.show)) {
139-
attributes.show = originalAttributes.show.value;
140-
}
141-
if (defined(originalAttributes.color)) {
142-
attributes.color = originalAttributes.color.value;
143-
}
144-
if (defined(originalAttributes.depthFailColor)) {
145-
attributes.depthFailColor = originalAttributes.depthFailColor.value;
146-
}
147-
}
148-
}
149-
150131
this.material = MaterialProperty.getValue(time, this.materialProperty, this.material);
151132

152133
var depthFailAppearance;
@@ -211,7 +192,7 @@ define([
211192
var entity = updater.entity;
212193
var instance = this.geometry.get(updater.id);
213194

214-
attributes = this.attributes.get(instance.id.id);
195+
var attributes = this.attributes.get(instance.id.id);
215196
if (!defined(attributes)) {
216197
attributes = primitive.getGeometryInstanceAttributes(instance.id);
217198
this.attributes.set(instance.id.id, attributes);

Source/DataSources/StaticGroundGeometryColorBatch.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ define([
8484
var removedCount = 0;
8585
var primitive = this.primitive;
8686
var primitives = this.primitives;
87-
var attributes;
8887
var i;
8988

9089
if (this.createPrimitive) {
@@ -99,21 +98,6 @@ define([
9998
}
10099
}
101100

102-
for (i = 0; i < geometriesLength; i++) {
103-
var geometryItem = geometries[i];
104-
var originalAttributes = geometryItem.attributes;
105-
attributes = this.attributes.get(geometryItem.id.id);
106-
107-
if (defined(attributes)) {
108-
if (defined(originalAttributes.show)) {
109-
attributes.show = originalAttributes.show.value;
110-
}
111-
if (defined(originalAttributes.color)) {
112-
attributes.color = originalAttributes.color.value;
113-
}
114-
}
115-
}
116-
117101
primitive = new GroundPrimitive({
118102
show : false,
119103
asynchronous : true,
@@ -151,7 +135,7 @@ define([
151135
var updater = updatersWithAttributes[i];
152136
var instance = this.geometry.get(updater.id);
153137

154-
attributes = this.attributes.get(instance.id.id);
138+
var attributes = this.attributes.get(instance.id.id);
155139
if (!defined(attributes)) {
156140
attributes = primitive.getGeometryInstanceAttributes(instance.id);
157141
this.attributes.set(instance.id.id, attributes);

Source/DataSources/StaticGroundGeometryPerMaterialBatch.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ define([
117117
var primitive = this.primitive;
118118
var primitives = this.primitives;
119119
var geometries = this.geometry.values;
120-
var attributes;
121120
var i;
122121

123122
if (this.createPrimitive) {
@@ -133,21 +132,6 @@ define([
133132
}
134133
}
135134

136-
for (i = 0; i < geometriesLength; i++) {
137-
var geometry = geometries[i];
138-
var originalAttributes = geometry.attributes;
139-
attributes = this.attributes.get(geometry.id.id);
140-
141-
if (defined(attributes)) {
142-
if (defined(originalAttributes.show)) {
143-
attributes.show = originalAttributes.show.value;
144-
}
145-
if (defined(originalAttributes.color)) {
146-
attributes.color = originalAttributes.color.value;
147-
}
148-
}
149-
}
150-
151135
this.material = MaterialProperty.getValue(time, this.materialProperty, this.material);
152136

153137
primitive = new GroundPrimitive({
@@ -195,7 +179,7 @@ define([
195179
var entity = updater.entity;
196180
var instance = this.geometry.get(updater.id);
197181

198-
attributes = this.attributes.get(instance.id.id);
182+
var attributes = this.attributes.get(instance.id.id);
199183
if (!defined(attributes)) {
200184
attributes = primitive.getGeometryInstanceAttributes(instance.id);
201185
this.attributes.set(instance.id.id, attributes);

Source/DataSources/StaticGroundPolylinePerMaterialBatch.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ define([
116116
var primitive = this.primitive;
117117
var orderedGroundPrimitives = this.orderedGroundPrimitives;
118118
var geometries = this.geometry.values;
119-
var attributes;
120119
var i;
121120

122121
if (this.createPrimitive) {
@@ -132,21 +131,6 @@ define([
132131
}
133132
}
134133

135-
for (i = 0; i < geometriesLength; i++) {
136-
var geometry = geometries[i];
137-
var originalAttributes = geometry.attributes;
138-
attributes = this.attributes.get(geometry.id.id);
139-
140-
if (defined(attributes)) {
141-
if (defined(originalAttributes.show)) {
142-
attributes.show = originalAttributes.show.value;
143-
}
144-
if (defined(originalAttributes.color)) {
145-
attributes.color = originalAttributes.color.value;
146-
}
147-
}
148-
}
149-
150134
primitive = new GroundPolylinePrimitive({
151135
show : false,
152136
asynchronous : true,
@@ -194,7 +178,7 @@ define([
194178
var entity = updater.entity;
195179
var instance = this.geometry.get(updater.id);
196180

197-
attributes = this.attributes.get(instance.id.id);
181+
var attributes = this.attributes.get(instance.id.id);
198182
if (!defined(attributes)) {
199183
attributes = primitive.getGeometryInstanceAttributes(instance.id);
200184
this.attributes.set(instance.id.id, attributes);

Source/DataSources/StaticOutlineGeometryBatch.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ define([
8787
var removedCount = 0;
8888
var primitive = this.primitive;
8989
var primitives = this.primitives;
90-
var attributes;
9190
var i;
9291

9392
if (this.createPrimitive) {
@@ -102,21 +101,6 @@ define([
102101
}
103102
}
104103

105-
for (i = 0; i < geometriesLength; i++) {
106-
var geometryItem = geometries[i];
107-
var originalAttributes = geometryItem.attributes;
108-
attributes = this.attributes.get(geometryItem.id.id);
109-
110-
if (defined(attributes)) {
111-
if (defined(originalAttributes.show)) {
112-
attributes.show = originalAttributes.show.value;
113-
}
114-
if (defined(originalAttributes.color)) {
115-
attributes.color = originalAttributes.color.value;
116-
}
117-
}
118-
}
119-
120104
primitive = new Primitive({
121105
show : false,
122106
asynchronous : true,
@@ -163,7 +147,7 @@ define([
163147
var updater = updatersWithAttributes[i];
164148
var instance = this.geometry.get(updater.id);
165149

166-
attributes = this.attributes.get(instance.id.id);
150+
var attributes = this.attributes.get(instance.id.id);
167151
if (!defined(attributes)) {
168152
attributes = primitive.getGeometryInstanceAttributes(instance.id);
169153
this.attributes.set(instance.id.id, attributes);

0 commit comments

Comments
 (0)