GeometryUpdater.js 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. /*global define*/
  2. define([
  3. '../Core/defineProperties',
  4. '../Core/DeveloperError'
  5. ], function(
  6. defineProperties,
  7. DeveloperError) {
  8. "use strict";
  9. /**
  10. * Defines the interface for a geometry updater. A GeometryUpdater maps
  11. * geometry defined as part of a {@link Entity} into {@link Geometry}
  12. * instances. These instances are then visualized by {@link GeometryVisualizer}.
  13. *
  14. * This type defines an interface and cannot be instantiated directly.
  15. *
  16. * @alias GeometryUpdater
  17. * @constructor
  18. *
  19. * @param {Entity} entity The entity containing the geometry to be visualized.
  20. * @param {Scene} scene The scene where visualization is taking place.
  21. *
  22. * @see EllipseGeometryUpdater
  23. * @see EllipsoidGeometryUpdater
  24. * @see PolygonGeometryUpdater
  25. * @see PolylineGeometryUpdater
  26. * @see RectangleGeometryUpdater
  27. * @see WallGeometryUpdater
  28. */
  29. var GeometryUpdater = function(entity, scene) {
  30. DeveloperError.throwInstantiationError();
  31. };
  32. defineProperties(GeometryUpdater, {
  33. /**
  34. * Gets the type of Appearance to use for simple color-based geometry.
  35. * @memberof GeometryUpdater
  36. * @type {Appearance}
  37. */
  38. perInstanceColorAppearanceType : {
  39. get : DeveloperError.throwInstantiationError
  40. },
  41. /**
  42. * Gets the type of Appearance to use for material-based geometry.
  43. * @memberof GeometryUpdater
  44. * @type {Appearance}
  45. */
  46. materialAppearanceType : {
  47. get : DeveloperError.throwInstantiationError
  48. }
  49. });
  50. defineProperties(GeometryUpdater.prototype, {
  51. /**
  52. * Gets the entity associated with this geometry.
  53. * @memberof GeometryUpdater.prototype
  54. *
  55. * @type {Entity}
  56. * @readonly
  57. */
  58. entity : {
  59. get : DeveloperError.throwInstantiationError
  60. },
  61. /**
  62. * Gets a value indicating if the geometry has a fill component.
  63. * @memberof GeometryUpdater.prototype
  64. *
  65. * @type {Boolean}
  66. * @readonly
  67. */
  68. fillEnabled : {
  69. get : DeveloperError.throwInstantiationError
  70. },
  71. /**
  72. * Gets a value indicating if fill visibility varies with simulation time.
  73. * @memberof GeometryUpdater.prototype
  74. *
  75. * @type {Boolean}
  76. * @readonly
  77. */
  78. hasConstantFill : {
  79. get : DeveloperError.throwInstantiationError
  80. },
  81. /**
  82. * Gets the material property used to fill the geometry.
  83. * @memberof GeometryUpdater.prototype
  84. *
  85. * @type {MaterialProperty}
  86. * @readonly
  87. */
  88. fillMaterialProperty : {
  89. get : DeveloperError.throwInstantiationError
  90. },
  91. /**
  92. * Gets a value indicating if the geometry has an outline component.
  93. * @memberof GeometryUpdater.prototype
  94. *
  95. * @type {Boolean}
  96. * @readonly
  97. */
  98. outlineEnabled : {
  99. get : DeveloperError.throwInstantiationError
  100. },
  101. /**
  102. * Gets a value indicating if outline visibility varies with simulation time.
  103. * @memberof GeometryUpdater.prototype
  104. *
  105. * @type {Boolean}
  106. * @readonly
  107. */
  108. hasConstantOutline : {
  109. get : DeveloperError.throwInstantiationError
  110. },
  111. /**
  112. * Gets the {@link Color} property for the geometry outline.
  113. * @memberof GeometryUpdater.prototype
  114. *
  115. * @type {Property}
  116. * @readonly
  117. */
  118. outlineColorProperty : {
  119. get : DeveloperError.throwInstantiationError
  120. },
  121. /**
  122. * Gets the constant with of the geometry outline, in pixels.
  123. * This value is only valid if isDynamic is false.
  124. * @memberof GeometryUpdater.prototype
  125. *
  126. * @type {Number}
  127. * @readonly
  128. */
  129. outlineWidth : {
  130. get : DeveloperError.throwInstantiationError
  131. },
  132. /**
  133. * Gets a value indicating if the geometry is time-varying.
  134. * If true, all visualization is delegated to the {@link DynamicGeometryUpdater}
  135. * returned by GeometryUpdater#createDynamicUpdater.
  136. * @memberof GeometryUpdater.prototype
  137. *
  138. * @type {Boolean}
  139. * @readonly
  140. */
  141. isDynamic : {
  142. get : DeveloperError.throwInstantiationError
  143. },
  144. /**
  145. * Gets a value indicating if the geometry is closed.
  146. * This property is only valid for static geometry.
  147. * @memberof GeometryUpdater.prototype
  148. *
  149. * @type {Boolean}
  150. * @readonly
  151. */
  152. isClosed : {
  153. get : DeveloperError.throwInstantiationError
  154. },
  155. /**
  156. * Gets an event that is raised whenever the public properties
  157. * of this updater change.
  158. * @memberof GeometryUpdater.prototype
  159. *
  160. * @type {Boolean}
  161. * @readonly
  162. */
  163. geometryChanged : {
  164. get : DeveloperError.throwInstantiationError
  165. }
  166. });
  167. /**
  168. * Checks if the geometry is outlined at the provided time.
  169. * @function
  170. *
  171. * @param {JulianDate} time The time for which to retrieve visibility.
  172. * @returns {Boolean} true if geometry is outlined at the provided time, false otherwise.
  173. */
  174. GeometryUpdater.prototype.isOutlineVisible = DeveloperError.throwInstantiationError;
  175. /**
  176. * Checks if the geometry is filled at the provided time.
  177. * @function
  178. *
  179. * @param {JulianDate} time The time for which to retrieve visibility.
  180. * @returns {Boolean} true if geometry is filled at the provided time, false otherwise.
  181. */
  182. GeometryUpdater.prototype.isFilled = DeveloperError.throwInstantiationError;
  183. /**
  184. * Creates the geometry instance which represents the fill of the geometry.
  185. * @function
  186. *
  187. * @param {JulianDate} time The time to use when retrieving initial attribute values.
  188. * @returns {GeometryInstance} The geometry instance representing the filled portion of the geometry.
  189. *
  190. * @exception {DeveloperError} This instance does not represent a filled geometry.
  191. */
  192. GeometryUpdater.prototype.createFillGeometryInstance = DeveloperError.throwInstantiationError;
  193. /**
  194. * Creates the geometry instance which represents the outline of the geometry.
  195. * @function
  196. *
  197. * @param {JulianDate} time The time to use when retrieving initial attribute values.
  198. * @returns {GeometryInstance} The geometry instance representing the outline portion of the geometry.
  199. *
  200. * @exception {DeveloperError} This instance does not represent an outlined geometry.
  201. */
  202. GeometryUpdater.prototype.createOutlineGeometryInstance = DeveloperError.throwInstantiationError;
  203. /**
  204. * Returns true if this object was destroyed; otherwise, false.
  205. * @function
  206. *
  207. * @returns {Boolean} True if this object was destroyed; otherwise, false.
  208. */
  209. GeometryUpdater.prototype.isDestroyed = DeveloperError.throwInstantiationError;
  210. /**
  211. * Destroys and resources used by the object. Once an object is destroyed, it should not be used.
  212. * @function
  213. *
  214. * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
  215. */
  216. GeometryUpdater.prototype.destroy = DeveloperError.throwInstantiationError;
  217. /**
  218. * Creates the dynamic updater to be used when GeometryUpdater#isDynamic is true.
  219. * @function
  220. *
  221. * @param {PrimitiveCollection} primitives The primitive collection to use.
  222. * @returns {DynamicGeometryUpdater} The dynamic updater used to update the geometry each frame.
  223. *
  224. * @exception {DeveloperError} This instance does not represent dynamic geometry.
  225. */
  226. GeometryUpdater.prototype.createDynamicUpdater = DeveloperError.throwInstantiationError;
  227. return GeometryUpdater;
  228. });