123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- /*global define*/
- define([
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/DeveloperError',
- '../Core/Event',
- './createPropertyDescriptor'
- ], function(
- defaultValue,
- defined,
- defineProperties,
- DeveloperError,
- Event,
- createPropertyDescriptor) {
- "use strict";
- /**
- * An optionally time-dynamic Rectangle.
- *
- * @alias RectangleGraphics
- * @constructor
- */
- var RectangleGraphics = function() {
- this._show = undefined;
- this._showSubscription = undefined;
- this._material = undefined;
- this._materialSubscription = undefined;
- this._coordinates = undefined;
- this._coordinatesSubscription = undefined;
- this._height = undefined;
- this._heightSubscription = undefined;
- this._extrudedHeight = undefined;
- this._extrudedHeightSubscription = undefined;
- this._granularity = undefined;
- this._granularitySubscription = undefined;
- this._stRotation = undefined;
- this._stRotationSubscription = undefined;
- this._rotation = undefined;
- this._rotationSubscription = undefined;
- this._closeTop = undefined;
- this._closeTopSubscription = undefined;
- this._closeBottom = undefined;
- this._closeBottomSubscription = undefined;
- this._outline = undefined;
- this._outlineSubscription = undefined;
- this._outlineColor = undefined;
- this._outlineColorSubscription = undefined;
- this._outlineWidth = undefined;
- this._outlineWidthSubscription = undefined;
- this._definitionChanged = new Event();
- };
- defineProperties(RectangleGraphics.prototype, {
- /**
- * Gets the event that is raised whenever a new property is assigned.
- * @memberof RectangleGraphics.prototype
- *
- * @type {Event}
- * @readonly
- */
- definitionChanged : {
- get : function() {
- return this._definitionChanged;
- }
- },
- /**
- * Gets or sets the boolean {@link Property} specifying the rectangle's visibility.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- show : createPropertyDescriptor('show'),
- /**
- * Gets or sets the {@link Rectangle} {@link Property} specifying the extent.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- coordinates : createPropertyDescriptor('coordinates'),
- /**
- * Gets or sets the {@link MaterialProperty} specifying the appearance of the rectangle.
- * @memberof RectangleGraphics.prototype
- * @type {MaterialProperty}
- */
- material : createPropertyDescriptor('material'),
- /**
- * Gets or sets the Number {@link Property} specifying the height of the rectangle.
- * If undefined, the rectangle will be on the surface.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- height : createPropertyDescriptor('height'),
- /**
- * Gets or sets the Number {@link Property} specifying the extruded height of the rectangle.
- * Setting this property creates a rectangle shaped volume starting at height and ending
- * at the extruded height.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- extrudedHeight : createPropertyDescriptor('extrudedHeight'),
- /**
- * Gets or sets the Number {@link Property} specifying the sampling distance, in radians,
- * between each latitude and longitude point.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- granularity : createPropertyDescriptor('granularity'),
- /**
- * Gets or sets the Number {@link Property} specifying the rotation of the texture coordinates,
- * in radians. A positive rotation is counter-clockwise.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- stRotation : createPropertyDescriptor('stRotation'),
- /**
- * Gets or sets the Number {@link Property} specifying the rotation of the texture coordinates,
- * in radians. A positive rotation is counter-clockwise.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- rotation : createPropertyDescriptor('rotation'),
- /**
- * Gets or sets the Boolean {@link Property} specifying whether the rectangle should be filled.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- fill : createPropertyDescriptor('fill'),
- /**
- * Gets or sets the Boolean {@link Property} specifying whether the rectangle should be outlined.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- outline : createPropertyDescriptor('outline'),
- /**
- * Gets or sets the Color {@link Property} specifying whether the color of the outline.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- outlineColor : createPropertyDescriptor('outlineColor'),
- /**
- * Gets or sets the Number {@link Property} specifying the width of the outline.
- * @memberof EllipseGraphics.prototype
- * @type {Property}
- */
- outlineWidth : createPropertyDescriptor('outlineWidth'),
- /**
- * Gets or sets the Boolean {@link Property} specifying whether an extruded rectangle should have a closed top.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- closeTop : createPropertyDescriptor('closeTop'),
- /**
- * Gets or sets the Boolean {@link Property} specifying whether an extruded rectangle should have a closed bottom.
- * @memberof RectangleGraphics.prototype
- * @type {Property}
- */
- closeBottom : createPropertyDescriptor('closeBottom')
- });
- /**
- * Duplicates a RectangleGraphics instance.
- *
- * @param {RectangleGraphics} [result] The object onto which to store the result.
- * @returns {RectangleGraphics} The modified result parameter or a new instance if one was not provided.
- */
- RectangleGraphics.prototype.clone = function(result) {
- if (!defined(result)) {
- result = new RectangleGraphics();
- }
- result.show = this.show;
- result.coordinates = this.coordinates;
- result.material = this.material;
- result.height = this.height;
- result.extrudedHeight = this.extrudedHeight;
- result.granularity = this.granularity;
- result.stRotation = this.stRotation;
- result.rotation = this.rotation;
- result.fill = this.fill;
- result.outline = this.outline;
- result.outlineColor = this.outlineColor;
- result.outlineWidth = this.outlineWidth;
- result.closeTop = this.closeTop;
- result.closeBottom = this.closeBottom;
- return result;
- };
- /**
- * Assigns each unassigned property on this object to the value
- * of the same property on the provided source object.
- *
- * @param {RectangleGraphics} source The object to be merged into this object.
- */
- RectangleGraphics.prototype.merge = function(source) {
- //>>includeStart('debug', pragmas.debug);
- if (!defined(source)) {
- throw new DeveloperError('source is required.');
- }
- //>>includeEnd('debug');
- this.show = defaultValue(this.show, source.show);
- this.coordinates = defaultValue(this.coordinates, source.coordinates);
- this.material = defaultValue(this.material, source.material);
- this.height = defaultValue(this.height, source.height);
- this.extrudedHeight = defaultValue(this.extrudedHeight, source.extrudedHeight);
- this.granularity = defaultValue(this.granularity, source.granularity);
- this.stRotation = defaultValue(this.stRotation, source.stRotation);
- this.rotation = defaultValue(this.rotation, source.rotation);
- this.fill = defaultValue(this.fill, source.fill);
- this.outline = defaultValue(this.outline, source.outline);
- this.outlineColor = defaultValue(this.outlineColor, source.outlineColor);
- this.outlineWidth = defaultValue(this.outlineWidth, source.outlineWidth);
- this.closeTop = defaultValue(this.closeTop, source.closeTop);
- this.closeBottom = defaultValue(this.closeBottom, source.closeBottom);
- };
- return RectangleGraphics;
- });
|