/
GeometryUpdater.js
238 lines (227 loc) · 7.93 KB
/
GeometryUpdater.js
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
define([
'../Core/defineProperties',
'../Core/DeveloperError'
], function(
defineProperties,
DeveloperError) {
'use strict';
/**
* Defines the interface for a geometry updater. A GeometryUpdater maps
* geometry defined as part of a {@link Entity} into {@link Geometry}
* instances. These instances are then visualized by {@link GeometryVisualizer}.
*
* This type defines an interface and cannot be instantiated directly.
*
* @alias GeometryUpdater
* @constructor
*
* @param {Entity} entity The entity containing the geometry to be visualized.
* @param {Scene} scene The scene where visualization is taking place.
*
* @see EllipseGeometryUpdater
* @see EllipsoidGeometryUpdater
* @see PolygonGeometryUpdater
* @see PolylineGeometryUpdater
* @see RectangleGeometryUpdater
* @see WallGeometryUpdater
*/
function GeometryUpdater(entity, scene) {
DeveloperError.throwInstantiationError();
}
defineProperties(GeometryUpdater, {
/**
* Gets the type of Appearance to use for simple color-based geometry.
* @memberof GeometryUpdater
* @type {Appearance}
*/
perInstanceColorAppearanceType : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets the type of Appearance to use for material-based geometry.
* @memberof GeometryUpdater
* @type {Appearance}
*/
materialAppearanceType : {
get : DeveloperError.throwInstantiationError
}
});
defineProperties(GeometryUpdater.prototype, {
/**
* Gets the entity associated with this geometry.
* @memberof GeometryUpdater.prototype
*
* @type {Entity}
* @readonly
*/
entity : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets a value indicating if the geometry has a fill component.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
fillEnabled : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets a value indicating if fill visibility varies with simulation time.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
hasConstantFill : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets the material property used to fill the geometry.
* @memberof GeometryUpdater.prototype
*
* @type {MaterialProperty}
* @readonly
*/
fillMaterialProperty : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets a value indicating if the geometry has an outline component.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
outlineEnabled : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets a value indicating if outline visibility varies with simulation time.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
hasConstantOutline : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets the {@link Color} property for the geometry outline.
* @memberof GeometryUpdater.prototype
*
* @type {Property}
* @readonly
*/
outlineColorProperty : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets the constant with of the geometry outline, in pixels.
* This value is only valid if isDynamic is false.
* @memberof GeometryUpdater.prototype
*
* @type {Number}
* @readonly
*/
outlineWidth : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets a value indicating if the geometry is time-varying.
* If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
* returned by GeometryUpdater#createDynamicUpdater.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
isDynamic : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets a value indicating if the geometry is closed.
* This property is only valid for static geometry.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
isClosed : {
get : DeveloperError.throwInstantiationError
},
/**
* Gets an event that is raised whenever the public properties
* of this updater change.
* @memberof GeometryUpdater.prototype
*
* @type {Boolean}
* @readonly
*/
geometryChanged : {
get : DeveloperError.throwInstantiationError
}
});
/**
* Checks if the geometry is outlined at the provided time.
* @function
*
* @param {JulianDate} time The time for which to retrieve visibility.
* @returns {Boolean} true if geometry is outlined at the provided time, false otherwise.
*/
GeometryUpdater.prototype.isOutlineVisible = DeveloperError.throwInstantiationError;
/**
* Checks if the geometry is filled at the provided time.
* @function
*
* @param {JulianDate} time The time for which to retrieve visibility.
* @returns {Boolean} true if geometry is filled at the provided time, false otherwise.
*/
GeometryUpdater.prototype.isFilled = DeveloperError.throwInstantiationError;
/**
* Creates the geometry instance which represents the fill of the geometry.
* @function
*
* @param {JulianDate} time The time to use when retrieving initial attribute values.
* @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.
*
* @exception {DeveloperError} This instance does not represent a filled geometry.
*/
GeometryUpdater.prototype.createFillGeometryInstance = DeveloperError.throwInstantiationError;
/**
* Creates the geometry instance which represents the outline of the geometry.
* @function
*
* @param {JulianDate} time The time to use when retrieving initial attribute values.
* @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.
*
* @exception {DeveloperError} This instance does not represent an outlined geometry.
*/
GeometryUpdater.prototype.createOutlineGeometryInstance = DeveloperError.throwInstantiationError;
/**
* Returns true if this object was destroyed; otherwise, false.
* @function
*
* @returns {Boolean} True if this object was destroyed; otherwise, false.
*/
GeometryUpdater.prototype.isDestroyed = DeveloperError.throwInstantiationError;
/**
* Destroys and resources used by the object. Once an object is destroyed, it should not be used.
* @function
*
* @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
*/
GeometryUpdater.prototype.destroy = DeveloperError.throwInstantiationError;
/**
* Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true.
* @function
*
* @param {PrimitiveCollection} primitives The primitive collection to use.
* @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame.
*
* @exception {DeveloperError} This instance does not represent dynamic geometry.
*/
GeometryUpdater.prototype.createDynamicUpdater = DeveloperError.throwInstantiationError;
return GeometryUpdater;
});