123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429 |
- import defaultValue from "../Core/defaultValue.js";
- import defined from "../Core/defined.js";
- import DeveloperError from "../Core/DeveloperError.js";
- import Event from "../Core/Event.js";
- import createPropertyDescriptor from "./createPropertyDescriptor.js";
- function BillboardGraphics(options) {
- this._definitionChanged = new Event();
- this._show = undefined;
- this._showSubscription = undefined;
- this._image = undefined;
- this._imageSubscription = undefined;
- this._scale = undefined;
- this._scaleSubscription = undefined;
- this._pixelOffset = undefined;
- this._pixelOffsetSubscription = undefined;
- this._eyeOffset = undefined;
- this._eyeOffsetSubscription = undefined;
- this._horizontalOrigin = undefined;
- this._horizontalOriginSubscription = undefined;
- this._verticalOrigin = undefined;
- this._verticalOriginSubscription = undefined;
- this._heightReference = undefined;
- this._heightReferenceSubscription = undefined;
- this._color = undefined;
- this._colorSubscription = undefined;
- this._rotation = undefined;
- this._rotationSubscription = undefined;
- this._alignedAxis = undefined;
- this._alignedAxisSubscription = undefined;
- this._sizeInMeters = undefined;
- this._sizeInMetersSubscription = undefined;
- this._width = undefined;
- this._widthSubscription = undefined;
- this._height = undefined;
- this._heightSubscription = undefined;
- this._scaleByDistance = undefined;
- this._scaleByDistanceSubscription = undefined;
- this._translucencyByDistance = undefined;
- this._translucencyByDistanceSubscription = undefined;
- this._pixelOffsetScaleByDistance = undefined;
- this._pixelOffsetScaleByDistanceSubscription = undefined;
- this._imageSubRegion = undefined;
- this._imageSubRegionSubscription = undefined;
- this._distanceDisplayCondition = undefined;
- this._distanceDisplayConditionSubscription = undefined;
- this._disableDepthTestDistance = undefined;
- this._disableDepthTestDistanceSubscription = undefined;
- this.merge(defaultValue(options, defaultValue.EMPTY_OBJECT));
- }
- Object.defineProperties(BillboardGraphics.prototype, {
-
- definitionChanged: {
- get: function () {
- return this._definitionChanged;
- },
- },
-
- show: createPropertyDescriptor("show"),
-
- image: createPropertyDescriptor("image"),
-
- scale: createPropertyDescriptor("scale"),
-
- pixelOffset: createPropertyDescriptor("pixelOffset"),
-
- eyeOffset: createPropertyDescriptor("eyeOffset"),
-
- horizontalOrigin: createPropertyDescriptor("horizontalOrigin"),
-
- verticalOrigin: createPropertyDescriptor("verticalOrigin"),
-
- heightReference: createPropertyDescriptor("heightReference"),
-
- color: createPropertyDescriptor("color"),
-
- rotation: createPropertyDescriptor("rotation"),
-
- alignedAxis: createPropertyDescriptor("alignedAxis"),
-
- sizeInMeters: createPropertyDescriptor("sizeInMeters"),
-
- width: createPropertyDescriptor("width"),
-
- height: createPropertyDescriptor("height"),
-
- scaleByDistance: createPropertyDescriptor("scaleByDistance"),
-
- translucencyByDistance: createPropertyDescriptor("translucencyByDistance"),
-
- pixelOffsetScaleByDistance: createPropertyDescriptor(
- "pixelOffsetScaleByDistance"
- ),
-
- imageSubRegion: createPropertyDescriptor("imageSubRegion"),
-
- distanceDisplayCondition: createPropertyDescriptor(
- "distanceDisplayCondition"
- ),
-
- disableDepthTestDistance: createPropertyDescriptor(
- "disableDepthTestDistance"
- ),
- });
- BillboardGraphics.prototype.clone = function (result) {
- if (!defined(result)) {
- return new BillboardGraphics(this);
- }
- result.show = this._show;
- result.image = this._image;
- result.scale = this._scale;
- result.pixelOffset = this._pixelOffset;
- result.eyeOffset = this._eyeOffset;
- result.horizontalOrigin = this._horizontalOrigin;
- result.verticalOrigin = this._verticalOrigin;
- result.heightReference = this._heightReference;
- result.color = this._color;
- result.rotation = this._rotation;
- result.alignedAxis = this._alignedAxis;
- result.sizeInMeters = this._sizeInMeters;
- result.width = this._width;
- result.height = this._height;
- result.scaleByDistance = this._scaleByDistance;
- result.translucencyByDistance = this._translucencyByDistance;
- result.pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;
- result.imageSubRegion = this._imageSubRegion;
- result.distanceDisplayCondition = this._distanceDisplayCondition;
- result.disableDepthTestDistance = this._disableDepthTestDistance;
- return result;
- };
- BillboardGraphics.prototype.merge = function (source) {
-
- if (!defined(source)) {
- throw new DeveloperError("source is required.");
- }
-
- this.show = defaultValue(this._show, source.show);
- this.image = defaultValue(this._image, source.image);
- this.scale = defaultValue(this._scale, source.scale);
- this.pixelOffset = defaultValue(this._pixelOffset, source.pixelOffset);
- this.eyeOffset = defaultValue(this._eyeOffset, source.eyeOffset);
- this.horizontalOrigin = defaultValue(
- this._horizontalOrigin,
- source.horizontalOrigin
- );
- this.verticalOrigin = defaultValue(
- this._verticalOrigin,
- source.verticalOrigin
- );
- this.heightReference = defaultValue(
- this._heightReference,
- source.heightReference
- );
- this.color = defaultValue(this._color, source.color);
- this.rotation = defaultValue(this._rotation, source.rotation);
- this.alignedAxis = defaultValue(this._alignedAxis, source.alignedAxis);
- this.sizeInMeters = defaultValue(this._sizeInMeters, source.sizeInMeters);
- this.width = defaultValue(this._width, source.width);
- this.height = defaultValue(this._height, source.height);
- this.scaleByDistance = defaultValue(
- this._scaleByDistance,
- source.scaleByDistance
- );
- this.translucencyByDistance = defaultValue(
- this._translucencyByDistance,
- source.translucencyByDistance
- );
- this.pixelOffsetScaleByDistance = defaultValue(
- this._pixelOffsetScaleByDistance,
- source.pixelOffsetScaleByDistance
- );
- this.imageSubRegion = defaultValue(
- this._imageSubRegion,
- source.imageSubRegion
- );
- this.distanceDisplayCondition = defaultValue(
- this._distanceDisplayCondition,
- source.distanceDisplayCondition
- );
- this.disableDepthTestDistance = defaultValue(
- this._disableDepthTestDistance,
- source.disableDepthTestDistance
- );
- };
- export default BillboardGraphics;
|