Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 104x 1x 192x 1x 1x 1x 1x 107x 1x 106x 106x 106x 106x 106x 106x 106x | import Frozen from "../Core/Frozen.js";
import defined from "../Core/defined.js";
import DeveloperError from "../Core/DeveloperError.js";
import Event from "../Core/Event.js";
import createMaterialPropertyDescriptor from "./createMaterialPropertyDescriptor.js";
import createPropertyDescriptor from "./createPropertyDescriptor.js";
/**
* @typedef {object} PathGraphics.ConstructorOptions
*
* Initialization options for the PathGraphics constructor
*
* @property {Property | boolean} [show=true] A boolean Property specifying the visibility of the path.
* @property {Property | number} [leadTime] A Property specifying the number of seconds in front the object to show.
* @property {Property | number} [trailTime] A Property specifying the number of seconds behind of the object to show.
* @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.
* @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position.
* @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the path.
* @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed.
*/
/**
* Describes a polyline defined as the path made by an {@link Entity} as it moves over time.
*
* @alias PathGraphics
* @constructor
*
* @param {PathGraphics.ConstructorOptions} [options] Object describing initialization options
*/
function PathGraphics(options) {
this._definitionChanged = new Event();
this._show = undefined;
this._showSubscription = undefined;
this._leadTime = undefined;
this._leadTimeSubscription = undefined;
this._trailTime = undefined;
this._trailTimeSubscription = undefined;
this._width = undefined;
this._widthSubscription = undefined;
this._resolution = undefined;
this._resolutionSubscription = undefined;
this._material = undefined;
this._materialSubscription = undefined;
this._distanceDisplayCondition = undefined;
this._distanceDisplayConditionSubscription = undefined;
this.merge(options ?? Frozen.EMPTY_OBJECT);
}
Object.defineProperties(PathGraphics.prototype, {
/**
* Gets the event that is raised whenever a property or sub-property is changed or modified.
* @memberof PathGraphics.prototype
* @type {Event}
* @readonly
*/
definitionChanged: {
get: function () {
return this._definitionChanged;
},
},
/**
* Gets or sets the boolean Property specifying the visibility of the path.
* @memberof PathGraphics.prototype
* @type {Property|undefined}
* @default true
*/
show: createPropertyDescriptor("show"),
/**
* Gets or sets the Property specifying the number of seconds in front of the object to show.
* @memberof PathGraphics.prototype
* @type {Property|undefined}
*/
leadTime: createPropertyDescriptor("leadTime"),
/**
* Gets or sets the Property specifying the number of seconds behind the object to show.
* @memberof PathGraphics.prototype
* @type {Property|undefined}
*/
trailTime: createPropertyDescriptor("trailTime"),
/**
* Gets or sets the numeric Property specifying the width in pixels.
* @memberof PathGraphics.prototype
* @type {Property|undefined}
* @default 1.0
*/
width: createPropertyDescriptor("width"),
/**
* Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
* @memberof PathGraphics.prototype
* @type {Property|undefined}
* @default 60
*/
resolution: createPropertyDescriptor("resolution"),
/**
* Gets or sets the Property specifying the material used to draw the path.
* @memberof PathGraphics.prototype
* @type {MaterialProperty}
* @default Color.WHITE
*/
material: createMaterialPropertyDescriptor("material"),
/**
* Gets or sets the {@link DistanceDisplayCondition} Property specifying at what distance from the camera that this path will be displayed.
* @memberof PathGraphics.prototype
* @type {Property|undefined}
*/
distanceDisplayCondition: createPropertyDescriptor(
"distanceDisplayCondition",
),
});
/**
* Duplicates this instance.
*
* @param {PathGraphics} [result] The object onto which to store the result.
* @returns {PathGraphics} The modified result parameter or a new instance if one was not provided.
*/
PathGraphics.prototype.clone = function (result) {
Eif (!defined(result)) {
return new PathGraphics(this);
}
result.show = this.show;
result.leadTime = this.leadTime;
result.trailTime = this.trailTime;
result.width = this.width;
result.resolution = this.resolution;
result.material = this.material;
result.distanceDisplayCondition = this.distanceDisplayCondition;
return result;
};
/**
* Assigns each unassigned property on this object to the value
* of the same property on the provided source object.
*
* @param {PathGraphics} source The object to be merged into this object.
*/
PathGraphics.prototype.merge = function (source) {
//>>includeStart('debug', pragmas.debug);
if (!defined(source)) {
throw new DeveloperError("source is required.");
}
//>>includeEnd('debug');
this.show = this.show ?? source.show;
this.leadTime = this.leadTime ?? source.leadTime;
this.trailTime = this.trailTime ?? source.trailTime;
this.width = this.width ?? source.width;
this.resolution = this.resolution ?? source.resolution;
this.material = this.material ?? source.material;
this.distanceDisplayCondition =
this.distanceDisplayCondition ?? source.distanceDisplayCondition;
};
export default PathGraphics;
|