diff --git a/Source/Core/ClockRange.js b/Source/Core/ClockRange.js index 09e343efd39b..28012b7c9f8c 100644 --- a/Source/Core/ClockRange.js +++ b/Source/Core/ClockRange.js @@ -9,7 +9,8 @@ define([ * Constants used by {@link Clock#tick} to determine behavior * when {@link Clock#startTime} or {@link Clock#stopTime} is reached. * - * @exports ClockRange + * @namespace + * @alias ClockRange * * @see Clock * @see ClockStep diff --git a/Source/Core/ClockStep.js b/Source/Core/ClockStep.js index e1b7db4cf78e..f355de81c193 100644 --- a/Source/Core/ClockStep.js +++ b/Source/Core/ClockStep.js @@ -9,7 +9,8 @@ define([ * Constants to determine how much time advances with each call * to {@link Clock#tick}. * - * @exports ClockStep + * @namespace + * @alias ClockStep * * @see Clock * @see ClockRange diff --git a/Source/Core/ComponentDatatype.js b/Source/Core/ComponentDatatype.js index d656cb21e801..21e95f3255a2 100644 --- a/Source/Core/ComponentDatatype.js +++ b/Source/Core/ComponentDatatype.js @@ -23,7 +23,8 @@ define([ * WebGL component datatypes. Components are intrinsics, * which form attributes, which form vertices. * - * @exports ComponentDatatype + * @namespace + * @alias ComponentDatatype */ var ComponentDatatype = { /** diff --git a/Source/Core/CornerType.js b/Source/Core/CornerType.js index c10e5521323f..67613c671d70 100644 --- a/Source/Core/CornerType.js +++ b/Source/Core/CornerType.js @@ -6,13 +6,18 @@ define([ "use strict"; /** - * @exports CornerType + * Style options for corners. + * + * @namespace + * @alias CornerType */ var CornerType = { /** - * ___ + *
+         *  _____
          * (  ___
          * | |
+         * 
* * Corner is circular. * @type {Number} @@ -21,9 +26,11 @@ define([ ROUNDED : 0, /** + *
          *  ______
-         * |  ___
+         * |  ____
          * | |
+         * 
* * Corner point is the intersection of adjacent edges. * @type {Number} @@ -32,9 +39,11 @@ define([ MITERED : 1, /** - * ___ + *
+         *  _____
          * /  ___
          * | |
+         * 
* * Corner is clipped. * @type {Number} diff --git a/Source/Core/CorridorGeometry.js b/Source/Core/CorridorGeometry.js index b6ade26965a9..eef2bc7e1dbf 100644 --- a/Source/Core/CorridorGeometry.js +++ b/Source/Core/CorridorGeometry.js @@ -634,7 +634,7 @@ define([ * @param {Number} [options.height=0] The distance in meters between the ellipsoid surface and the positions. * @param {Number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extrusion. * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - * @param {Boolean} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. + * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. * * @see CorridorGeometry.createGeometry * diff --git a/Source/Core/CorridorOutlineGeometry.js b/Source/Core/CorridorOutlineGeometry.js index c984dd126d7d..bb35fb97b0a8 100644 --- a/Source/Core/CorridorOutlineGeometry.js +++ b/Source/Core/CorridorOutlineGeometry.js @@ -313,7 +313,7 @@ define([ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. * @param {Number} [options.height=0] The distance between the ellipsoid surface and the positions. * @param {Number} [options.extrudedHeight] The distance between the ellipsoid surface and the extrusion. - * @param {Boolean} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. + * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. * * @see CorridorOutlineGeometry.createGeometry * diff --git a/Source/Core/CubicRealPolynomial.js b/Source/Core/CubicRealPolynomial.js index 0daf2ce343f3..6f5b32a985cd 100644 --- a/Source/Core/CubicRealPolynomial.js +++ b/Source/Core/CubicRealPolynomial.js @@ -10,7 +10,8 @@ define([ /** * Defines functions for 3rd order polynomial functions of one variable with only real coefficients. * - * @exports CubicRealPolynomial + * @namespace + * @alias CubicRealPolynomial */ var CubicRealPolynomial = {}; diff --git a/Source/Core/EasingFunction.js b/Source/Core/EasingFunction.js index 7241e91d77b8..154c1384b1b7 100644 --- a/Source/Core/EasingFunction.js +++ b/Source/Core/EasingFunction.js @@ -12,7 +12,8 @@ define([ * {@link https://github.com/sole/tween.js/|Tween.js} and Robert Penner. See the * {@link http://sole.github.io/tween.js/examples/03_graphs.html|Tween.js graphs for each function}. * - * @exports EasingFunction + * @namespace + * @alias EasingFunction * * @private */ diff --git a/Source/Core/Event.js b/Source/Core/Event.js index 902dac1f08e5..a4c9ee12d128 100644 --- a/Source/Core/Event.js +++ b/Source/Core/Event.js @@ -38,7 +38,7 @@ define([ * @memberof Event.prototype * @type {Number} */ - numberOfListeners: { + numberOfListeners : { get : function() { return this._listeners.length; } @@ -52,8 +52,8 @@ define([ * * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this - * pointer in which the listener function will execute. - * @returns {Function} A function that will remove this event listener when invoked. + * pointer in which the listener function will execute. + * @returns {Event~RemoveCallback} A function that will remove this event listener when invoked. * * @see Event#raiseEvent * @see Event#removeEventListener @@ -128,5 +128,10 @@ define([ } }; + /** + * A function that removes a listener. + * @callback Event~RemoveCallback + */ + return Event; }); \ No newline at end of file diff --git a/Source/Core/EventHelper.js b/Source/Core/EventHelper.js index e3030ac44b1a..3e48ceecbc62 100644 --- a/Source/Core/EventHelper.js +++ b/Source/Core/EventHelper.js @@ -36,8 +36,8 @@ define([ * @param {Event} event The event to attach to. * @param {Function} listener The function to be executed when the event is raised. * @param {Object} [scope] An optional object scope to serve as the this - * pointer in which the listener function will execute. - * @returns {Function} A function that will remove this event listener when invoked. + * pointer in which the listener function will execute. + * @returns {EventHelper~RemoveCallback} A function that will remove this event listener when invoked. * * @see Event#addEventListener */ @@ -72,5 +72,10 @@ define([ removalFunctions.length = 0; }; + /** + * A function that removes a listener. + * @callback EventHelper~RemoveCallback + */ + return EventHelper; }); diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js index 7f761570fd7a..4935a2731cf4 100644 --- a/Source/Core/FeatureDetection.js +++ b/Source/Core/FeatureDetection.js @@ -115,7 +115,8 @@ define([ * A set of functions to detect whether the current browser supports * various features. * - * @exports FeatureDetection + * @namespace + * @alias FeatureDetection */ var FeatureDetection = { isChrome : isChrome, diff --git a/Source/Core/Fullscreen.js b/Source/Core/Fullscreen.js index f82d6b7075d0..bee9c93c3920 100644 --- a/Source/Core/Fullscreen.js +++ b/Source/Core/Fullscreen.js @@ -20,7 +20,8 @@ define([ /** * Browser-independent functions for working with the standard fullscreen API. * - * @exports Fullscreen + * @namespace + * @alias Fullscreen * * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification} */ @@ -33,7 +34,7 @@ define([ * @memberof Fullscreen * @type {Object} */ - element: { + element : { get : function() { if (!Fullscreen.supportsFullscreen()) { return undefined; @@ -139,7 +140,7 @@ define([ //check for the correct combination of prefix plus the various names that browsers use var prefixes = ['webkit', 'moz', 'o', 'ms', 'khtml']; var name; - for ( var i = 0, len = prefixes.length; i < len; ++i) { + for (var i = 0, len = prefixes.length; i < len; ++i) { var prefix = prefixes[i]; // casing of Fullscreen differs across browsers diff --git a/Source/Core/GeometryPipeline.js b/Source/Core/GeometryPipeline.js index 2a2577c96765..c90dcd84a9c0 100644 --- a/Source/Core/GeometryPipeline.js +++ b/Source/Core/GeometryPipeline.js @@ -52,7 +52,8 @@ define([ /** * Content pipeline functions for geometries. * - * @exports GeometryPipeline + * @namespace + * @alias GeometryPipeline * * @see Geometry */ diff --git a/Source/Core/HeightmapTessellator.js b/Source/Core/HeightmapTessellator.js index 7dc5f8361e4b..648253f8d5c7 100644 --- a/Source/Core/HeightmapTessellator.js +++ b/Source/Core/HeightmapTessellator.js @@ -20,7 +20,8 @@ define([ /** * Contains functions to create a mesh from a heightmap image. * - * @exports HeightmapTessellator + * @namespace + * @alias HeightmapTessellator */ var HeightmapTessellator = {}; @@ -30,13 +31,13 @@ define([ * @constant */ HeightmapTessellator.DEFAULT_STRUCTURE = freezeObject({ - heightScale : 1.0, - heightOffset : 0.0, - elementsPerHeight : 1, - stride : 1, - elementMultiplier : 256.0, - isBigEndian : false - }); + heightScale : 1.0, + heightOffset : 0.0, + elementsPerHeight : 1, + stride : 1, + elementMultiplier : 256.0, + isBigEndian : false + }); /** * Fills an array of vertices from a heightmap image. On return, the vertex data is in the order @@ -211,7 +212,7 @@ define([ ++endCol; } - for ( var rowIndex = startRow; rowIndex < endRow; ++rowIndex) { + for (var rowIndex = startRow; rowIndex < endRow; ++rowIndex) { var row = rowIndex; if (row < 0) { row = 0; @@ -234,7 +235,7 @@ define([ var v = (latitude - geographicSouth) / (geographicNorth - geographicSouth); - for ( var colIndex = startCol; colIndex < endCol; ++colIndex) { + for (var colIndex = startCol; colIndex < endCol; ++colIndex) { var col = colIndex; if (col < 0) { col = 0; diff --git a/Source/Core/HermitePolynomialApproximation.js b/Source/Core/HermitePolynomialApproximation.js index e4818a130418..88d0e36ad043 100644 --- a/Source/Core/HermitePolynomialApproximation.js +++ b/Source/Core/HermitePolynomialApproximation.js @@ -57,7 +57,9 @@ define([ /** * An {@link InterpolationAlgorithm} for performing Hermite interpolation. - * @exports HermitePolynomialApproximation + * + * @namespace + * @alias HermitePolynomialApproximation */ var HermitePolynomialApproximation = { type : 'Hermite' diff --git a/Source/Core/Iau2000Orientation.js b/Source/Core/Iau2000Orientation.js index d233a96ac4fe..afbe43398640 100644 --- a/Source/Core/Iau2000Orientation.js +++ b/Source/Core/Iau2000Orientation.js @@ -17,7 +17,9 @@ define([ * This is a collection of the orientation information available for central bodies. * The data comes from the Report of the IAU/IAG Working Group on Cartographic * Coordinates and Rotational Elements: 2000. - * @exports Iau2000Orientation + * + * @namespace + * @alias Iau2000Orientation * * @private */ diff --git a/Source/Core/IauOrientationAxes.js b/Source/Core/IauOrientationAxes.js index 092e950c4653..43938e6529dd 100644 --- a/Source/Core/IauOrientationAxes.js +++ b/Source/Core/IauOrientationAxes.js @@ -23,13 +23,13 @@ define([ * @alias IauOrientationAxes * @constructor * - * @param {Function} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}. + * @param {IauOrientationAxes~ComputeFunction} [computeFunction] The function that computes the {@link IauOrientationParameters} given a {@link JulianDate}. * * @see Iau2000Orientation * * @private */ - var IauOrientationAxes = function (computeFunction) { + var IauOrientationAxes = function(computeFunction) { if (!defined(computeFunction) || typeof computeFunction !== 'function') { computeFunction = Iau2000Orientation.ComputeMoon; } @@ -99,5 +99,12 @@ define([ return cbi2cbf; }; + /** + * A function that computes the {@link IauOrientationParameters} for a {@link JulianDate}. + * @callback IauOrientationAxes~ComputeFunction + * @param {JulianDate} date The date to evaluate the parameters. + * @returns {IauOrientationParameters} The orientation parameters. + */ + return IauOrientationAxes; }); \ No newline at end of file diff --git a/Source/Core/IauOrientationParameters.js b/Source/Core/IauOrientationParameters.js index 45efa83fd9b6..f10dab88affe 100644 --- a/Source/Core/IauOrientationParameters.js +++ b/Source/Core/IauOrientationParameters.js @@ -9,7 +9,9 @@ define(function() { * These parameters correspond to the parameters in the Report from the IAU/IAG Working Group * except that they are expressed in radians. *

- * @exports IauOrientationParameters + * + * @namespace + * @alias IauOrientationParameters * * @private */ diff --git a/Source/Core/IndexDatatype.js b/Source/Core/IndexDatatype.js index 139be09a5e0d..ac7c46c870bd 100644 --- a/Source/Core/IndexDatatype.js +++ b/Source/Core/IndexDatatype.js @@ -15,7 +15,8 @@ define([ * Constants for WebGL index datatypes. These corresponds to the * type parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}. * - * @exports IndexDatatype + * @namespace + * @alias IndexDatatype */ var IndexDatatype = { /** diff --git a/Source/Core/InterpolationAlgorithm.js b/Source/Core/InterpolationAlgorithm.js index af149136ac66..ab7fb164863a 100644 --- a/Source/Core/InterpolationAlgorithm.js +++ b/Source/Core/InterpolationAlgorithm.js @@ -7,7 +7,9 @@ define([ /** * The interface for interpolation algorithms. - * @exports InterpolationAlgorithm + * + * @namespace + * @alias InterpolationAlgorithm * * @see LagrangePolynomialApproximation * @see LinearApproximation diff --git a/Source/Core/Intersect.js b/Source/Core/Intersect.js index 5fdc58ed68f5..911d5b103858 100644 --- a/Source/Core/Intersect.js +++ b/Source/Core/Intersect.js @@ -11,7 +11,8 @@ define([ * partially inside the frustum and partially outside (INTERSECTING), or somwhere entirely * outside of the frustum's 6 planes (OUTSIDE). * - * @exports Intersect + * @namespace + * @alias Intersect */ var Intersect = { /** diff --git a/Source/Core/IntersectionTests.js b/Source/Core/IntersectionTests.js index 17043d4a9119..80cbefb2f0a1 100644 --- a/Source/Core/IntersectionTests.js +++ b/Source/Core/IntersectionTests.js @@ -22,7 +22,8 @@ define([ /** * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids. * - * @exports IntersectionTests + * @namespace + * @alias IntersectionTests */ var IntersectionTests = {}; diff --git a/Source/Core/Intersections2D.js b/Source/Core/Intersections2D.js index 6cb74ad0e652..b5e2434dd02c 100644 --- a/Source/Core/Intersections2D.js +++ b/Source/Core/Intersections2D.js @@ -11,7 +11,9 @@ define([ /** * Contains functions for operating on 2D triangles. - * @exports Intersections2D + * + * @namespace + * @alias Intersections2D */ var Intersections2D = {}; diff --git a/Source/Core/Iso8601.js b/Source/Core/Iso8601.js index 3f1fa352ab53..93e63c09d2f4 100644 --- a/Source/Core/Iso8601.js +++ b/Source/Core/Iso8601.js @@ -19,7 +19,8 @@ define([ /** * Constants related to ISO8601 support. * - * @exports Iso8601 + * @namespace + * @alias Iso8601 * * @see {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601 on Wikipedia} * @see JulianDate diff --git a/Source/Core/KeyboardEventModifier.js b/Source/Core/KeyboardEventModifier.js index 5b3c2a73e545..b0132567f653 100644 --- a/Source/Core/KeyboardEventModifier.js +++ b/Source/Core/KeyboardEventModifier.js @@ -9,7 +9,8 @@ define([ * This enumerated type is for representing keyboard modifiers. These are keys * that are held down in addition to other event types. * - * @exports KeyboardEventModifier + * @namespace + * @alias KeyboardEventModifier */ var KeyboardEventModifier = { /** diff --git a/Source/Core/LagrangePolynomialApproximation.js b/Source/Core/LagrangePolynomialApproximation.js index 974cdf4caa96..37e15238e96f 100644 --- a/Source/Core/LagrangePolynomialApproximation.js +++ b/Source/Core/LagrangePolynomialApproximation.js @@ -7,7 +7,9 @@ define([ /** * An {@link InterpolationAlgorithm} for performing Lagrange interpolation. - * @exports LagrangePolynomialApproximation + * + * @namespace + * @alias LagrangePolynomialApproximation */ var LagrangePolynomialApproximation = { type : 'Lagrange' diff --git a/Source/Core/LinearApproximation.js b/Source/Core/LinearApproximation.js index 7b8f00930a2f..0b8f5fcd25f5 100644 --- a/Source/Core/LinearApproximation.js +++ b/Source/Core/LinearApproximation.js @@ -7,10 +7,11 @@ define([ DeveloperError) { "use strict"; - /** * An {@link InterpolationAlgorithm} for performing linear interpolation. - * @exports LinearApproximation + * + * @namespace + * @alias LinearApproximation */ var LinearApproximation = { type : 'Linear' diff --git a/Source/Core/Math.js b/Source/Core/Math.js index eefe36cdafbb..c500c0ee967d 100644 --- a/Source/Core/Math.js +++ b/Source/Core/Math.js @@ -13,7 +13,9 @@ define([ /** * Math functions. - * @exports CesiumMath + * + * @namespace + * @alias CesiumMath */ var CesiumMath = {}; diff --git a/Source/Core/Packable.js b/Source/Core/Packable.js index e90c8219755f..1ca2ca17b2a9 100644 --- a/Source/Core/Packable.js +++ b/Source/Core/Packable.js @@ -10,7 +10,8 @@ define([ * elements in an array. These methods and properties are expected to be * defined on a constructor function. * - * @exports Packable + * @namespace + * @alias Packable * * @see PackableForInterpolation */ diff --git a/Source/Core/PackableForInterpolation.js b/Source/Core/PackableForInterpolation.js index 82c3d8f20049..1d4d707e0f91 100644 --- a/Source/Core/PackableForInterpolation.js +++ b/Source/Core/PackableForInterpolation.js @@ -10,7 +10,8 @@ define([ * different representation than their packed value. These methods and * properties are expected to be defined on a constructor function. * - * @exports PackableForInterpolation + * @namespace + * @alias PackableForInterpolation * * @see Packable */ diff --git a/Source/Core/PixelFormat.js b/Source/Core/PixelFormat.js index 6e254871c253..e38add38fcbb 100644 --- a/Source/Core/PixelFormat.js +++ b/Source/Core/PixelFormat.js @@ -8,7 +8,8 @@ define([ /** * The format of a pixel, i.e., the number of components it has and what they represent. * - * @exports PixelFormat + * @namespace + * @alias PixelFormat */ var PixelFormat = { /** @@ -72,32 +73,32 @@ define([ * @private */ validate : function(pixelFormat) { - return ((pixelFormat === PixelFormat.DEPTH_COMPONENT) || - (pixelFormat === PixelFormat.DEPTH_STENCIL) || - (pixelFormat === PixelFormat.ALPHA) || - (pixelFormat === PixelFormat.RGB) || - (pixelFormat === PixelFormat.RGBA) || - (pixelFormat === PixelFormat.LUMINANCE) || - (pixelFormat === PixelFormat.LUMINANCE_ALPHA)); + return pixelFormat === PixelFormat.DEPTH_COMPONENT || + pixelFormat === PixelFormat.DEPTH_STENCIL || + pixelFormat === PixelFormat.ALPHA || + pixelFormat === PixelFormat.RGB || + pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.LUMINANCE || + pixelFormat === PixelFormat.LUMINANCE_ALPHA; }, /** * @private */ isColorFormat : function(pixelFormat) { - return ((pixelFormat === PixelFormat.ALPHA) || - (pixelFormat === PixelFormat.RGB) || - (pixelFormat === PixelFormat.RGBA) || - (pixelFormat === PixelFormat.LUMINANCE) || - (pixelFormat === PixelFormat.LUMINANCE_ALPHA)); + return pixelFormat === PixelFormat.ALPHA || + pixelFormat === PixelFormat.RGB || + pixelFormat === PixelFormat.RGBA || + pixelFormat === PixelFormat.LUMINANCE || + pixelFormat === PixelFormat.LUMINANCE_ALPHA; }, /** * @private */ isDepthFormat : function(pixelFormat) { - return ((pixelFormat === PixelFormat.DEPTH_COMPONENT) || - (pixelFormat === PixelFormat.DEPTH_STENCIL)); + return pixelFormat === PixelFormat.DEPTH_COMPONENT || + pixelFormat === PixelFormat.DEPTH_STENCIL; } }; diff --git a/Source/Core/PolylineVolumeGeometry.js b/Source/Core/PolylineVolumeGeometry.js index 858b2c5807b3..94d644153f42 100644 --- a/Source/Core/PolylineVolumeGeometry.js +++ b/Source/Core/PolylineVolumeGeometry.js @@ -185,7 +185,7 @@ define([ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. * @param {Number} [options.height=0] The distance between the ellipsoid surface and the positions. * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed. - * @param {Boolean} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. + * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. * * @see PolylineVolumeGeometry#createGeometry * diff --git a/Source/Core/PolylineVolumeOutlineGeometry.js b/Source/Core/PolylineVolumeOutlineGeometry.js index 7a0109bd6a10..dda891cd768a 100644 --- a/Source/Core/PolylineVolumeOutlineGeometry.js +++ b/Source/Core/PolylineVolumeOutlineGeometry.js @@ -100,7 +100,7 @@ define([ * @param {Number} options.shapePositions An array of positions that define the shape to be extruded along the polyline * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference. * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer. - * @param {Boolean} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. + * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners. * * @see PolylineVolumeOutlineGeometry#createGeometry * diff --git a/Source/Core/PrimitiveType.js b/Source/Core/PrimitiveType.js index 4d1317a4a4e7..5bb28e4728aa 100644 --- a/Source/Core/PrimitiveType.js +++ b/Source/Core/PrimitiveType.js @@ -8,7 +8,8 @@ define([ /** * The type of a geometric primitive, i.e., points, lines, and triangles. * - * @exports PrimitiveType + * @namespace + * @alias PrimitiveType */ var PrimitiveType = { /** @@ -18,6 +19,7 @@ define([ * @constant */ POINTS : 0x0000, + /** * 0x0001. Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected. * @@ -25,6 +27,7 @@ define([ * @constant */ LINES : 0x0001, + /** * 0x0002. Line loop primitive where each vertex (or index) after the first connects a line to * the previous vertex, and the last vertex implicitly connects to the first. @@ -33,6 +36,7 @@ define([ * @constant */ LINE_LOOP : 0x0002, + /** * 0x0003. Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex. * @@ -40,6 +44,7 @@ define([ * @constant */ LINE_STRIP : 0x0003, + /** * 0x0004. Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges. * @@ -47,6 +52,7 @@ define([ * @constant */ TRIANGLES : 0x0004, + /** * 0x0005. Triangle strip primitive where each vertex (or index) after the first two connect to * the previous two vertices forming a triangle. For example, this can be used to model a wall. @@ -55,6 +61,7 @@ define([ * @constant */ TRIANGLE_STRIP : 0x0005, + /** * 0x0006. Triangle fan primitive where each vertex (or index) after the first two connect to * the previous vertex and the first vertex forming a triangle. For example, this can be used @@ -69,13 +76,13 @@ define([ * @private */ validate : function(primitiveType) { - return ((primitiveType === PrimitiveType.POINTS) || - (primitiveType === PrimitiveType.LINES) || - (primitiveType === PrimitiveType.LINE_LOOP) || - (primitiveType === PrimitiveType.LINE_STRIP) || - (primitiveType === PrimitiveType.TRIANGLES) || - (primitiveType === PrimitiveType.TRIANGLE_STRIP) || - (primitiveType === PrimitiveType.TRIANGLE_FAN)); + return primitiveType === PrimitiveType.POINTS || + primitiveType === PrimitiveType.LINES || + primitiveType === PrimitiveType.LINE_LOOP || + primitiveType === PrimitiveType.LINE_STRIP || + primitiveType === PrimitiveType.TRIANGLES || + primitiveType === PrimitiveType.TRIANGLE_STRIP || + primitiveType === PrimitiveType.TRIANGLE_FAN; } }; diff --git a/Source/Core/QuadraticRealPolynomial.js b/Source/Core/QuadraticRealPolynomial.js index 7cd4fc7ba7b4..069a02eb531c 100644 --- a/Source/Core/QuadraticRealPolynomial.js +++ b/Source/Core/QuadraticRealPolynomial.js @@ -10,7 +10,8 @@ define([ /** * Defines functions for 2nd order polynomial functions of one variable with only real coefficients. * - * @exports QuadraticRealPolynomial + * @namespace + * @alias QuadraticRealPolynomial */ var QuadraticRealPolynomial = {}; diff --git a/Source/Core/QuarticRealPolynomial.js b/Source/Core/QuarticRealPolynomial.js index 3cb92cdf68e4..05408c381b5a 100644 --- a/Source/Core/QuarticRealPolynomial.js +++ b/Source/Core/QuarticRealPolynomial.js @@ -14,7 +14,8 @@ define([ /** * Defines functions for 4th order polynomial functions of one variable with only real coefficients. * - * @exports QuarticRealPolynomial + * @namespace + * @alias QuarticRealPolynomial */ var QuarticRealPolynomial = {}; diff --git a/Source/Core/Queue.js b/Source/Core/Queue.js index 9b20c63e9386..fbe33832e8ff 100644 --- a/Source/Core/Queue.js +++ b/Source/Core/Queue.js @@ -73,7 +73,7 @@ define(function() { /** * Sort the items in the queue in-place. * - * @param {Function} compareFunction a function that defines the sort order. + * @param {Queue~Comparator} compareFunction A function that defines the sort order. */ Queue.prototype.sort = function(compareFunction) { if (this._offset > 0) { @@ -85,5 +85,21 @@ define(function() { this._array.sort(compareFunction); }; + /** + * A function used to compare two items while sorting a queue. + * @callback Queue~Comparator + * + * @param {Object} a An item in the array. + * @param {Object} b An item in the array. + * @returns {Number} Returns a negative value if a is less than b, + * a positive value if a is greater than b, or + * 0 if a is equal to b. + * + * @example + * function compareNumbers(a, b) { + * return a - b; + * } + */ + return Queue; }); \ No newline at end of file diff --git a/Source/Core/ReferenceFrame.js b/Source/Core/ReferenceFrame.js index 15c7f7ead3b0..0a9d5788bfad 100644 --- a/Source/Core/ReferenceFrame.js +++ b/Source/Core/ReferenceFrame.js @@ -8,7 +8,8 @@ define([ /** * Constants for identifying well-known reference frames. * - * @exports ReferenceFrame + * @namespace + * @alias ReferenceFrame */ var ReferenceFrame = { /** diff --git a/Source/Core/ScreenSpaceEventType.js b/Source/Core/ScreenSpaceEventType.js index 2c98851934a4..36b1c1cd2dd3 100644 --- a/Source/Core/ScreenSpaceEventType.js +++ b/Source/Core/ScreenSpaceEventType.js @@ -8,7 +8,8 @@ define([ /** * This enumerated type is for classifying mouse events: down, up, click, double click, move and move while a button is held down. * - * @exports ScreenSpaceEventType + * @namespace + * @alias ScreenSpaceEventType */ var ScreenSpaceEventType = { /** diff --git a/Source/Core/Simon1994PlanetaryPositions.js b/Source/Core/Simon1994PlanetaryPositions.js index 523dd28de36d..3c3eaefc9ad9 100644 --- a/Source/Core/Simon1994PlanetaryPositions.js +++ b/Source/Core/Simon1994PlanetaryPositions.js @@ -20,8 +20,11 @@ define([ "use strict"; /** - * Contains functions for finding the Cartesian coordinates of the sun and the moon in the Earth-centered inertial frame. - * @exports Simon1994PlanetaryPositions + * Contains functions for finding the Cartesian coordinates of the sun and the moon in the + * Earth-centered inertial frame. + * + * @namespace + * @alias Simon1994PlanetaryPositions */ var Simon1994PlanetaryPositions = {}; diff --git a/Source/Core/TileProviderError.js b/Source/Core/TileProviderError.js index 17f718e4d716..6497fa741264 100644 --- a/Source/Core/TileProviderError.js +++ b/Source/Core/TileProviderError.js @@ -94,7 +94,7 @@ define([ * error is not specific to a particular tile. * @param {Number} level The level-of-detail of the tile that experienced the error, or undefined if the * error is not specific to a particular tile. - * @param {Function} retryFunction The function to call to retry the operation. If undefined, the + * @param {TileProviderError~RetryFunction} retryFunction The function to call to retry the operation. If undefined, the * operation will not be retried. * @returns {TileProviderError} The error instance that was passed to the event listeners and that * should be passed to this function the next time it is called for the same error in order @@ -141,5 +141,10 @@ define([ } }; + /** + * A function that will be called to retry the operation. + * @callback TileProviderError~RetryFunction + */ + return TileProviderError; }); diff --git a/Source/Core/TimeConstants.js b/Source/Core/TimeConstants.js index 4f0c9c636d16..49cb0006b009 100644 --- a/Source/Core/TimeConstants.js +++ b/Source/Core/TimeConstants.js @@ -8,7 +8,8 @@ define([ /** * Constants for time conversions like those done by {@link JulianDate}. * - * @exports TimeConstants + * @namespace + * @alias TimeConstants * * @see JulianDate * diff --git a/Source/Core/TimeStandard.js b/Source/Core/TimeStandard.js index bf1c7f579038..f755a049c77c 100644 --- a/Source/Core/TimeStandard.js +++ b/Source/Core/TimeStandard.js @@ -8,7 +8,8 @@ define([ /** * Provides the type of time standards which JulianDate can take as input. * - * @exports TimeStandard + * @namespace + * @alias TimeStandard * * @see JulianDate */ diff --git a/Source/Core/Tipsify.js b/Source/Core/Tipsify.js index a5f42188c271..24a3b66df03d 100644 --- a/Source/Core/Tipsify.js +++ b/Source/Core/Tipsify.js @@ -15,7 +15,8 @@ define([ * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.' * The runtime is linear but several passes are made. * - * @exports Tipsify + * @namespace + * @alias Tipsify * * @see * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw diff --git a/Source/Core/Transforms.js b/Source/Core/Transforms.js index 5146fa985f82..14db87b67660 100644 --- a/Source/Core/Transforms.js +++ b/Source/Core/Transforms.js @@ -39,7 +39,9 @@ define([ /** * Contains functions for transforming positions to various reference frames. - * @exports Transforms + * + * @namespace + * @alias Transforms */ var Transforms = {}; diff --git a/Source/Core/TridiagonalSystemSolver.js b/Source/Core/TridiagonalSystemSolver.js index bd981f1c0bcc..be2344c759e2 100644 --- a/Source/Core/TridiagonalSystemSolver.js +++ b/Source/Core/TridiagonalSystemSolver.js @@ -13,7 +13,8 @@ define([ * Uses the Tridiagonal Matrix Algorithm, also known as the Thomas Algorithm, to solve * a system of linear equations where the coefficient matrix is a tridiagonal matrix. * - * @exports TridiagonalSystemSolver + * @namespace + * @alias TridiagonalSystemSolver */ var TridiagonalSystemSolver = {}; diff --git a/Source/Core/Visibility.js b/Source/Core/Visibility.js index 3260f4679a95..7ed6bea64843 100644 --- a/Source/Core/Visibility.js +++ b/Source/Core/Visibility.js @@ -11,7 +11,8 @@ define([ * it has no visibility, may partially block an occludee from view, or may not block it at all, * leading to full visibility. * - * @exports Visibility + * @namespace + * @alias Visibility */ var Visibility = { /** diff --git a/Source/Core/WindingOrder.js b/Source/Core/WindingOrder.js index 36a88b2a7970..7df9d51e4d6a 100644 --- a/Source/Core/WindingOrder.js +++ b/Source/Core/WindingOrder.js @@ -8,7 +8,8 @@ define([ /** * Winding order defines the order of vertices for a triangle to be considered front-facing. * - * @exports WindingOrder + * @namespace + * @alias WindingOrder */ var WindingOrder = { /** @@ -18,6 +19,7 @@ define([ * @constant */ CLOCKWISE : 0x0900, // WebGL: CW + /** * 0x0901. Vertices are in counter-clockwise order. * @@ -30,8 +32,8 @@ define([ * @private */ validate : function(windingOrder) { - return ((windingOrder === WindingOrder.CLOCKWISE) || - (windingOrder === WindingOrder.COUNTER_CLOCKWISE)); + return windingOrder === WindingOrder.CLOCKWISE || + windingOrder === WindingOrder.COUNTER_CLOCKWISE; } }; diff --git a/Source/Core/barycentricCoordinates.js b/Source/Core/barycentricCoordinates.js index 500f631549c7..7b21bdcc92a6 100644 --- a/Source/Core/barycentricCoordinates.js +++ b/Source/Core/barycentricCoordinates.js @@ -18,7 +18,7 @@ define([ /** * Computes the barycentric coordinates for a point with respect to a triangle. * - * @exports pointInsideTriangle + * @exports barycentricCoordinates * * @param {Cartesian2|Cartesian3} point The point to test. * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis. diff --git a/Source/Core/binarySearch.js b/Source/Core/binarySearch.js index a82aebb76081..36ab5eb1794e 100644 --- a/Source/Core/binarySearch.js +++ b/Source/Core/binarySearch.js @@ -14,12 +14,8 @@ define([ * * @param {Array} array The sorted array to search. * @param {Object} itemToFind The item to find in the array. - * - * @param {Function} comparator The function to use to compare the item to elements in the array. - * The first parameter passed to the comparator function is an item in the array, the - * second is itemToFind. If the array item is less than itemToFind, - * the function should return a negative value. If it is greater, the function should return - * a positive value. If the items are equal, it should return 0. + * @param {binarySearch~Comparator} comparator The function to use to compare the item to + * elements in the array. * @returns {Number} The index of itemToFind in the array, if it exists. If itemToFind * does not exist, the return value is a negative number which is the bitwise complement (~) * of the index before which the itemToFind should be inserted in order to maintain the @@ -27,7 +23,7 @@ define([ * * @example * // Create a comparator function to search through an array of numbers. - * var comparator = function (a, b) { + * var comparator = function(a, b) { * return a - b; * }; * var numbers = [0, 2, 4, 6, 8]; @@ -67,5 +63,21 @@ define([ return ~(high + 1); }; + /** + * A function used to compare two items while performing a binary search. + * @callback binarySearch~Comparator + * + * @param {Object} a An item in the array. + * @param {Object} b The item being searched for. + * @returns {Number} Returns a negative value if a is less than b, + * a positive value if a is greater than b, or + * 0 if a is equal to b. + * + * @example + * function compareNumbers(a, b) { + * return a - b; + * } + */ + return binarySearch; }); \ No newline at end of file diff --git a/Source/Core/mergeSort.js b/Source/Core/mergeSort.js index fbcb77373325..b0ae7569e0ce 100644 --- a/Source/Core/mergeSort.js +++ b/Source/Core/mergeSort.js @@ -60,18 +60,15 @@ define([ * @exports mergeSort * * @param {Array} array The array to sort. - * @param {Function} comparator The function to use to compare the item to elements in the array. - * If the first parameter is less than the second parameter, the function should return a - * negative value. If it is greater, the function should return a positive value. If the - * items are equal, it should return 0. - * @param {Object} [userDefinedObject] An object to pass as the third parameter to comparator. + * @param {mergeSort~Comparator} comparator The function to use to compare elements in the array. + * @param {Object} [userDefinedObject] An object to pass as the third parameter to comparator. * * @example - * // Sort an array of numbers in increasing order - * var array = // Array of bounding spheres in world coordinates + * // Assume array contains BoundingSpheres in world coordinates. + * // Sort them in ascending order of distance from the camera. * var position = camera.positionWC; - * mergeSort(array, function(a, b, position) { - * return BoundingSphere.distanceSquaredTo(b.sphere, position) - BounsingSphere.distanceSquaredTo(a.sphere, position); + * Cesium.mergeSort(array, function(a, b, position) { + * return Cesium.BoundingSphere.distanceSquaredTo(b, position) - Cesium.BoundingSphere.distanceSquaredTo(a, position); * }, position); */ var mergeSort = function(array, comparator, userDefinedObject) { @@ -98,5 +95,22 @@ define([ rightScratchArray.length = 0; }; + /** + * A function used to compare two items while performing a merge sort. + * @callback mergeSort~Comparator + * + * @param {Object} a An item in the array. + * @param {Object} b An item in the array. + * @param {Object} [userDefinedObject] An object that was passed to {@link mergeSort}. + * @returns {Number} Returns a negative value if a is less than b, + * a positive value if a is greater than b, or + * 0 if a is equal to b. + * + * @example + * function compareNumbers(a, b, userDefinedObject) { + * return a - b; + * } + */ + return mergeSort; }); \ No newline at end of file diff --git a/Source/Core/requestAnimationFrame.js b/Source/Core/requestAnimationFrame.js index 887ebc24f0a3..2e89f43db127 100644 --- a/Source/Core/requestAnimationFrame.js +++ b/Source/Core/requestAnimationFrame.js @@ -43,7 +43,7 @@ define([ * * @exports requestAnimationFrame * - * @param {Function} callback The function to call when animation is ready. + * @param {requestAnimationFrame~Callback} callback The function to call when the next frame should be drawn. * @returns An ID that can be passed to {@link cancelAnimationFrame} to cancel the request. * * @see {@link http://www.w3.org/TR/animation-timing/#the-WindowAnimationTiming-interface|The WindowAnimationTiming interface} @@ -64,5 +64,12 @@ define([ return implementation(callback); }; + /** + * A function that will be called when the next frame should be drawn. + * @callback requestAnimationFrame~Callback + * + * @param {Number} timestamp A timestamp for the frame, in milliseconds. + */ + return requestAnimationFrame; }); \ No newline at end of file diff --git a/Source/Core/throttleRequestByServer.js b/Source/Core/throttleRequestByServer.js index faed3ce61fc2..6a690a9926a8 100644 --- a/Source/Core/throttleRequestByServer.js +++ b/Source/Core/throttleRequestByServer.js @@ -23,36 +23,37 @@ define([ /** * Because browsers throttle the number of parallel requests allowed to each server, - * this function tracks the number of active requests that have been made, and + * this function tracks the number of active requests in progress to each server, and * returns undefined immediately if the request would exceed the maximum, allowing - * the caller to retry later. + * the caller to retry later, instead of queueing indefinitely under the browser's control. * * @exports throttleRequestByServer * * @param {String} url The URL to request. - * @param {Function} requestFunction The actual function that makes the request. - * This function is expected to return a Promise for the requested data. - * @returns {Promise} Either undefined, meaning the request would exceed the maximum - * number of parallel requests, or a Promise that returns the requested data. + * @param {throttleRequestByServer~RequestFunction} requestFunction The actual function that + * makes the request. + * @returns {Promise} Either undefined, meaning the request would exceed the maximum number of + * parallel requests, or a Promise for the requested data. * * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A} * * @example * // throttle requests for an image - * var promise = Cesium.throttleRequestByServer( - * 'http://madeupserver.agi.com/myImage.png', - * function(url) { - * return Cesium.loadImage(url); - * }); + * var url = 'http://madeupserver.example.com/myImage.png'; + * var requestFunction = function(url) { + * // in this simple example, loadImage could be used directly as requestFunction. + * return Cesium.loadImage(url); + * }; + * var promise = Cesium.throttleRequestByServer(url, requestFunction); * if (!Cesium.defined(promise)) { - * // too many active requests, try again later. + * // too many active requests in progress, try again later. * } else { - * Cesium.when(promise, function(image) { - * // handle loaded image - * }); + * promise.then(function(image) { + * // handle loaded image + * }); * } */ - function throttleRequestByServer(url, requestFunction) { + var throttleRequestByServer = function(url, requestFunction) { var server = getServer(url); var activeRequestsForServer = defaultValue(activeRequests[server], 0); @@ -65,11 +66,19 @@ define([ return when(requestFunction(url), function(result) { activeRequests[server]--; return result; - }, function(error) { + }).otherwise(function(error) { activeRequests[server]--; return when.reject(error); }); - } + }; + + /** + * A function that will make a request if there are available slots to the server. + * @callback throttleRequestByServer~RequestFunction + * + * @param {String} url The url to request. + * @returns {Promise} A promise for the requested data. + */ return throttleRequestByServer; }); \ No newline at end of file diff --git a/Source/DynamicScene/DataSourceDisplay.js b/Source/DynamicScene/DataSourceDisplay.js index 99ac5e6a4a58..8128e13fb9ae 100644 --- a/Source/DynamicScene/DataSourceDisplay.js +++ b/Source/DynamicScene/DataSourceDisplay.js @@ -50,8 +50,8 @@ define([ * * @param {Scene} scene The scene in which to display the data. * @param {DataSourceCollection} dataSourceCollection The data sources to display. - * @param {Function} [visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] A function - * which takes a scene and dataSource and returns the array of visualizers used for visualization. + * @param {DataSourceDisplay~VisualizersCallback} [visualizersCallback=DataSourceDisplay.defaultVisualizersCallback] + * A function which creates an array of visualizers used for visualization. * If undefined, all standard visualizers are used. */ var DataSourceDisplay = function(scene, dataSourceCollection, visualizersCallback) { @@ -78,10 +78,11 @@ define([ }; /** - * Gets or sets the default function which takes a scene and dataSource and returns the - * array of visualizers used for visualization. By default, this function uses all standard visualizers. + * Gets or sets the default function which creates an array of visualizers used for visualization. + * By default, this function uses all standard visualizers. * - * @type {Function} + * @member + * @type {DataSourceDisplay~VisualizersCallback} */ DataSourceDisplay.defaultVisualizersCallback = function(scene, dataSource) { var dynamicObjects = dataSource.dynamicObjects; @@ -211,5 +212,19 @@ define([ } }; + /** + * A function which creates an array of visualizers used for visualization. + * @callback DataSourceDisplay~VisualizersCallback + * + * @param {Scene} scene The scene to create visualizers for. + * @param {DataSource} dataSource The data source to create visualizers for. + * @returns {Visualizer[]} An array of visualizers used for visualization. + * + * @example + * function createVisualizers(scene, dataSource) { + * return [new DynamicBillboardVisualizer(scene, dataSource.dynamicObjects)]; + * } + */ + return DataSourceDisplay; }); diff --git a/Source/DynamicScene/StripeOrientation.js b/Source/DynamicScene/StripeOrientation.js index 36d125bc723a..5bca88fa0269 100644 --- a/Source/DynamicScene/StripeOrientation.js +++ b/Source/DynamicScene/StripeOrientation.js @@ -8,7 +8,8 @@ define([ /** * Defined the orientation of stripes in {@link StripeMaterialProperty}. * - * @exports StripeOrientation + * @namespace + * @alias StripeOrientation */ var StripeOrientation = { /** @@ -16,6 +17,7 @@ define([ * @type {Number} */ HORIZONTAL : 0, + /** * Vertical orientation. * @type {Number} diff --git a/Source/Scene/BingMapsStyle.js b/Source/Scene/BingMapsStyle.js index 52f0cce6bbbc..683caa93bb34 100644 --- a/Source/Scene/BingMapsStyle.js +++ b/Source/Scene/BingMapsStyle.js @@ -8,7 +8,8 @@ define([ /** * The types of imagery provided by Bing Maps. * - * @exports BingMapsStyle + * @namespace + * @alias BingMapsStyle * * @see BingMapsImageryProvider */ diff --git a/Source/Scene/BlendEquation.js b/Source/Scene/BlendEquation.js index 6a8288945f31..a5128b7a09ba 100644 --- a/Source/Scene/BlendEquation.js +++ b/Source/Scene/BlendEquation.js @@ -8,7 +8,8 @@ define([ /** * Determines how two pixels' values are combined. * - * @exports BlendEquation + * @namespace + * @alias BlendEquation */ var BlendEquation = { /** diff --git a/Source/Scene/BlendFunction.js b/Source/Scene/BlendFunction.js index 92ceb78e6270..fd46da06436c 100644 --- a/Source/Scene/BlendFunction.js +++ b/Source/Scene/BlendFunction.js @@ -8,7 +8,8 @@ define([ /** * Determines how blending factors are computed. * - * @exports BlendFunction + * @namespace + * @alias BlendFunction */ var BlendFunction = { /** diff --git a/Source/Scene/BlendingState.js b/Source/Scene/BlendingState.js index a9941f2ac9ce..f0425dc81327 100644 --- a/Source/Scene/BlendingState.js +++ b/Source/Scene/BlendingState.js @@ -17,7 +17,8 @@ define([ * This is a helper when using custom render states with {@link Appearance#renderState}. *

* - * @exports BlendingState + * @namespace + * @alias BlendingState */ var BlendingState = { /** diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index 8980a40451b3..bdd593a38c17 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -2018,8 +2018,8 @@ define([ * @param {Cartesian3} [options.direction] The final direction of the camera in WGS84 (world) coordinates. By default, the direction will point towards the center of the frame in 3D and in the negative z direction in Columbus view or 2D. * @param {Cartesian3} [options.up] The final up direction in WGS84 (world) coordinates. By default, the up direction will point towards local north in 3D and in the positive y direction in Columbus view or 2D. * @param {Number} [options.duration=3.0] The duration of the flight in seconds. - * @param {Function} [options.complete] The function to execute when the flight is complete. - * @param {Function} [options.cancel] The function to execute if the flight is cancelled. + * @param {Camera~FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. + * @param {Camera~FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed. * @param {Boolean} [options.convert=true] When true, the destination is converted to the correct coordinate system for each scene mode. When false, the destination is expected * to be in the correct coordinate system. @@ -2037,8 +2037,8 @@ define([ * @param {Object} options Object with the following properties: * @param {Rectangle} options.destination The rectangle to view, in WGS84 (world) coordinates, which determines the final position of the camera. * @param {Number} [options.duration=3.0] The duration of the flight in seconds. - * @param {Function} [options.complete] The function to execute when the flight is complete. - * @param {Function} [options.cancel] The function to execute if the flight is cancelled. + * @param {Camera~FlightCompleteCallback} [options.complete] The function to execute when the flight is complete. + * @param {Camera~FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled. * @param {Matrix4} [endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed. */ Camera.prototype.flyToRectangle = function(options) { @@ -2062,5 +2062,15 @@ define([ return camera; }; + /** + * A function that will execute when a flight completes. + * @callback Camera~FlightCompleteCallback + */ + + /** + * A function that will execute when a flight is cancelled. + * @callback Camera~FlightCancelledCallback + */ + return Camera; }); diff --git a/Source/Scene/CameraEventType.js b/Source/Scene/CameraEventType.js index ccc9da752d01..2b4c3c239d6a 100644 --- a/Source/Scene/CameraEventType.js +++ b/Source/Scene/CameraEventType.js @@ -8,7 +8,8 @@ define([ /** * Enumerates the available input for interacting with the camera. * - * @exports CameraEventType + * @namespace + * @alias CameraEventType */ var CameraEventType = { /** diff --git a/Source/Scene/CullFace.js b/Source/Scene/CullFace.js index 7c0fad6e6744..17a42f7c2e11 100644 --- a/Source/Scene/CullFace.js +++ b/Source/Scene/CullFace.js @@ -8,7 +8,8 @@ define([ /** * Determines which triangles, if any, are culled. * - * @exports CullFace + * @namespace + * @alias CullFace */ var CullFace = { /** diff --git a/Source/Scene/DepthFunction.js b/Source/Scene/DepthFunction.js index 9e83c84b9544..9bc928bcb632 100644 --- a/Source/Scene/DepthFunction.js +++ b/Source/Scene/DepthFunction.js @@ -8,7 +8,8 @@ define([ /** * Determines the function used to compare two depths for the depth test. * - * @exports DepthFunction + * @namespace + * @alias DepthFunction */ var DepthFunction = { /** diff --git a/Source/Scene/FrameState.js b/Source/Scene/FrameState.js index cebd4503d1b2..726598155288 100644 --- a/Source/Scene/FrameState.js +++ b/Source/Scene/FrameState.js @@ -108,7 +108,7 @@ define([ * directly in update functions. *

* - * @type {Function[]} + * @type {FrameState~AfterRenderCallback[]} * * @example * frameState.afterRender.push(function() { @@ -118,5 +118,10 @@ define([ this.afterRender = []; }; + /** + * A function that will be called at the end of the frame. + * @callback FrameState~AfterRenderCallback + */ + return FrameState; }); diff --git a/Source/Scene/HorizontalOrigin.js b/Source/Scene/HorizontalOrigin.js index b19db2d3abe5..124d99aa63f2 100644 --- a/Source/Scene/HorizontalOrigin.js +++ b/Source/Scene/HorizontalOrigin.js @@ -10,7 +10,8 @@ define([ * For example, the horizontal origin is used to display a billboard to the left or right (in * screen space) of the actual position. * - * @exports HorizontalOrigin + * @namespace + * @alias HorizontalOrigin * * @see Billboard#horizontalOrigin */ diff --git a/Source/Scene/LabelStyle.js b/Source/Scene/LabelStyle.js index f98c4ab9968a..ca944e778e20 100644 --- a/Source/Scene/LabelStyle.js +++ b/Source/Scene/LabelStyle.js @@ -8,7 +8,8 @@ define([ /** * Describes how to draw a label. * - * @exports LabelStyle + * @namespace + * @alias LabelStyle * * @see Label#style */ diff --git a/Source/Scene/ModelAnimationLoop.js b/Source/Scene/ModelAnimationLoop.js index 31f8b8466f84..3703bb22c0bc 100644 --- a/Source/Scene/ModelAnimationLoop.js +++ b/Source/Scene/ModelAnimationLoop.js @@ -8,7 +8,8 @@ define([ /** * Determines if and how a glTF animation is looped. * - * @exports ModelAnimationLoop + * @namespace + * @alias ModelAnimationLoop * * @see ModelAnimationCollection#add */ diff --git a/Source/Scene/SceneMode.js b/Source/Scene/SceneMode.js index 0c770e93260c..f3a5cee6355f 100644 --- a/Source/Scene/SceneMode.js +++ b/Source/Scene/SceneMode.js @@ -8,7 +8,8 @@ define([ /** * Indicates if the scene is viewed in 3D, 2D, or 2.5D Columbus view. * - * @exports SceneMode + * @namespace + * @alias SceneMode * * @see Scene#mode */ @@ -45,7 +46,6 @@ define([ * @constant */ SCENE3D : 3 - }; /** diff --git a/Source/Scene/SceneTransforms.js b/Source/Scene/SceneTransforms.js index 417ac4f3ce2c..8ec97895a12d 100644 --- a/Source/Scene/SceneTransforms.js +++ b/Source/Scene/SceneTransforms.js @@ -26,7 +26,8 @@ define([ /** * Functions that do scene-dependent transforms between rendering-related coordinate systems. * - * @exports SceneTransforms + * @namespace + * @alias SceneTransforms */ var SceneTransforms = {}; diff --git a/Source/Scene/StencilFunction.js b/Source/Scene/StencilFunction.js index 75dde1dabcbc..aed07a18af3b 100644 --- a/Source/Scene/StencilFunction.js +++ b/Source/Scene/StencilFunction.js @@ -8,7 +8,8 @@ define([ /** * Determines the function used to compare stencil values for the stencil test. * - * @exports StencilFunction + * @namespace + * @alias StencilFunction */ var StencilFunction = { /** diff --git a/Source/Scene/StencilOperation.js b/Source/Scene/StencilOperation.js index 8a8b9a5515e8..d39d74f9cf0c 100644 --- a/Source/Scene/StencilOperation.js +++ b/Source/Scene/StencilOperation.js @@ -8,7 +8,8 @@ define([ /** * Determines the action taken based on the result of the stencil test. * - * @exports StencilOperation + * @namespace + * @alias StencilOperation */ var StencilOperation = { /** diff --git a/Source/Scene/TweenCollection.js b/Source/Scene/TweenCollection.js index 2d73bc8c99b8..c8051933fd14 100644 --- a/Source/Scene/TweenCollection.js +++ b/Source/Scene/TweenCollection.js @@ -45,9 +45,10 @@ define([ this._complete = complete; /** - * The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * The callback to call if the tween is canceled either because {@link Tween#cancelTween} + * was called or because the tween was removed from the collection. * - * @type {Function} + * @type {TweenCollection~TweenCancelledCallback} */ this.cancel = cancel; @@ -127,7 +128,7 @@ define([ * The callback to call at each animation update (usually tied to the a rendered frame). * @memberof Tween.prototype * - * @type {Function} + * @type {TweenCollection~TweenUpdateCallback} * @readonly */ update : { @@ -140,7 +141,7 @@ define([ * The callback to call when the tween finishes animating. * @memberof Tween.prototype * - * @type {Function} + * @type {TweenCollection~TweenCompleteCallback} * @readonly */ complete : { @@ -206,9 +207,9 @@ define([ * @param {Number} options.duration The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {Function} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {Function} [options.complete] The callback to call when the tween finishes animating. - * @param {Function} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} options.duration must be positive. @@ -268,9 +269,9 @@ define([ * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {Function} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {Function} [options.complete] The callback to call when the tween finishes animating. - * @param {Function} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} options.object must have the specified property. @@ -328,9 +329,9 @@ define([ * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {Function} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {Function} [options.complete] The callback to call when the tween finishes animating. - * @param {Function} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection~TweenCompleteCallback} [options.complete] The callback to call when the tween finishes animating. + * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} material has no properties with alpha components. @@ -397,8 +398,8 @@ define([ * @param {Number} [options.duration=3.0] The duration, in seconds, for the tween. The tween is automatically removed from the collection when it stops. * @param {Number} [options.delay=0.0] The delay, in seconds, before the tween starts animating. * @param {EasingFunction} [options.easingFunction=EasingFunction.LINEAR_NONE] Determines the curve for animtion. - * @param {Function} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). - * @param {Function} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. + * @param {TweenCollection~TweenUpdateCallback} [options.update] The callback to call at each animation update (usually tied to the a rendered frame). + * @param {TweenCollection~TweenCancelledCallback} [options.cancel] The callback to call if the tween is canceled either because {@link Tween#cancelTween} was called or because the tween was removed from the collection. * @returns {Tween} The tween. * * @exception {DeveloperError} material.uniforms must have an offset property. @@ -545,5 +546,20 @@ define([ } }; + /** + * A function that will execute when a tween completes. + * @callback TweenCollection~TweenCompleteCallback + */ + + /** + * A function that will execute when a tween updates. + * @callback TweenCollection~TweenUpdateCallback + */ + + /** + * A function that will execute when a tween is cancelled. + * @callback TweenCollection~TweenCancelledCallback + */ + return TweenCollection; }); \ No newline at end of file diff --git a/Source/Scene/VerticalOrigin.js b/Source/Scene/VerticalOrigin.js index 25d560f8583e..2417713f9f80 100644 --- a/Source/Scene/VerticalOrigin.js +++ b/Source/Scene/VerticalOrigin.js @@ -10,7 +10,8 @@ define([ * For example, the vertical origin is used to display a billboard above or below (in * screen space) of the actual position. * - * @exports VerticalOrigin + * @namespace + * @alias VerticalOrigin * * @see Billboard#verticalOrigin */ diff --git a/Source/Widgets/Animation/AnimationViewModel.js b/Source/Widgets/Animation/AnimationViewModel.js index 2aaf72455e2e..884b1833224d 100644 --- a/Source/Widgets/Animation/AnimationViewModel.js +++ b/Source/Widgets/Animation/AnimationViewModel.js @@ -365,11 +365,10 @@ define([ }; /** - * The default date formatter used by new instances. + * Gets or sets the default date formatter used by new instances. * - * @param {JulianDate} date The date to be formatted - * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. - * @returns {String} The string representation of the calendar date portion of the provided date. + * @member + * @type {AnimationViewModel~DateFormatter} */ AnimationViewModel.defaultDateFormatter = function(date, viewModel) { var gregorianDate = JulianDate.toGregorianDate(date); @@ -385,11 +384,10 @@ define([ 21600.0, 43200.0, 86400.0, 172800.0, 345600.0, 604800.0]; /** - * The default time formatter used by new instances. + * Gets or sets the default time formatter used by new instances. * - * @param {JulianDate} date The date to be formatted - * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. - * @returns {String} The string representation of the time portion of the provided date. + * @member + * @type {AnimationViewModel~TimeFormatter} */ AnimationViewModel.defaultTimeFormatter = function(date, viewModel) { var gregorianDate = JulianDate.toGregorianDate(date); @@ -538,12 +536,11 @@ define([ }, /** - * Gets or sets the current date formatting function, which takes a - * {@link JulianDate} and an AnimationViewModel instance and - * returns a string representation of the calendar date portion. + * Gets or sets the function which formats a date for display. * @memberof AnimationViewModel.prototype * - * @type {Function} + * @type {AnimationViewModel~DateFormatter} + * @default AnimationViewModel.defaultDateFormatter */ dateFormatter : { //TODO:@exception {DeveloperError} dateFormatter must be a function. @@ -562,12 +559,11 @@ define([ }, /** - * Gets or sets the current time formatting function, which takes a - * {@link JulianDate} and an AnimationViewModel instance and - * returns a string representation of the time portion. + * Gets or sets the function which formats a time for display. * @memberof AnimationViewModel.prototype * - * @type {Function} + * @type {AnimationViewModel~TimeFormatter} + * @default AnimationViewModel.defaultTimeFormatter */ timeFormatter : { //TODO:@exception {DeveloperError} timeFormatter must be a function. @@ -590,5 +586,23 @@ define([ AnimationViewModel._maxShuttleRingAngle = maxShuttleRingAngle; AnimationViewModel._realtimeShuttleRingAngle = realtimeShuttleRingAngle; + /** + * A function that formats a date for display. + * @callback AnimationViewModel~DateFormatter + * + * @param {JulianDate} date The date to be formatted + * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. + * @returns {String} The string representation of the calendar date portion of the provided date. + */ + + /** + * A function that formats a time for display. + * @callback AnimationViewModel~TimeFormatter + * + * @param {JulianDate} date The date to be formatted + * @param {AnimationViewModel} viewModel The AnimationViewModel instance requesting formatting. + * @returns {String} The string representation of the time portion of the provided date. + */ + return AnimationViewModel; }); diff --git a/Source/Widgets/BaseLayerPicker/ProviderViewModel.js b/Source/Widgets/BaseLayerPicker/ProviderViewModel.js index ca7e3a33a929..7c169b88b9a5 100644 --- a/Source/Widgets/BaseLayerPicker/ProviderViewModel.js +++ b/Source/Widgets/BaseLayerPicker/ProviderViewModel.js @@ -14,7 +14,7 @@ define([ "use strict"; /** - * A view model that represents each item in the BaseLayerPicker. + * A view model that represents each item in the {@link BaseLayerPicker}. * * @alias ProviderViewModel * @constructor @@ -23,10 +23,12 @@ define([ * @param {String} options.name The name of the layer. * @param {String} options.tooltip The tooltip to show when the item is moused over. * @param {String} options.iconUrl An icon representing the layer. - * @param {Function|Command} options.creationFunction A function or Command which creates the ImageryProvider or array of ImageryProviders to be added to the layers collection. + * @param {ProviderViewModel~CreationFunction|Command} options.creationFunction A function or Command + * that creates one or more providers which will be added to the globe when this item is selected. * * @see BaseLayerPicker * @see ImageryProvider + * @see TerrainProvider */ var ProviderViewModel = function(options) { //>>includeStart('debug', pragmas.debug); @@ -74,8 +76,8 @@ define([ defineProperties(ProviderViewModel.prototype, { /** - * Gets the Command called to create the imagery provider or array of - * imagery providers to be added to the bottom of the layer collection. + * Gets the Command that creates one or more providers which will be added to + * the globe when this item is selected. * @memberof ProviderViewModel.prototype * * @type {Command} @@ -87,5 +89,13 @@ define([ } }); + /** + * A function which creates one or more providers. + * @callback ProviderViewModel~CreationFunction + * @returns {ImageryProvider|TerrainProvider|ImageryProvider[]|TerrainProvider[]} + * The ImageryProvider or TerrainProvider, or array of providers, to be added + * to the globe. + */ + return ProviderViewModel; }); diff --git a/Source/Widgets/InfoBox/InfoBoxViewModel.js b/Source/Widgets/InfoBox/InfoBoxViewModel.js index b7642a8af2f7..c4be8183eae7 100644 --- a/Source/Widgets/InfoBox/InfoBoxViewModel.js +++ b/Source/Widgets/InfoBox/InfoBoxViewModel.js @@ -153,8 +153,8 @@ define([ * By default, the Google Caja HTML/CSS sanitizer is loaded in a worker. * A specific instance can override this property by setting its sanitizer property. * - * This property returns a function which takes a unsanitized HTML String and returns a - * sanitized String, or a Promise which resolves to the sanitized version. + * @member + * @type {InfoBoxViewModel~Sanitizer} */ InfoBoxViewModel.defaultSanitizer = defaultSanitizer; @@ -182,7 +182,7 @@ define([ /** * Gets the HTML sanitization function to use for the selection description. * @memberof InfoBoxViewModel.prototype - * @type {Function} + * @type {InfoBoxViewModel~Sanitizer} */ sanitizer : { get : function() { @@ -198,5 +198,16 @@ define([ } }); + /** + * A function that sanitizes HTML from a potentially untrusted source, for display in the + * info box. + * @callback InfoBoxViewModel~Sanitizer + * + * @param {String} rawHTML Raw HTML to display. + * @returns {String|Promise} Sanitized HTML, or a Promise for sanitized HTML. + * + * @see InfoBoxViewModel.defaultSanitizer + */ + return InfoBoxViewModel; }); diff --git a/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js b/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js index e2c4ad898167..9a8d7d8c3f50 100644 --- a/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js +++ b/Source/Widgets/SelectionIndicator/SelectionIndicatorViewModel.js @@ -51,9 +51,6 @@ define([ this._tweens = scene.tweens; this._container = defaultValue(container, document.body); this._selectionIndicatorElement = selectionIndicatorElement; - this._computeScreenSpacePosition = function(position, result) { - return SceneTransforms.wgs84ToWindowCoordinates(scene, position, result); - }; this._scale = 1; /** @@ -87,6 +84,22 @@ define([ return 'scale(' + (this._scale) + ')'; } }); + + /** + * Gets or sets the function for converting the world position of the object to the screen space position. + * + * @member + * @type {SelectionIndicatorViewModel~ComputeScreenSpacePosition} + * @default SceneTransforms.wgs84ToWindowCoordinates + * + * @example + * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) { + * return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result); + * }; + */ + this.computeScreenSpacePosition = function(position, result) { + return SceneTransforms.wgs84ToWindowCoordinates(scene, position, result); + }; }; /** @@ -95,7 +108,7 @@ define([ */ SelectionIndicatorViewModel.prototype.update = function() { if (this.showSelection && defined(this.position)) { - var screenPosition = this._computeScreenSpacePosition(this.position, screenSpacePos); + var screenPosition = this.computeScreenSpacePosition(this.position, screenSpacePos); var container = this._container; var containerWidth = container.parentNode.clientWidth; var containerHeight = container.parentNode.clientHeight; @@ -150,6 +163,7 @@ define([ return this._container; } }, + /** * Gets the HTML element that holds the selection indicator. * @memberof SelectionIndicatorViewModel.prototype @@ -161,6 +175,7 @@ define([ return this._selectionIndicatorElement; } }, + /** * Gets the scene being used. * @memberof SelectionIndicatorViewModel.prototype @@ -171,32 +186,16 @@ define([ get : function() { return this._scene; } - }, - /** - * Gets or sets the function for converting the world position of the object to the screen space position. - * Expects the {@link Cartesian3} parameter for the position and the optional {@link Cartesian2} parameter for the result. - * Should return a {@link Cartesian2}. - * - * Defaults to SceneTransforms.wgs84ToWindowCoordinates - * - * @example - * selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) { - * return Cesium.Cartesian2.clone(position, result); - * }; - * - * @memberof SelectionIndicatorViewModel.prototype - * - * @type {Function} - */ - computeScreenSpacePosition : { - get : function() { - return this._computeScreenSpacePosition; - }, - set : function(value) { - this._computeScreenSpacePosition = value; - } } }); + /** + * A function that converts the world position of an object to a screen space position. + * @callback SelectionIndicatorViewModel~ComputeScreenSpacePosition + * @param {Cartesian3} position The position in WGS84 (world) coordinates. + * @param {Cartesian2} result An object to return the input position transformed to window coordinates. + * @returns {Cartesian2} The modified result parameter. + */ + return SelectionIndicatorViewModel; }); diff --git a/Source/Widgets/SvgPathBindingHandler.js b/Source/Widgets/SvgPathBindingHandler.js index 2473ab7b4d2d..d02eb5bd56e4 100644 --- a/Source/Widgets/SvgPathBindingHandler.js +++ b/Source/Widgets/SvgPathBindingHandler.js @@ -9,16 +9,19 @@ define(function() { * A Knockout binding handler that creates a DOM element for a single SVG path. * This binding handler will be registered as cesiumSvgPath. * - * The parameter to this binding is an object with the following required properties: + *

+ * The parameter to this binding is an object with the following properties: + *

* - * path: The SVG path as a string. - * width: The width of the SVG path with no transformations applied. - * height: The height of the SVG path with no transformations applied. + * * - * and the following optional properties: - * css: A string containing additional CSS classes to apply to the SVG. 'cesium-svgPath-svg' is always applied. - * - * @exports SvgPathBindingHandler + * @namespace + * @alias SvgPathBindingHandler * * @example * // Create an SVG as a child of a div diff --git a/Source/Widgets/Viewer/Viewer.js b/Source/Widgets/Viewer/Viewer.js index d86eba17badd..6e71554b5c78 100644 --- a/Source/Widgets/Viewer/Viewer.js +++ b/Source/Widgets/Viewer/Viewer.js @@ -765,7 +765,7 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to * A mixin may add additional properties, functions, or other behavior * to the provided viewer instance. * - * @param {Function} mixin The Viewer mixin to add to this instance. + * @param {Viewer~ViewerMixin} mixin The Viewer mixin to add to this instance. * @param {Object} options The options object to be passed to the mixin function. * * @see viewerDragDropMixin @@ -963,5 +963,14 @@ Either specify options.terrainProvider instead or set options.baseLayerPicker to viewer._lastHeight = height; } + /** + * A function that augments a Viewer instance with additional functionality. + * @callback Viewer~ViewerMixin + * @param {Viewer} viewer The viewer instance. + * @param {Object} options Options object to be passed to the mixin function. + * + * @see Viewer#extend + */ + return Viewer; }); diff --git a/Source/Widgets/subscribeAndEvaluate.js b/Source/Widgets/subscribeAndEvaluate.js index b9e488ac7344..499f7c4924f0 100644 --- a/Source/Widgets/subscribeAndEvaluate.js +++ b/Source/Widgets/subscribeAndEvaluate.js @@ -17,7 +17,7 @@ define([ * @param {String} observablePropertyName The name of the observable property. * @param {Function} callback The callback function. * @param {Object} [target] The value of this in the callback function. - * @param {Function} [event='change'] The name of the event to receive notification for. + * @param {String} [event='change'] The name of the event to receive notification for. * @returns The subscription object from Knockout which can be used to dispose the subscription later. */ var subscribeAndEvaluate = function(owner, observablePropertyName, callback, target, event) { diff --git a/Source/Workers/createTaskProcessorWorker.js b/Source/Workers/createTaskProcessorWorker.js index d9c1de73d2c2..486e27f3aeae 100644 --- a/Source/Workers/createTaskProcessorWorker.js +++ b/Source/Workers/createTaskProcessorWorker.js @@ -15,11 +15,10 @@ define([ * * @exports createTaskProcessorWorker * - * @param {Function} workerFunction A function that takes as input two arguments: - * a parameters object, and an array into which transferable result objects can be pushed, - * and returns as output a result object. - * @returns {Function} An adapter function that handles the interaction with TaskProcessor, - * specifically, task ID management and posting a response message containing the result. + * @param {createTaskProcessorWorker~WorkerFunction} workerFunction The calculation function, + * which takes parameters and returns a result. + * @returns {createTaskProcessorWorker~TaskProcessorWorkerFunction} A function that adapts the + * calculation function to work as a Web Worker onmessage listener with TaskProcessor. * * @see TaskProcessor * @see {@link http://www.w3.org/TR/workers/|Web Workers} @@ -87,5 +86,36 @@ define([ }; }; + /** + * A function that performs a calculation in a Web Worker. + * @callback createTaskProcessorWorker~WorkerFunction + * + * @param {Object} parameters Parameters to the calculation. + * @param {Array} transferableObjects An array that should be filled with references to objects inside + * the result that should be transferred back to the main document instead of copied. + * @returns {Object} The result of the calculation. + * + * @example + * function calculate(parameters, transferableObjects) { + * // perform whatever calculation is necessary. + * var typedArray = new Float32Array(); + * + * // typed arrays are transferable + * transferableObjects.push(typedArray) + * + * return { + * typedArray : typedArray + * }; + * } + */ + + /** + * A Web Worker message event handler function that handles the interaction with TaskProcessor, + * specifically, task ID management and posting a response message containing the result. + * @callback createTaskProcessorWorker~TaskProcessorWorkerFunction + * + * @param {Object} event The onmessage event object. + */ + return createTaskProcessorWorker; }); \ No newline at end of file diff --git a/Tools/jsdoc/cesium_template/publish.js b/Tools/jsdoc/cesium_template/publish.js index 8be524dce417..52ad83f9054e 100644 --- a/Tools/jsdoc/cesium_template/publish.js +++ b/Tools/jsdoc/cesium_template/publish.js @@ -45,7 +45,7 @@ function needsSignature(doclet) { var needsSig = false; // function and class definitions always get a signature - if (doclet.kind === 'function' || doclet.kind === 'class') { + if (doclet.kind === 'function' || doclet.kind === 'class' || doclet.kind === 'module') { needsSig = true; } // typedefs that contain functions get a signature, too @@ -180,7 +180,7 @@ function buildNav(members) { classNav = '', globalNav = ''; - var items = members.modules.concat(members.classes).sort(function(a, b) { + var items = members.modules.concat(members.classes).concat(members.namespaces).sort(function(a, b) { return a.longname.toLowerCase().localeCompare(b.longname.toLowerCase()); }); @@ -375,6 +375,7 @@ exports.publish = function(taffyData, opts, tutorials) { // set up the lists that we'll use to generate pages var classes = taffy(members.classes); var modules = taffy(members.modules); + var namespaces = taffy(members.namespaces); var typesJson = {}; @@ -385,6 +386,10 @@ exports.publish = function(taffyData, opts, tutorials) { items = helper.find(modules, {longname: longname}); } + if (!items.length) { + items = helper.find(namespaces, {longname: longname}); + } + if (items.length) { var title = items[0].name; var filename = helper.longnameToUrl[longname]; diff --git a/Tools/jsdoc/cesium_template/tmpl/container.tmpl b/Tools/jsdoc/cesium_template/tmpl/container.tmpl index 4a0d92813c3d..a8d377336286 100644 --- a/Tools/jsdoc/cesium_template/tmpl/container.tmpl +++ b/Tools/jsdoc/cesium_template/tmpl/container.tmpl @@ -31,11 +31,6 @@ - - -
Example 1? 's':'' ?>
- -