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

Reorder code in entity layer to have consistent order of properties. #7899

Merged
merged 4 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log

##### Additions :tada:
* Added support for the [AGI_articulations](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations) vendor extension of glTF 2.0 to the Entity API and CZML. [#7907](https://github.com/AnalyticalGraphicsInc/cesium/pull/7907)
* Added CZML support for `heightReference` to `box`, `cylinder`, and `ellipsoid`, and added CZML support for `classificationType` to `corridor`, `ellipse`, `polygon`, `polyline`, and `rectangle`. [#7899](https://github.com/AnalyticalGraphicsInc/cesium/pull/7899)

##### Fixes :wrench:
* Fixed a bug that caused missing segments for ground polylines with coplanar points over large distances and problems with polylines containing duplicate points. [#7885](https://github.com/AnalyticalGraphicsInc/cesium//pull/7885)
Expand Down
216 changes: 108 additions & 108 deletions Source/DataSources/BillboardGraphics.js

Large diffs are not rendered by default.

49 changes: 25 additions & 24 deletions Source/DataSources/BoxGraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ define([
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.heightReference] A Property specifying what the height from the entity position is relative to.
* @param {Property} [options.dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box.
* @param {Property} [options.show=true] A boolean Property specifying the visibility of the box.
* @param {Property} [options.dimensions] A {@link Cartesian3} Property specifying the length, width, and height of the box.
* @param {Property} [options.heightReference] A Property specifying what the height from the entity position is relative to.
* @param {Property} [options.fill=true] A boolean Property specifying whether the box is filled with the provided material.
* @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the box.
* @param {Property} [options.outline=false] A boolean Property specifying whether the box is outlined.
Expand All @@ -37,11 +37,13 @@ define([
* @demo {@link https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Box.html|Cesium Sandcastle Box Demo}
*/
function BoxGraphics(options) {
this._heightReference = undefined;
this._dimensions = undefined;
this._dimensionsSubscription = undefined;
this._definitionChanged = new Event();
this._show = undefined;
this._showSubscription = undefined;
this._dimensions = undefined;
this._dimensionsSubscription = undefined;
this._heightReference = undefined;
this._heightReferenceSubscription = undefined;
this._fill = undefined;
this._fillSubscription = undefined;
this._material = undefined;
Expand All @@ -56,7 +58,6 @@ define([
this._shadowsSubscription = undefined;
this._distanceDisplayCondition = undefined;
this._distanceDisplayConditionSubscription = undefined;
this._definitionChanged = new Event();

this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
Expand All @@ -74,14 +75,6 @@ define([
}
},

/**
* Gets or sets the Property specifying the {@link HeightReference}.
* @memberof BoxGraphics.prototype
* @type {Property}
* @default HeightReference.NONE
*/
heightReference : createPropertyDescriptor('heightReference'),

/**
* Gets or sets the boolean Property specifying the visibility of the box.
* @memberof BoxGraphics.prototype
Expand All @@ -98,12 +91,12 @@ define([
dimensions : createPropertyDescriptor('dimensions'),

/**
* Gets or sets the material used to fill the box.
* Gets or sets the Property specifying the {@link HeightReference}.
* @memberof BoxGraphics.prototype
* @type {MaterialProperty}
* @default Color.WHITE
* @type {Property}
* @default HeightReference.NONE
*/
material : createMaterialPropertyDescriptor('material'),
heightReference : createPropertyDescriptor('heightReference'),

/**
* Gets or sets the boolean Property specifying whether the box is filled with the provided material.
Expand All @@ -113,6 +106,14 @@ define([
*/
fill : createPropertyDescriptor('fill'),

/**
* Gets or sets the material used to fill the box.
* @memberof BoxGraphics.prototype
* @type {MaterialProperty}
* @default Color.WHITE
*/
material : createMaterialPropertyDescriptor('material'),

/**
* Gets or sets the Property specifying whether the box is outlined.
* @memberof BoxGraphics.prototype
Expand Down Expand Up @@ -164,11 +165,11 @@ define([
if (!defined(result)) {
return new BoxGraphics(this);
}
result.heightReference = this.heightReference;
result.dimensions = this.dimensions;
result.show = this.show;
result.material = this.material;
result.dimensions = this.dimensions;
result.heightReference = this.heightReference;
result.fill = this.fill;
result.material = this.material;
result.outline = this.outline;
result.outlineColor = this.outlineColor;
result.outlineWidth = this.outlineWidth;
Expand All @@ -190,11 +191,11 @@ define([
}
//>>includeEnd('debug');

this.heightReference = defaultValue(this.heightReference, source.heightReference);
this.dimensions = defaultValue(this.dimensions, source.dimensions);
this.show = defaultValue(this.show, source.show);
this.material = defaultValue(this.material, source.material);
this.dimensions = defaultValue(this.dimensions, source.dimensions);
this.heightReference = defaultValue(this.heightReference, source.heightReference);
this.fill = defaultValue(this.fill, source.fill);
this.material = defaultValue(this.material, source.material);
this.outline = defaultValue(this.outline, source.outline);
this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);
this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);
Expand Down
7 changes: 4 additions & 3 deletions Source/DataSources/CheckerboardMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,10 @@ define([
options = defaultValue(options, defaultValue.EMPTY_OBJECT);

this._definitionChanged = new Event();

this._evenColor = undefined;
this._evenColorSubscription = undefined;

this._oddColor = undefined;
this._oddColorSubscription = undefined;

this._repeat = undefined;
this._repeatSubscription = undefined;

Expand All @@ -67,6 +64,7 @@ define([
Property.isConstant(this._repeat);
}
},

/**
* Gets the event that is raised whenever the definition of this property changes.
* The definition is considered to have changed if a call to getValue would return
Expand All @@ -81,20 +79,23 @@ define([
return this._definitionChanged;
}
},

/**
* Gets or sets the Property specifying the first {@link Color}.
* @memberof CheckerboardMaterialProperty.prototype
* @type {Property}
* @default Color.WHITE
*/
evenColor : createPropertyDescriptor('evenColor'),

/**
* Gets or sets the Property specifying the second {@link Color}.
* @memberof CheckerboardMaterialProperty.prototype
* @type {Property}
* @default Color.BLACK
*/
oddColor : createPropertyDescriptor('oddColor'),

/**
* Gets or sets the {@link Cartesian2} Property specifying how many times the tiles repeat in each direction.
* @memberof CheckerboardMaterialProperty.prototype
Expand Down
3 changes: 3 additions & 0 deletions Source/DataSources/ColorMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define([
this._definitionChanged = new Event();
this._color = undefined;
this._colorSubscription = undefined;

this.color = color;
}

Expand All @@ -43,6 +44,7 @@ define([
return Property.isConstant(this._color);
}
},

/**
* Gets the event that is raised whenever the definition of this property changes.
* The definition is considered to have changed if a call to getValue would return
Expand All @@ -57,6 +59,7 @@ define([
return this._definitionChanged;
}
},

/**
* Gets or sets the {@link Color} {@link Property}.
* @memberof ColorMaterialProperty.prototype
Expand Down
70 changes: 35 additions & 35 deletions Source/DataSources/CorridorGraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ define([
* @constructor
*
* @param {Object} [options] Object with the following properties:
* @param {Property} [options.show=true] A boolean Property specifying the visibility of the corridor.
* @param {Property} [options.positions] A Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
* @param {Property} [options.width] A numeric Property specifying the distance between the edges of the corridor.
* @param {Property} [options.cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners.
* @param {Property} [options.height=0] A numeric Property specifying the altitude of the corridor relative to the ellipsoid surface.
* @param {Property} [options.heightReference] A Property specifying what the height is relative to.
* @param {Property} [options.extrudedHeight] A numeric Property specifying the altitude of the corridor's extruded face relative to the ellipsoid surface.
* @param {Property} [options.extrudedHeightReference] A Property specifying what the extrudedHeight is relative to.
* @param {Property} [options.show=true] A boolean Property specifying the visibility of the corridor.
* @param {Property} [options.cornerType=CornerType.ROUNDED] A {@link CornerType} Property specifying the style of the corners.
* @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude.
* @param {Property} [options.fill=true] A boolean Property specifying whether the corridor is filled with the provided material.
* @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to fill the corridor.
* @param {Property} [options.outline=false] A boolean Property specifying whether the corridor is outlined.
* @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.
* @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline.
* @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the distance between each latitude and longitude.
* @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the corridor casts or receives shadows from each light source.
* @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this corridor will be displayed.
* @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this corridor will classify terrain, 3D Tiles, or both when on the ground.
Expand All @@ -48,12 +48,13 @@ define([
* @demo {@link https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}
*/
function CorridorGraphics(options) {
this._definitionChanged = new Event();
this._show = undefined;
this._showSubscription = undefined;
this._material = undefined;
this._materialSubscription = undefined;
this._positions = undefined;
this._positionsSubscription = undefined;
this._width = undefined;
this._widthSubscription = undefined;
this._height = undefined;
this._heightSubscription = undefined;
this._heightReference = undefined;
Expand All @@ -62,14 +63,14 @@ define([
this._extrudedHeightSubscription = undefined;
this._extrudedHeightReference = undefined;
this._extrudedHeightReferenceSubscription = undefined;
this._granularity = undefined;
this._granularitySubscription = undefined;
this._width = undefined;
this._widthSubscription = undefined;
this._cornerType = undefined;
this._cornerTypeSubscription = undefined;
this._granularity = undefined;
this._granularitySubscription = undefined;
this._fill = undefined;
this._fillSubscription = undefined;
this._material = undefined;
this._materialSubscription = undefined;
this._outline = undefined;
this._outlineSubscription = undefined;
this._outlineColor = undefined;
Expand All @@ -84,7 +85,6 @@ define([
this._classificationTypeSubscription = undefined;
this._zIndex = undefined;
this._zIndexSubscription = undefined;
this._definitionChanged = new Event();

this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
}
Expand All @@ -111,19 +111,18 @@ define([
show : createPropertyDescriptor('show'),

/**
* Gets or sets the Property specifying the material used to fill the corridor.
* Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
* @memberof CorridorGraphics.prototype
* @type {MaterialProperty}
* @default Color.WHITE
* @type {Property}
*/
material : createMaterialPropertyDescriptor('material'),
positions : createPropertyDescriptor('positions'),

/**
* Gets or sets a Property specifying the array of {@link Cartesian3} positions that define the centerline of the corridor.
* Gets or sets the numeric Property specifying the width of the corridor.
* @memberof CorridorGraphics.prototype
* @type {Property}
*/
positions : createPropertyDescriptor('positions'),
width : createPropertyDescriptor('width'),

/**
* Gets or sets the numeric Property specifying the altitude of the corridor.
Expand Down Expand Up @@ -159,19 +158,20 @@ define([
extrudedHeightReference : createPropertyDescriptor('extrudedHeightReference'),

/**
* Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
* Gets or sets the {@link CornerType} Property specifying how corners are styled.
* @memberof CorridorGraphics.prototype
* @type {Property}
* @default {CesiumMath.RADIANS_PER_DEGREE}
* @default CornerType.ROUNDED
*/
granularity : createPropertyDescriptor('granularity'),
cornerType : createPropertyDescriptor('cornerType'),

/**
* Gets or sets the numeric Property specifying the width of the corridor.
* Gets or sets the numeric Property specifying the sampling distance between each latitude and longitude point.
* @memberof CorridorGraphics.prototype
* @type {Property}
* @default {CesiumMath.RADIANS_PER_DEGREE}
*/
width : createPropertyDescriptor('width'),
granularity : createPropertyDescriptor('granularity'),

/**
* Gets or sets the boolean Property specifying whether the corridor is filled with the provided material.
Expand All @@ -181,6 +181,14 @@ define([
*/
fill : createPropertyDescriptor('fill'),

/**
* Gets or sets the Property specifying the material used to fill the corridor.
* @memberof CorridorGraphics.prototype
* @type {MaterialProperty}
* @default Color.WHITE
*/
material : createMaterialPropertyDescriptor('material'),

/**
* Gets or sets the Property specifying whether the corridor is outlined.
* @memberof CorridorGraphics.prototype
Expand All @@ -205,14 +213,6 @@ define([
*/
outlineWidth : createPropertyDescriptor('outlineWidth'),

/**
* Gets or sets the {@link CornerType} Property specifying how corners are styled.
* @memberof CorridorGraphics.prototype
* @type {Property}
* @default CornerType.ROUNDED
*/
cornerType : createPropertyDescriptor('cornerType'),

/**
* Get or sets the enum Property specifying whether the corridor
* casts or receives shadows from each light source.
Expand Down Expand Up @@ -257,19 +257,19 @@ define([
return new CorridorGraphics(this);
}
result.show = this.show;
result.material = this.material;
result.positions = this.positions;
result.width = this.width;
result.height = this.height;
result.heightReference = this.heightReference;
result.extrudedHeight = this.extrudedHeight;
result.extrudedHeightReference = this.extrudedHeightReference;
result.cornerType = this.cornerType;
result.granularity = this.granularity;
result.width = this.width;
result.fill = this.fill;
result.material = this.material;
result.outline = this.outline;
result.outlineColor = this.outlineColor;
result.outlineWidth = this.outlineWidth;
result.cornerType = this.cornerType;
result.shadows = this.shadows;
result.distanceDisplayCondition = this.distanceDisplayCondition;
result.classificationType = this.classificationType;
Expand All @@ -291,19 +291,19 @@ define([
//>>includeEnd('debug');

this.show = defaultValue(this.show, source.show);
this.material = defaultValue(this.material, source.material);
this.positions = defaultValue(this.positions, source.positions);
this.width = defaultValue(this.width, source.width);
this.height = defaultValue(this.height, source.height);
this.heightReference = defaultValue(this.heightReference, source.heightReference);
this.extrudedHeight = defaultValue(this.extrudedHeight, source.extrudedHeight);
this.extrudedHeightReference = defaultValue(this.extrudedHeightReference, source.extrudedHeightReference);
this.cornerType = defaultValue(this.cornerType, source.cornerType);
this.granularity = defaultValue(this.granularity, source.granularity);
this.width = defaultValue(this.width, source.width);
this.fill = defaultValue(this.fill, source.fill);
this.material = defaultValue(this.material, source.material);
this.outline = defaultValue(this.outline, source.outline);
this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);
this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);
this.cornerType = defaultValue(this.cornerType, source.cornerType);
this.shadows = defaultValue(this.shadows, source.shadows);
this.distanceDisplayCondition = defaultValue(this.distanceDisplayCondition, source.distanceDisplayCondition);
this.classificationType = defaultValue(this.classificationType, source.classificationType);
Expand Down
Loading