Skip to content

Commit

Permalink
Merge branch 'master' into classification-primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed Jul 20, 2017
2 parents d3d1aaa + 796b114 commit 1ccd15b
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ script:

- echo 'makeZipFile' && echo -en 'travis_fold:start:script.makeZipFile\\r'
- npm run clean
- npm run makeZipFile
- npm run makeZipFile -- --concurrency 2
- npm pack
- echo -en 'travis_fold:end:script.makeZipFile\\r'

Expand Down
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@ Change Log
* `Scene/PerspectiveFrustum` is deprecated and will be removed in 1.38. Use `Core/PerspectiveFrustum`.
* `Scene/PerspectiveOffCenterFrustum` is deprecated and will be removed in 1.38. Use `Core/PerspectiveOffCenterFrustum`.
* Added ability to show tile urls in the 3D Tiles Inspector. [#5592](https://github.com/AnalyticalGraphicsInc/cesium/pull/5592)
* Fixed issue where composite 3D Tiles that contained instanced 3D Tiles with an external model reference would fail to download the model.
* Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139)
* Added ability to provide a `width` and `height` to `scene.pick`. [#5602](https://github.com/AnalyticalGraphicsInc/cesium/pull/5602)
* Added setter for `GeoJsonDataSource.name` to specify a name for the datasource [#5653](https://github.com/AnalyticalGraphicsInc/cesium/issues/5653)
* Fixed issue where scene would blink when labels were added. [#5537](https://github.com/AnalyticalGraphicsInc/cesium/issues/5537)
* Fixed label positioning when height reference changes [#5609](https://github.com/AnalyticalGraphicsInc/cesium/issues/5609)
* Fixed crash when using the `Cesium3DTilesInspectorViewModel` and removing a tileset [#5607](https://github.com/AnalyticalGraphicsInc/cesium/issues/5607)
* Fixed polygon outline in Polygon Sandcastle demo [#5642](https://github.com/AnalyticalGraphicsInc/cesium/issues/5642)
* Fixed label positioning when using `HeightReference.CLAMP_TO_GROUND` and no position [#5648](https://github.com/AnalyticalGraphicsInc/cesium/pull/5648)
* Updated `Billboard`, `Label` and `PointPrimitive` constructors to clone `NearFarScale` parameters [#5654](https://github.com/AnalyticalGraphicsInc/cesium/pull/5654)
* Added `FrustumGeometry` and `FrustumOutlineGeometry`. [#5649](https://github.com/AnalyticalGraphicsInc/cesium/pull/5649)
* Added an `options` parameter to the constructors of `PerspectiveFrustum`, `PerspectiveOffCenterFrustum`, `OrthographicFrustum`, and `OrthographicOffCenterFrustum` to set properties. [#5649](https://github.com/AnalyticalGraphicsInc/cesium/pull/5649)
* Added `ClassificationPrimitive` which defines a volume and draws the intersection of the volume and terrain or 3D Tiles. [#5625](https://github.com/AnalyticalGraphicsInc/cesium/pull/5625)
Expand Down
8 changes: 7 additions & 1 deletion Source/DataSources/GeoJsonDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,13 +683,19 @@ define([

defineProperties(GeoJsonDataSource.prototype, {
/**
* Gets a human-readable name for this instance.
* Gets or sets a human-readable name for this instance.
* @memberof GeoJsonDataSource.prototype
* @type {String}
*/
name : {
get : function() {
return this._name;
},
set : function(value) {
if (this._name !== value) {
this._name = value;
this._changed.raiseEvent(this);
}
}
},
/**
Expand Down
4 changes: 4 additions & 0 deletions Source/Scene/Instanced3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ define([

if (gltfFormat === 0) {
var gltfUrl = getStringFromTypedArray(gltfView);

// We need to remove padding from the end of the model URL in case this tile was part of a composite tile.
// This removes all white space and null characters from the end of the string.
gltfUrl = gltfUrl.replace(/[\s\0]+$/, '');
collectionOptions.url = getAbsoluteUri(joinUrls(getBaseUri(content._url, true), gltfUrl));
} else {
collectionOptions.gltf = gltfView;
Expand Down
5 changes: 5 additions & 0 deletions Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -4770,6 +4770,11 @@ define([
destroy(this._rendererResources.vertexArrays);
}

if (defined(this._removeUpdateHeightCallback)) {
this._removeUpdateHeightCallback();
this._removeUpdateHeightCallback = undefined;
}

this._rendererResources = undefined;
this._cachedRendererResources = this._cachedRendererResources && this._cachedRendererResources.release();

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"asset": {
"version": "0.0"
},
"properties": {
"Height": {
"minimum": 20,
"maximum": 20
}
},
"geometricError": 70,
"root": {
"refine": "ADD",
"boundingVolume": {
"region": [
-1.3197004795898053,
0.6988582109,
-1.3196595204101946,
0.6988897891,
0,
30
]
},
"geometricError": 0,
"content": {
"url": "compositeOfInstanced.cmpt"
}
}
}
13 changes: 13 additions & 0 deletions Specs/DataSources/GeoJsonDataSourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,19 @@ defineSuite([
expect(dataSource.show).toBe(true);
});

it('setting name raises changed event', function() {
var dataSource = new GeoJsonDataSource();

var spy = jasmine.createSpy('changedEvent');
dataSource.changedEvent.addEventListener(spy);

var newName = 'chester';
dataSource.name = newName;
expect(dataSource.name).toEqual(newName);
expect(spy.calls.count()).toEqual(1);
expect(spy).toHaveBeenCalledWith(dataSource);
});

it('show sets underlying entity collection show.', function() {
var dataSource = new GeoJsonDataSource();

Expand Down
7 changes: 6 additions & 1 deletion Specs/Scene/Composite3DTileContentSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ defineSuite([

var compositeUrl = './Data/Cesium3DTiles/Composite/Composite/';
var compositeOfComposite = './Data/Cesium3DTiles/Composite/CompositeOfComposite/';
var compositeOfInstanced = './Data/Cesium3DTiles/Composite/compositeOfInstanced/';

beforeAll(function() {
scene = createScene();
// One item in each data set is always located in the center, so point the camera there
var center = Cartesian3.fromRadians(centerLongitude, centerLatitude);
scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, 30.0));
scene.camera.lookAt(center, new HeadingPitchRange(0.0, -1.57, 26.0));
});

afterAll(function() {
Expand Down Expand Up @@ -121,6 +122,10 @@ defineSuite([
return Cesium3DTilesTester.loadTileset(scene, compositeOfComposite).then(expectRenderComposite);
});

it('renders multiple instanced tilesets', function() {
return Cesium3DTilesTester.loadTileset(scene, compositeOfInstanced).then(expectRenderComposite);
});

it('destroys', function() {
return Cesium3DTilesTester.tileDestroys(scene, compositeUrl);
});
Expand Down
18 changes: 17 additions & 1 deletion Specs/Scene/ModelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2521,6 +2521,23 @@ defineSuite([
});
});

it('removes the callback on destroy', function() {
scene.globe = createMockGlobe();
return loadModelJson(texturedBoxModel.gltf, {
heightReference : HeightReference.CLAMP_TO_GROUND,
position : Cartesian3.fromDegrees(-72.0, 40.0),
scene : scene,
show : true
}).then(function(model) {
expect(scene.globe.callback).toBeDefined();
scene.renderForSpecs();

primitives.remove(model);
scene.renderForSpecs();
expect(scene.globe.callback).toBeUndefined();
});
});

it('changing the terrain provider', function() {
scene.globe = createMockGlobe();
return loadModelJson(texturedBoxModel.gltf, {
Expand Down Expand Up @@ -2566,5 +2583,4 @@ defineSuite([
});
});
});

}, 'WebGL');
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ var noDevelopmentGallery = taskName === 'release' || taskName === 'makeZipFile';
var buildingRelease = noDevelopmentGallery;
var minifyShaders = taskName === 'minify' || taskName === 'minifyRelease' || taskName === 'release' || taskName === 'makeZipFile' || taskName === 'buildApps';

//travis reports 32 cores but only has 3GB of memory, which causes the VM to run out. Limit to 8 cores instead.
var concurrency = Math.min(os.cpus().length, 8);
var concurrency = yargs.argv.concurrency;
if (!concurrency) {
concurrency = os.cpus().length;
}

//Since combine and minify run in parallel already, split concurrency in half when building both.
//This can go away when gulp 4 comes out because it allows for synchronous tasks.
Expand Down

0 comments on commit 1ccd15b

Please sign in to comment.