Skip to content

Commit

Permalink
updated for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbollar committed Apr 20, 2018
2 parents 4a1ba16 + 3b37fab commit 50bc8fe
Show file tree
Hide file tree
Showing 45 changed files with 569 additions and 348 deletions.
10 changes: 7 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ Change Log

### 1.45 - 2018-05-01

##### Breaking Changes :mega:
* `Camera.distanceToBoundingSphere` now returns the signed distance to the bounding sphere. Positive values indicate that the bounding sphere is in the positive half-plane of the camera position and view direction while a negative value indicates it is in the negative half-plane.
##### Deprecated :hourglass_flowing_sand:
* `Particle.size`, `ParticleSystem.rate`, `ParticleSystem.lifeTime`, `ParticleSystem.life`, `ParticleSystem.minimumLife`, and `ParticleSystem.maximumLife` have been renamed to `Particle.imageSize`, `ParticleSystem.emissionRate`, `ParticleSystem.lifetime`, `ParticleSystem.particleLife`, `ParticleSystem.minimumParticleLife`, and `ParticleSystem.maximumParticleLife`. Use of the `size`, `rate`, `lifeTime`, `life`, `minimumLife`, and `maximumLife` parameters is deprecated and will be removed in Cesium 1.46.
* `ParticleSystem.forces` array has been switched out for singular function `ParticleSystems.updateCallback`. Use of the `forces` parameter is deprecated and will be removed in Cesium 1.46.
* Any width and height variables in `ParticleSystem` will no longer be individual components. `ParticleSystem.minimumWidth` and `ParticleSystem.minimumHeight` will now be `ParticleSystem.minimumImageSize`, `ParticleSystem.maximumWidth` and `ParticleSystem.maximumHeight` will now be `ParticleSystem.maximumImageSize`, and `ParticleSystem.width` and `ParticleSystem.height` will now be `ParticleSystem.imageSize`. Use of the `minimumWidth`, `minimumHeight`, `maximumWidth`, `maximumHeight`, `width`, and `height` parameters is deprecated and will be removed in Cesium 1.46.

##### Additions :tada:
* Added option `logDepthBuffer` to `Viewer`. With this option there is typically a single frustum using logarithmic depth rendered. This increases performance by issuing less draw calls to the GPU and helps to avoid artifacts on the connection of two frustums. [#5851](https://github.com/AnalyticalGraphicsInc/cesium/pull/5851)
* Added option `logarithmicDepthBuffer` to `Scene`. With this option there is typically a single frustum using logarithmic depth rendered. This increases performance by issuing less draw calls to the GPU and helps to avoid artifacts on the connection of two frustums. [#5851](https://github.com/AnalyticalGraphicsInc/cesium/pull/5851)
* When a log depth buffer is supported, the frustum near and far planes default to `0.1` and `1e10` respectively.
* Added `Math.log2` to compute the base 2 logarithm of a number.
* Added 'PeliasGeocoderService', which provides geocoding via a [Pelias](https://pelias.io) server.
* Added `GeocodeType` enum and use it as an optional parameter to all `GeocoderService` instances to differentiate between autocomplete and search requests.
* Improved `MapboxImageryProvider` performance by 300% via `tiles.mapbox.com` subdomain switching. [#6426](https://github.com/AnalyticalGraphicsInc/cesium/issues/6426)
* Added ability to invoke `sampleTerrain` from node.js to enable offline terrain sampling
* Added more ParticleSystem Sandcastle examples for rocket and comet tails and weather. [#6375](https://github.com/AnalyticalGraphicsInc/cesium/pull/6375)
* Added color and scale attributes to the `ParticleSystem` class constructor. When defined the variables override startColor and endColor and startScale and endScale. [#6429](https://github.com/AnalyticalGraphicsInc/cesium/pull/6429)

##### Fixes :wrench:
* Fixed bugs in `TimeIntervalCollection.removeInterval`. [#6418](https://github.com/AnalyticalGraphicsInc/cesium/pull/6418).
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Tamar Cohen](https://github.com/tamarmot)
* [Stephen Wiseman](https://github.com/srwiseman)
* [Gabriel Macario](https://github.com/gabriel-macario)
* [Jonathan Puckey](https://github.com/puckey)
4 changes: 0 additions & 4 deletions Source/Core/EllipseGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ define([
'./IndexDatatype',
'./Math',
'./Matrix3',
'./Matrix4',
'./PrimitiveType',
'./Quaternion',
'./Rectangle',
'./Transforms',
'./VertexFormat'
], function(
BoundingSphere,
Expand All @@ -46,11 +44,9 @@ define([
IndexDatatype,
CesiumMath,
Matrix3,
Matrix4,
PrimitiveType,
Quaternion,
Rectangle,
Transforms,
VertexFormat) {
'use strict';

Expand Down
9 changes: 9 additions & 0 deletions Source/Core/FeatureDetection.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ define([
return isFirefox() && firefoxVersionResult;
}

var isNodeJsResult;
function isNodeJs() {
if (!defined(isNodeJsResult)) {
isNodeJsResult = typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]'; // eslint-disable-line
}
return isNodeJsResult;
}

var hasPointerEvents;
function supportsPointerEvents() {
if (!defined(hasPointerEvents)) {
Expand Down Expand Up @@ -230,6 +238,7 @@ define([
isFirefox : isFirefox,
firefoxVersion : firefoxVersion,
isWindows : isWindows,
isNodeJs: isNodeJs,
hardwareConcurrency : defaultValue(theNavigator.hardwareConcurrency, 3),
supportsPointerEvents : supportsPointerEvents,
supportsImageRenderingPixelated: supportsImageRenderingPixelated,
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/GoogleEarthEnterpriseMetadata.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
define([
'../ThirdParty/google-earth-dbroot-parser',
'../ThirdParty/when',
'./appendForwardSlash',
'./Check',
'./Credit',
'./defaultValue',
Expand All @@ -17,7 +16,6 @@ define([
], function(
dbrootParser,
when,
appendForwardSlash,
Check,
Credit,
defaultValue,
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/PlaneOutlineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'./Cartesian3',
'./Check',
'./ComponentDatatype',
'./defaultValue',
'./defined',
'./Geometry',
'./GeometryAttribute',
Expand All @@ -14,7 +13,6 @@ define([
Cartesian3,
Check,
ComponentDatatype,
defaultValue,
defined,
Geometry,
GeometryAttribute,
Expand Down
69 changes: 68 additions & 1 deletion Source/Core/Resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define([
'./defineProperties',
'./deprecationWarning',
'./DeveloperError',
'./FeatureDetection',
'./freezeObject',
'./getAbsoluteUri',
'./getBaseUri',
Expand Down Expand Up @@ -37,6 +38,7 @@ define([
defineProperties,
deprecationWarning,
DeveloperError,
FeatureDetection,
freezeObject,
getAbsoluteUri,
getBaseUri,
Expand Down Expand Up @@ -1428,6 +1430,7 @@ define([
*
* @param {String|Object} options A url or an object with the following properties
* @param {String} options.url The url of the resource.
* @param {Object} [options.data] Data that is posted with the resource.
* @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
* @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
* @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
Expand All @@ -1444,7 +1447,8 @@ define([
return resource.delete({
// Make copy of just the needed fields because headers can be passed to both the constructor and to fetch
responseType: options.responseType,
overrideMimeType: options.overrideMimeType
overrideMimeType: options.overrideMimeType,
data: options.data
});
};

Expand Down Expand Up @@ -1568,6 +1572,7 @@ define([
*
* @param {Object} data Data that is posted with the resource.
* @param {Object} [options] Object with the following properties:
* @param {Object} [options.data] Data that is posted with the resource.
* @param {String} [options.responseType] The type of response. This controls the type of item returned.
* @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
* @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
Expand Down Expand Up @@ -1772,13 +1777,75 @@ define([
image.src = url;
};

function decodeResponse(loadWithHttpResponse, responseType) {
switch (responseType) {
case 'text':
return loadWithHttpResponse.toString('utf8');
case 'json':
return JSON.parse(loadWithHttpResponse.toString('utf8'));
default:
return new Uint8Array(loadWithHttpResponse).buffer;
}
}

function loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType) {
// Note: only the 'json' and 'text' responseTypes transforms the loaded buffer
var URL = require('url').parse(url);
var http = URL.protocol === 'https:' ? require('https') : require('http');
var zlib = require('zlib');
var options = {
protocol : URL.protocol,
hostname : URL.hostname,
port : URL.port,
path : URL.path,
query : URL.query,
method : method,
headers : headers
};

http.request(options)
.on('response', function(res) {
if (res.statusCode < 200 || res.statusCode >= 300) {
deferred.reject(new RequestErrorEvent(res.statusCode, res, res.headers));
return;
}

var chunkArray = [];
res.on('data', function(chunk) {
chunkArray.push(chunk);
});

res.on('end', function() {
var result = Buffer.concat(chunkArray); // eslint-disable-line
if (res.headers['content-encoding'] === 'gzip') {
zlib.gunzip(result, function(error, resultUnzipped) {
if (error) {
deferred.reject(new RuntimeError('Error decompressing response.'));
} else {
deferred.resolve(decodeResponse(resultUnzipped, responseType));
}
});
} else {
deferred.resolve(decodeResponse(result, responseType));
}
});
}).on('error', function(e) {
deferred.reject(new RequestErrorEvent());
}).end();
}

Resource._Implementations.loadWithXhr = function(url, responseType, method, data, headers, deferred, overrideMimeType) {
var dataUriRegexResult = dataUriRegex.exec(url);
if (dataUriRegexResult !== null) {
deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));
return;
}

if (FeatureDetection.isNodeJs()) {
loadWithHttpRequest(url, responseType, method, data, headers, deferred, overrideMimeType);
return;
}

var xhr = new XMLHttpRequest();

if (TrustedServers.contains(url)) {
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/arraySlice.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
define([
'./Check',
'./defaultValue',
'./defined',
'./FeatureDetection'
], function(
Check,
defaultValue,
defined,
FeatureDetection) {
'use strict';
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/buildModuleUrl.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
define([
'../ThirdParty/Uri',
'./defined',
'./DeveloperError',
'./Resource',
'require'
], function(
Uri,
defined,
DeveloperError,
Resource,
Expand Down
16 changes: 14 additions & 2 deletions Source/Core/getAbsoluteUri.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ define([
* var absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
*/
function getAbsoluteUri(relative, base) {
return getAbsoluteUri._implementation(relative, base, document);
var documentObject;
if (typeof document !== 'undefined') {
documentObject = document;
}

return getAbsoluteUri._implementation(relative, base, documentObject);
}

getAbsoluteUri._implementation = function(relative, base, documentObject) {
Expand All @@ -32,7 +37,14 @@ define([
throw new DeveloperError('relative uri is required.');
}
//>>includeEnd('debug');
base = defaultValue(base, defaultValue(documentObject.baseURI, documentObject.location.href));

if (!defined(base)) {
if (typeof documentObject === 'undefined') {
return relative;
}
base = defaultValue(documentObject.baseURI, documentObject.location.href);
}

var baseUri = new Uri(base);
var relativeUri = new Uri(relative);
return relativeUri.resolve(baseUri).toString();
Expand Down
5 changes: 1 addition & 4 deletions Source/Core/getTimestamp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
define([
'./defined'
], function(
defined) {
define(function() {
'use strict';
/*global performance*/

Expand Down
6 changes: 2 additions & 4 deletions Source/Core/sampleTerrain.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
define([
'../ThirdParty/when',
'./Check',
'./defined'
'./Check'
], function(
when,
Check,
defined) {
Check) {
'use strict';

/**
Expand Down
2 changes: 0 additions & 2 deletions Source/DataSources/DataSourceDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ define([
'../Core/defined',
'../Core/defineProperties',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/EventHelper',
'../Scene/GroundPrimitive',
'../Scene/PrimitiveCollection',
Expand All @@ -25,7 +24,6 @@ define([
defined,
defineProperties,
destroyObject,
DeveloperError,
EventHelper,
GroundPrimitive,
PrimitiveCollection,
Expand Down
22 changes: 2 additions & 20 deletions Source/DataSources/DynamicGeometryBatch.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
define([
'../Core/AssociativeArray',
'../Core/Color',
'../Core/ColorGeometryInstanceAttribute',
'../Core/defined',
'../Core/DistanceDisplayCondition',
'../Core/DistanceDisplayConditionGeometryInstanceAttribute',
'../Core/ShowGeometryInstanceAttribute',
'../Scene/Primitive',
'./BoundingSphereState',
'./ColorMaterialProperty',
'./MaterialProperty',
'./Property'
'./BoundingSphereState'
], function(
AssociativeArray,
Color,
ColorGeometryInstanceAttribute,
defined,
DistanceDisplayCondition,
DistanceDisplayConditionGeometryInstanceAttribute,
ShowGeometryInstanceAttribute,
Primitive,
BoundingSphereState,
ColorMaterialProperty,
MaterialProperty,
Property) {
BoundingSphereState) {
'use strict';

/**
Expand Down
2 changes: 0 additions & 2 deletions Source/DataSources/GeometryVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ define([
'../Core/defaultValue',
'../Core/defined',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/Event',
'../Core/EventHelper',
'../Scene/ClassificationType',
Expand Down Expand Up @@ -36,7 +35,6 @@ define([
defaultValue,
defined,
destroyObject,
DeveloperError,
Event,
EventHelper,
ClassificationType,
Expand Down
2 changes: 0 additions & 2 deletions Source/DataSources/PolylineVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ define([
'../Core/Check',
'../Core/defined',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Scene/PolylineColorAppearance',
'../Scene/PolylineMaterialAppearance',
'../Scene/ShadowMode',
Expand All @@ -20,7 +19,6 @@ define([
Check,
defined,
destroyObject,
DeveloperError,
PolylineColorAppearance,
PolylineMaterialAppearance,
ShadowMode,
Expand Down
Loading

0 comments on commit 50bc8fe

Please sign in to comment.