Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DyanmicScene Properties #1080

Merged
merged 93 commits into from
Aug 29, 2013
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
000e6ba
DynamicPositionProperty and DynamicVertexPositionsProperty cleanup
mramato Jun 21, 2013
1bf2157
Merge branch 'geojson' into dynamicScene-cleanup
mramato Jun 21, 2013
81e2be0
Merge branch 'geojson' into dynamicScene-cleanup
mramato Jun 24, 2013
5260bde
Merge branch 'geojson' into dynamicScene-cleanup
mramato Jun 24, 2013
ebdf1a4
Remove getValueSpherical and make it the default result of getValue f…
mramato Jun 24, 2013
d501fcb
Merge branch 'master' into dynamicScene-cleanup
mramato Jun 24, 2013
3242803
Some boilerplate code for a new property system that's not at all rea…
mramato Jun 27, 2013
e712d0d
Merge branch 'master' into dynamicScene-cleanup
mramato Jul 10, 2013
fe597df
More Property prototyping.
mramato Jul 11, 2013
a89f2ef
Merge branch 'master' into dynamicScene-cleanup
mramato Jul 11, 2013
32394ca
Merge branch 'master' into dynamicScene-cleanup
mramato Jul 29, 2013
958aae1
Specs for ConstantProperty and TimeIntervalCollectionProperty.
mramato Jul 30, 2013
e12c104
Merge branch 'master' into dynamicScene-cleanup
mramato Jul 30, 2013
9af1532
Add a simple CompositeProperty
mramato Jul 30, 2013
9f00ea8
Start of SampledProperty, no where near done.
mramato Jul 30, 2013
cbfe74d
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 6, 2013
6f9d62d
Ongoing SampledProperty work.
mramato Aug 6, 2013
d457ff6
Start major overhaul of CZML processing to use new property system.
mramato Aug 8, 2013
13ae99b
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 8, 2013
393236a
Remove almost all DynamicProperty usage.
mramato Aug 8, 2013
b576cc7
Ongoing Property work.
mramato Aug 12, 2013
62cbcfd
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 13, 2013
13bc5c9
Update new code to use `defined`
mramato Aug 13, 2013
b90ecd4
Remove `DynamicPoperty` and related specs.
mramato Aug 13, 2013
01194be
Ongoing property work
mramato Aug 13, 2013
04ae4c0
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 13, 2013
5a9cc33
Ongoing CZML cleanup
mramato Aug 13, 2013
cedc72a
Get rid of all CzmlXXXX types.
mramato Aug 14, 2013
3619d0e
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 14, 2013
baf7a02
Rename length to packedLength and other minor cleanup.
mramato Aug 14, 2013
a1ce45a
Fix and clarify `mergeNewSamples`.
mramato Aug 14, 2013
81df997
Start of settable interpolation algorithm for SampledProperty.
mramato Aug 14, 2013
178bbc9
Add getter/setter for SampledProperty interpolation algorithm
mramato Aug 15, 2013
b3ee399
Have Property implementaions use ES5 properties.
mramato Aug 15, 2013
7711dcf
Add position properties.
mramato Aug 15, 2013
6f01113
Start fleshing out position processing.
mramato Aug 15, 2013
c412d84
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 15, 2013
7966abc
Fix Path visualization.
mramato Aug 15, 2013
8b3df8c
Fix minor issue with path sampling and position packets.
mramato Aug 15, 2013
724a66c
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 15, 2013
8d6ace7
Flesh out property specs and fix some bugs found in doing so.
mramato Aug 16, 2013
8910267
Specs for ConstantPositionProperty.
mramato Aug 16, 2013
c73ae04
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 19, 2013
edaa098
Doc and cleanup.
mramato Aug 19, 2013
fd4db23
Specs for Packable implementations
mramato Aug 19, 2013
9332eea
Start refactoring DynamicScene material handling
mramato Aug 19, 2013
1b56273
Merge branch 'master' into dynamicScene-cleanup
mramato Aug 19, 2013
cfc4a20
Ongoing material refactor.
mramato Aug 20, 2013
7d1a22a
Delete DynamicMaterialProperty.js
mramato Aug 20, 2013
68353a2
Consolidate most (all?) CZML processing into CzmlDataSource.
mramato Aug 20, 2013
39727d3
Put back file I accidentally deleted.
mramato Aug 20, 2013
301977b
Move all CZML specs into CzmlDataSourceSpec.js
mramato Aug 20, 2013
cc5c7f9
Merge branch 'master' into dynamicScene-properties
mramato Aug 21, 2013
f7ccbbf
Delete MockProperty
mramato Aug 21, 2013
4ac6bee
Specs for CompositePositionProperty
mramato Aug 21, 2013
cd965d3
TimeIntervalCollectionPositionProperty specs
mramato Aug 21, 2013
a2d046c
Specs for SampledPositionProperty and other cleanup.
mramato Aug 21, 2013
ba22d00
Fix CZML processing after recent property changes.
mramato Aug 21, 2013
9ef60ca
Merge branch 'master' into dynamicScene-properties
mramato Aug 21, 2013
453f55a
Fix DynamicPathVisualizer specs and add fallback for generic sampling…
mramato Aug 21, 2013
fe86ec5
Handle all property types.
mramato Aug 21, 2013
2f86f64
Remove delete `CzmlDefaults`.
mramato Aug 22, 2013
dd4f2a7
Fix some broken specs
mramato Aug 22, 2013
d2b65c4
Refactoring DynamicScene Material support.
mramato Aug 22, 2013
923d85b
Merge branch 'master' into dynamicScene-properties
mramato Aug 22, 2013
4469079
Merge branch 'master' into dynamicScene-properties
mramato Aug 23, 2013
10d3ebb
Misc fixes.
mramato Aug 23, 2013
830bbc2
Tweak Material properties.
mramato Aug 23, 2013
eb996a5
ColorMaterialProperty specs
mramato Aug 23, 2013
ca363bc
Material property specs.
mramato Aug 23, 2013
153f356
Merge branch 'master' into dynamicScene-properties
mramato Aug 24, 2013
1959583
Fix remaining spec failures.
mramato Aug 24, 2013
0c272fe
Remove `isTimeVarying` from Property objects since we're not using it…
mramato Aug 24, 2013
506d0c6
Clean up module imports.
mramato Aug 26, 2013
1f883bc
Document top-level Property implementations.
mramato Aug 26, 2013
e6c82dc
Finish Property documentation.
mramato Aug 26, 2013
54f49f2
Merge branch 'master' into dynamicScene-properties
mramato Aug 26, 2013
83da53d
Fix copy/paste error.
mramato Aug 26, 2013
440a573
Clean up doc for Dynamic objects.
mramato Aug 26, 2013
17b81e1
Remove `CzmlDataSource.processCzml` as it's no longer needed.
mramato Aug 26, 2013
b817bcb
Update CHANGES
mramato Aug 26, 2013
e801dd5
Fix bad markdown.
mramato Aug 26, 2013
acede72
Merge branch 'master' into dynamicScene-properties
mramato Aug 27, 2013
8a8e07d
Changes after review.
mramato Aug 27, 2013
69b098c
Minor whitespace cleanup.
shunter Aug 27, 2013
210359b
Rename `SampledProperty._updateTables` to `SampledProperty._updateTab…
mramato Aug 27, 2013
34c1a5b
Merge branch 'master' into dynamicScene-properties
mramato Aug 28, 2013
9d40815
modify CHANGES so everything is in the b20 release
mramato Aug 28, 2013
21558ab
Fix documentation build.
mramato Aug 29, 2013
68a95e8
Merge branch 'master' into dynamicScene-properties
mramato Aug 29, 2013
48581d9
Merge branch 'master' into dynamicScene-properties
mramato Aug 29, 2013
b7a000d
Fix CHANGES after merge.
mramato Aug 29, 2013
84ee687
Merge branch 'master' into dynamicScene-properties
mramato Aug 29, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ Change Log
Beta Releases
-------------

### b21 - 2013-10-01
* Breaking changes:
* Removed `processCzml`, use `CzmlDataSource` instead.
* Completely refactored the `DynamicScene` property system to vastly improve the API. See [#1080](https://github.com/AnalyticalGraphicsInc/cesium/pull/1080) for complete details.
* Removed `CzmlBoolean`, `CzmlCartesian2`, `CzmlCartesian3`, `CzmlColor`, `CzmlDefaults`, `CzmlDirection`, `CzmlHorizontalOrigin`, `CzmlImage`, `CzmlLabelStyle`, `CzmlNumber`, `CzmlPosition`, `CzmlString`, `CzmlUnitCartesian3`, `CzmlUnitQuaternion`, `CzmlUnitSpherical`, and `CzmlVerticalOrigin` since they are no longer needed.
* Removed `DynamicProperty`, `DynamicMaterialProperty`, `DynamicDirectionsProperty`, and `DynamicVertexPositionsProperty`; replacing them with an all new system of properties.
* `Property` - base interface for all properties.
* `CompositeProperty` - a property composed of other properties.
* `ConstantProperty` - a property whose value never changes.
* `SampledProperty` - a property whose value is interpolated from a set of samples.
* `TimeIntervalCollectionProperty` - a property whose value changes based on time interval.
* `MaterialProperty` - base interface for all material properties.
* `CompositeMaterialProperty` - a `CompositeProperty` for materials.
* `ColorMaterialProperty` - a property that maps to a color material. (replaces `DynamicColorMaterial`)
* `GridMaterialProperty` - a property that maps to a grid material. (replaces `DynamicGridMaterial`)
* `ImageMaterialProperty` - a property that maps to an image material. (replaces `DynamicImageMaterial`)
* `PositionProperty`- base interface for all position properties.
* `CompositePositionProperty` - a `CompositeProperty` for positions.
* `ConstantPositionProperty` - a `PositionProperty` whose value does not change in respect to the `ReferenceFrame` in which is it defined.
* `SampledPositionProperty` - a `SampledProperty` for positions.
* `TimeIntervalCollectionPositionProperty` - A `TimeIntervalCollectionProperty` for positions.
* Added `Packable` and `PackableForInterpolation` interfaces to aid interpolation and in-memory data storage. Also made most core Cesium types implement them.
* Added `InterpolationAlgorithm` interface to codify the base interface already being used by `LagrangePolynomialApproximation`, `LinearApproximation`, and `HermitePolynomialApproximation`.

### b20 - 2013-09-03

_This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https://github.com/AnalyticalGraphicsInc/cesium/issues/1002) and [#1047](https://github.com/AnalyticalGraphicsInc/cesium/issues/1047))._
Expand Down
58 changes: 58 additions & 0 deletions Source/Core/Cartesian2.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ define([
* @param {Number} [x=0.0] The X component.
* @param {Number} [y=0.0] The Y component.
*
* @see Packable
* @see Cartesian3
* @see Cartesian4
*/
Expand Down Expand Up @@ -148,6 +149,63 @@ define([
*/
Cartesian2.fromCartesian4 = Cartesian2.clone;

/**
* The number of elements used to pack the object into an array.
* @Type {Number}
*/
Cartesian2.packedLength = 2;

/**
* Stores the provided instance into the provided array.
* @memberof Cartesian2
*
* @param {Cartesian2} value The value to pack.
* @param {Array} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @exception {DeveloperError} value is required.
* @exception {DeveloperError} array is required.
*/
Cartesian2.pack = function(value, array, startingIndex) {
if (!defined(value)) {
throw new DeveloperError('value is required');
}

if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

array[startingIndex++] = value.x;
array[startingIndex] = value.y;
};

/**
* Retrieves an instance from a packed array.
* @memberof Cartesian2
*
* @param {Array} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {Cartesian2} [result] The object into which to store the result.
*
* @exception {DeveloperError} array is required.
*/
Cartesian2.unpack = function(array, startingIndex, result) {
if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

if (!defined(result)) {
result = new Cartesian2();
}
result.x = array[startingIndex++];
result.y = array[startingIndex];
return result;
};

/**
* Computes the value of the maximum component for the supplied Cartesian.
* @memberof Cartesian2
Expand Down
60 changes: 60 additions & 0 deletions Source/Core/Cartesian3.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ define([
*
* @see Cartesian2
* @see Cartesian4
* @see Packable
*/
var Cartesian3 = function(x, y, z) {
/**
Expand Down Expand Up @@ -173,6 +174,65 @@ define([
*/
Cartesian3.fromCartesian4 = Cartesian3.clone;

/**
* The number of elements used to pack the object into an array.
* @Type {Number}
*/
Cartesian3.packedLength = 3;

/**
* Stores the provided instance into the provided array.
* @memberof Cartesian3
*
* @param {Cartesian3} value The value to pack.
* @param {Array} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @exception {DeveloperError} value is required.
* @exception {DeveloperError} array is required.
*/
Cartesian3.pack = function(value, array, startingIndex) {
if (!defined(value)) {
throw new DeveloperError('value is required');
}

if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

array[startingIndex++] = value.x;
array[startingIndex++] = value.y;
array[startingIndex] = value.z;
};

/**
* Retrieves an instance from a packed array.
* @memberof Cartesian3
*
* @param {Array} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {Cartesian3} [result] The object into which to store the result.
*
* @exception {DeveloperError} array is required.
*/
Cartesian3.unpack = function(array, startingIndex, result) {
if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

if (!defined(result)) {
result = new Cartesian3();
}
result.x = array[startingIndex++];
result.y = array[startingIndex++];
result.z = array[startingIndex];
return result;
};

/**
* Computes the value of the maximum component for the supplied Cartesian.
* @memberof Cartesian3
Expand Down
63 changes: 63 additions & 0 deletions Source/Core/Cartesian4.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ define([
*
* @see Cartesian2
* @see Cartesian3
* @see Packable
*/
var Cartesian4 = function(x, y, z, w) {
/**
Expand Down Expand Up @@ -145,6 +146,68 @@ define([
return result;
};


/**
* The number of elements used to pack the object into an array.
* @Type {Number}
*/
Cartesian4.packedLength = 4;

/**
* Stores the provided instance into the provided array.
* @memberof Cartesian4
*
* @param {Cartesian4} value The value to pack.
* @param {Array} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @exception {DeveloperError} value is required.
* @exception {DeveloperError} array is required.
*/
Cartesian4.pack = function(value, array, startingIndex) {
if (!defined(value)) {
throw new DeveloperError('value is required');
}

if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

array[startingIndex++] = value.x;
array[startingIndex++] = value.y;
array[startingIndex++] = value.z;
array[startingIndex] = value.w;
};

/**
* Retrieves an instance from a packed array.
* @memberof Cartesian4
*
* @param {Array} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {Cartesian4} [result] The object into which to store the result.
*
* @exception {DeveloperError} array is required.
*/
Cartesian4.unpack = function(array, startingIndex, result) {
if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

if (!defined(result)) {
result = new Cartesian4();
}
result.x = array[startingIndex++];
result.y = array[startingIndex++];
result.z = array[startingIndex++];
result.w = array[startingIndex];
return result;
};

/**
* Computes the value of the maximum component for the supplied Cartesian.
* @memberof Cartesian4
Expand Down
63 changes: 63 additions & 0 deletions Source/Core/Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ define([
*
* @constructor
* @alias Color
*
* @see Packable
*/
var Color = function(red, green, blue, alpha) {
/**
Expand Down Expand Up @@ -330,6 +332,67 @@ define([
return undefined;
};

/**
* The number of elements used to pack the object into an array.
* @Type {Number}
*/
Color.packedLength = 4;

/**
* Stores the provided instance into the provided array.
* @memberof Color
*
* @param {Color} value The value to pack.
* @param {Array} array The array to pack into.
* @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
*
* @exception {DeveloperError} value is required.
* @exception {DeveloperError} array is required.
*/
Color.pack = function(value, array, startingIndex) {
if (!defined(value)) {
throw new DeveloperError('value is required');
}

if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

array[startingIndex++] = value.red;
array[startingIndex++] = value.green;
array[startingIndex++] = value.blue;
array[startingIndex] = value.alpha;
};

/**
* Retrieves an instance from a packed array.
* @memberof Color
*
* @param {Array} array The packed array.
* @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
* @param {Color} [result] The object into which to store the result.
*
* @exception {DeveloperError} array is required.
*/
Color.unpack = function(array, startingIndex, result) {
if (!defined(array)) {
throw new DeveloperError('array is required');
}

startingIndex = defaultValue(startingIndex, 0);

if (!defined(result)) {
result = new Color();
}
result.red = array[startingIndex++];
result.green = array[startingIndex++];
result.blue = array[startingIndex++];
result.alpha = array[startingIndex];
return result;
};

/**
* Converts a 'byte' color component in the range of 0 to 255 into
* a 'float' color component in the range of 0 to 1.0.
Expand Down
57 changes: 57 additions & 0 deletions Source/Core/InterpolationAlgorithm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*global define*/
define(['./DeveloperError'], function(DeveloperError) {
"use strict";

/**
* The interface for interpolation algorithms.
* @exports InterpolationAlgorithm
*
* @see LagrangePolynomialApproximation
* @see LinearApproximation
* @see HermitePolynomialApproximation
*/
var InterpolationAlgorithm = {};

/**
* Gets the name of this interpolation algorithm.
* @type {String}
*/
InterpolationAlgorithm.type = undefined;

/**
* Given the desired degree, returns the number of data points required for interpolation.
* @memberof InterpolationAlgorithm
*
* @param degree The desired degree of interpolation.
*
* @returns The number of required data points needed for the desired degree of interpolation.
*/
InterpolationAlgorithm.getRequiredDataPoints = function(degree) {
throw new DeveloperError('This function defines an interface and should not be called directly.');
};

/**
* Interpolates values.
* @memberof InterpolationAlgorithm
*
* @param {Number} x The independent variable for which the dependent variables will be interpolated.
*
* @param {Array} xTable The array of independent variables to use to interpolate. The values
* in this array must be in increasing order and the same value must not occur twice in the array.
*
* @param {Array} yTable The array of dependent variables to use to interpolate. For a set of three
* dependent values (p,q,w) at time 1 and time 2 this should be as follows: {p1, q1, w1, p2, q2, w2}.
*
* @param {Number} yStride The number of dependent variable values in yTable corresponding to
* each independent variable value in xTable.
*
* @param {Array} [result] An existing array into which to store the result.
*
* @returns The array of interpolated values, or the result parameter if one was provided.
*/
InterpolationAlgorithm.interpolateOrderZero = function(x, xTable, yTable, yStride, result) {
throw new DeveloperError('This function defines an interface and should not be called directly.');
};

return InterpolationAlgorithm;
});
Loading