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
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions Source/Core/Cartesian2.js
Original file line number Diff line number Diff line change
@@ -178,8 +178,7 @@ define([
startingIndex = defaultValue(startingIndex, 0);

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

/**
3 changes: 1 addition & 2 deletions Source/Core/Cartesian3.js
Original file line number Diff line number Diff line change
@@ -204,8 +204,7 @@ define([

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

/**
63 changes: 63 additions & 0 deletions Source/Core/Cartesian4.js
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ define([
*
* @see Cartesian2
* @see Cartesian3
* @see Packable
*/
var Cartesian4 = function(x, y, z, w) {
/**
@@ -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
5 changes: 3 additions & 2 deletions Source/Core/Color.js
Original file line number Diff line number Diff line change
@@ -42,6 +42,8 @@ define([
*
* @constructor
* @alias Color
*
* @see Packable
*/
var Color = function(red, green, blue, alpha) {
/**
@@ -259,8 +261,7 @@ define([
array[startingIndex++] = value.red;
array[startingIndex++] = value.green;
array[startingIndex++] = value.blue;
array[startingIndex++] = value.alpha;
return startingIndex;
array[startingIndex] = value.alpha;
};

/**
3 changes: 1 addition & 2 deletions Source/Core/PackableNumber.js
Original file line number Diff line number Diff line change
@@ -27,8 +27,7 @@ define([

startingIndex = defaultValue(startingIndex, 0);

array[startingIndex++] = value;
return startingIndex;
array[startingIndex] = value;
},

unpack : function(array, startingIndex, result) {
5 changes: 3 additions & 2 deletions Source/Core/Quaternion.js
Original file line number Diff line number Diff line change
@@ -26,6 +26,8 @@ define([
* @param {Number} [y=0.0] The Y component.
* @param {Number} [z=0.0] The Z component.
* @param {Number} [w=0.0] The W component.
*
* @see PackableForInterpolation
*/
var Quaternion = function(x, y, z, w) {
/**
@@ -211,8 +213,7 @@ define([
array[startingIndex++] = value.x;
array[startingIndex++] = value.y;
array[startingIndex++] = value.z;
array[startingIndex++] = value.w;
return startingIndex;
array[startingIndex] = value.w;
};

/**
8 changes: 6 additions & 2 deletions Specs/Core/Cartesian2Spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/*global defineSuite*/
defineSuite([
'Core/Cartesian2',
'Core/Math'
'Core/Math',
'Specs/createPackableSpecs'
], function(
Cartesian2,
CesiumMath) {
CesiumMath,
createPackableSpecs) {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/

@@ -629,4 +631,6 @@ defineSuite([
var expectedResult = new Cartesian2(2, 2);
expect(cartesian2).toEqual(expectedResult);
});

createPackableSpecs(Cartesian2, new Cartesian2(1, 2), [1, 2]);
});
10 changes: 7 additions & 3 deletions Specs/Core/Cartesian3Spec.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/*global defineSuite*/
defineSuite([
'Core/Cartesian3',
'Core/Math'
'Core/Math',
'Specs/createPackableSpecs'
], function(
Cartesian3,
CesiumMath) {
Cartesian3,
CesiumMath,
createPackableSpecs) {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/

@@ -713,4 +715,6 @@ defineSuite([
var expectedResult = new Cartesian3(2, 2, 4);
expect(cartesian3).toEqual(expectedResult);
});

createPackableSpecs(Cartesian3, new Cartesian3(1, 2, 3), [1, 2, 3]);
});
8 changes: 6 additions & 2 deletions Specs/Core/Cartesian4Spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/*global defineSuite*/
defineSuite([
'Core/Cartesian4'
'Core/Cartesian4',
'Specs/createPackableSpecs'
], function(
Cartesian4) {
Cartesian4,
createPackableSpecs) {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/

@@ -633,4 +635,6 @@ defineSuite([
var expectedResult = new Cartesian4(2, 2, 4, 7);
expect(cartesian4).toEqual(expectedResult);
});

createPackableSpecs(Cartesian4, new Cartesian4(1, 2, 3, 4), [1, 2, 3, 4]);
});
8 changes: 6 additions & 2 deletions Specs/Core/ColorSpec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/*global defineSuite*/
defineSuite(['Core/Color',
'Core/Math'
'Core/Math',
'Specs/createPackableSpecs'
], function(
Color,
CesiumMath) {
CesiumMath,
createPackableSpecs) {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/

@@ -242,4 +244,6 @@ defineSuite(['Core/Color',
var newRgba = newColor.toRgba();
expect(rgba).toEqual(newRgba);
});

createPackableSpecs(Color, new Color(0.1, 0.2, 0.3, 0.4), [0.1, 0.2, 0.3, 0.4]);
});
9 changes: 6 additions & 3 deletions Specs/Core/QuaternionSpec.js
Original file line number Diff line number Diff line change
@@ -3,12 +3,14 @@ defineSuite([
'Core/Quaternion',
'Core/Cartesian3',
'Core/Math',
'Core/Matrix3'
'Core/Matrix3',
'Specs/createPackableSpecs'
], function(
Quaternion,
Cartesian3,
CesiumMath,
Matrix3) {
Matrix3,
createPackableSpecs) {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/

@@ -758,5 +760,6 @@ defineSuite([
Quaternion.equalsEpsilon(new Quaternion(), new Quaternion(), undefined);
}).toThrow();
});
});

createPackableSpecs(Quaternion, new Quaternion(1, 2, 3, 4), [1, 2, 3, 4]);
});
3 changes: 1 addition & 2 deletions Specs/DynamicScene/SampledPropertySpec.js
Original file line number Diff line number Diff line change
@@ -66,8 +66,7 @@ defineSuite([
CustomType.packedInterpolationLength = 2;

CustomType.pack = function(value, array, startingIndex) {
array[startingIndex++] = value.x;
return startingIndex;
array[startingIndex] = value.x;
};

CustomType.unpack = function(array, startingIndex, result) {
53 changes: 53 additions & 0 deletions Specs/createPackableSpecs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*global define*/
define(function() {
"use strict";
/*global jasmine,describe,xdescribe,it,xit,expect,beforeEach,afterEach,beforeAll,afterAll,spyOn,runs,waits,waitsFor*/

function createPackableSpecs(packable, instance, packedInstance) {
it('can pack', function() {
var packedArray = [];
packable.pack(instance, packedArray);
expect(packedArray.length).toEqual(packable.packedLength);
expect(packedArray).toEqual(packedInstance);
});

it('can unpack', function() {
var result = packable.unpack(packedInstance);
expect(result).toEqual(instance);
});

it('can pack with startingIndex', function() {
var packedArray = [0];
var expected = packedArray.concat(packedInstance);
packable.pack(instance, packedArray, 1);
expect(packedArray).toEqual(expected);
});

it('can unpack with startingIndex', function() {
var packedArray = [0].concat(packedInstance);
var result = packable.unpack(packedArray, 1);
expect(instance).toEqual(result);
});

it('pack throws with undefined value', function() {
var array = [];
expect(function() {
packable.pack(undefined, array);
}).toThrow();
});

it('pack throws with undefined array', function() {
expect(function() {
packable.pack(instance, undefined);
}).toThrow();
});

it('unpack throws with undefined array', function() {
expect(function() {
packable.unpack(undefined);
}).toThrow();
});
}

return createPackableSpecs;
});