Skip to content

Commit

Permalink
Use PropertyBag.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Jan 18, 2017
1 parent d4fdf0b commit 38f875f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 113 deletions.
104 changes: 0 additions & 104 deletions Source/DataSources/ArbitraryProperties.js

This file was deleted.

8 changes: 4 additions & 4 deletions Source/DataSources/CzmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ define([
'../Scene/VerticalOrigin',
'../ThirdParty/Uri',
'../ThirdParty/when',
'./ArbitraryProperties',
'./BillboardGraphics',
'./BoxGraphics',
'./ColorMaterialProperty',
Expand Down Expand Up @@ -128,7 +127,6 @@ define([
VerticalOrigin,
Uri,
when,
ArbitraryProperties,
BillboardGraphics,
BoxGraphics,
ColorMaterialProperty,
Expand Down Expand Up @@ -994,15 +992,17 @@ define([
var propertiesData = packet.properties;
if (defined(propertiesData)) {
if (!defined(entity.properties)) {
entity.properties = new ArbitraryProperties();
entity.properties = new PropertyBag();
}
var key;
//We cannot simply call processPacketData(entity, 'properties', propertyData, undefined, sourceUri, entityCollection)
//because each property of "properties" may vary separately.
//The properties will be accessible as entity.properties.myprop.getValue(time).
for (key in propertiesData) {
if (propertiesData.hasOwnProperty(key)) {
entity.properties.addProperty(key);
if (!entity.properties.hasProperty(key)) {
entity.properties.addProperty(key);
}
processPacketData(Object, entity.properties, key, propertiesData[key], undefined, sourceUri, entityCollection);
}
}
Expand Down
10 changes: 5 additions & 5 deletions Source/DataSources/Entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ define([
'../Core/Matrix4',
'../Core/Quaternion',
'../Core/Transforms',
'./ArbitraryProperties',
'./PropertyBag',
'./BillboardGraphics',
'./BoxGraphics',
'./ConstantPositionProperty',
Expand Down Expand Up @@ -43,7 +43,7 @@ define([
Matrix4,
Quaternion,
Transforms,
ArbitraryProperties,
PropertyBag,
BillboardGraphics,
BoxGraphics,
ConstantPositionProperty,
Expand Down Expand Up @@ -111,7 +111,7 @@ define([
* @param {PointGraphics} [options.point] A point to associate with this entity.
* @param {PolygonGraphics} [options.polygon] A polygon to associate with this entity.
* @param {PolylineGraphics} [options.polyline] A polyline to associate with this entity.
* @param {ArbitraryProperties} [options.properties] Arbitrary properties to associate with this entity.
* @param {PropertyBag} [options.properties] Arbitrary properties to associate with this entity.
* @param {PolylineVolumeGraphics} [options.polylineVolume] A polylineVolume to associate with this entity.
* @param {RectangleGraphics} [options.rectangle] A rectangle to associate with this entity.
* @param {WallGraphics} [options.wall] A wall to associate with this entity.
Expand Down Expand Up @@ -424,9 +424,9 @@ define([
/**
* Gets or sets the bag of arbitrary properties associated with this entity.
* @memberof Entity.prototype
* @type {ArbitraryProperties}
* @type {PropertyBag}
*/
properties : createPropertyTypeDescriptor('properties', ArbitraryProperties),
properties : createPropertyTypeDescriptor('properties', PropertyBag),
/**
* Gets or sets the position.
* @memberof Entity.prototype
Expand Down

0 comments on commit 38f875f

Please sign in to comment.