diff --git a/Source/Core/BoxGeometry.js b/Source/Core/BoxGeometry.js index 839a520262d1..b035aec1c1f4 100644 --- a/Source/Core/BoxGeometry.js +++ b/Source/Core/BoxGeometry.js @@ -52,7 +52,7 @@ define([ * }); * var geometry = Cesium.BoxGeometry.createGeometry(box); */ - var BoxGeometry = function(options) { + function BoxGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var min = options.minimumCorner; var max = options.maximumCorner; @@ -71,8 +71,7 @@ define([ this._minimumCorner = Cartesian3.clone(min); this._maximumCorner = Cartesian3.clone(max); this._vertexFormat = vertexFormat; - this._workerName = 'createBoxGeometry'; - }; + } /** * Creates a cube centered at the origin given its dimensions. diff --git a/Source/Core/BoxOutlineGeometry.js b/Source/Core/BoxOutlineGeometry.js index 8461d0a24d39..45fbcac139a1 100644 --- a/Source/Core/BoxOutlineGeometry.js +++ b/Source/Core/BoxOutlineGeometry.js @@ -47,7 +47,7 @@ define([ * }); * var geometry = Cesium.BoxOutlineGeometry.createGeometry(box); */ - var BoxOutlineGeometry = function(options) { + function BoxOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var min = options.minimumCorner; @@ -64,8 +64,7 @@ define([ this._min = Cartesian3.clone(min); this._max = Cartesian3.clone(max); - this._workerName = 'createBoxOutlineGeometry'; - }; + } /** * Creates an outline of a cube centered at the origin given its dimensions. diff --git a/Source/Core/CircleGeometry.js b/Source/Core/CircleGeometry.js index 1eb967557a95..4be0b5d39327 100644 --- a/Source/Core/CircleGeometry.js +++ b/Source/Core/CircleGeometry.js @@ -49,7 +49,7 @@ define([ * }); * var geometry = Cesium.CircleGeometry.createGeometry(circle); */ - var CircleGeometry = function(options) { + function CircleGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radius = options.radius; @@ -74,8 +74,7 @@ define([ stRotation : options.stRotation }; this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions); - this._workerName = 'createCircleGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/CircleOutlineGeometry.js b/Source/Core/CircleOutlineGeometry.js index b43dca2f57b9..3ea44c16db26 100644 --- a/Source/Core/CircleOutlineGeometry.js +++ b/Source/Core/CircleOutlineGeometry.js @@ -46,7 +46,7 @@ define([ * }); * var geometry = Cesium.CircleOutlineGeometry.createGeometry(circle); */ - var CircleOutlineGeometry = function(options) { + function CircleOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radius = options.radius; @@ -70,8 +70,7 @@ define([ numberOfVerticalLines : options.numberOfVerticalLines }; this._ellipseGeometry = new EllipseOutlineGeometry(ellipseGeometryOptions); - this._workerName = 'createCircleOutlineGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/CorridorGeometry.js b/Source/Core/CorridorGeometry.js index 184e2bdc167b..f1f582e4f566 100644 --- a/Source/Core/CorridorGeometry.js +++ b/Source/Core/CorridorGeometry.js @@ -648,7 +648,7 @@ define([ * width : 100000 * }); */ - var CorridorGeometry = function(options) { + function CorridorGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var positions = options.positions; var width = options.width; @@ -670,14 +670,13 @@ define([ this._extrudedHeight = defaultValue(options.extrudedHeight, this._height); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); - this._workerName = 'createCorridorGeometry'; /** * The number of elements used to pack the object into an array. * @type {Number} */ this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + VertexFormat.packedLength + 5; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/CorridorOutlineGeometry.js b/Source/Core/CorridorOutlineGeometry.js index 851175437a9c..28b72944a9f8 100644 --- a/Source/Core/CorridorOutlineGeometry.js +++ b/Source/Core/CorridorOutlineGeometry.js @@ -325,7 +325,7 @@ define([ * width : 100000 * }); */ - var CorridorOutlineGeometry = function(options) { + function CorridorOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var positions = options.positions; var width = options.width; @@ -346,14 +346,13 @@ define([ this._extrudedHeight = defaultValue(options.extrudedHeight, this._height); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); - this._workerName = 'createCorridorOutlineGeometry'; /** * The number of elements used to pack the object into an array. * @type {Number} */ this.packedLength = 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + 5; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/CylinderGeometry.js b/Source/Core/CylinderGeometry.js index a6d76998523f..ced069257ded 100644 --- a/Source/Core/CylinderGeometry.js +++ b/Source/Core/CylinderGeometry.js @@ -72,7 +72,7 @@ define([ * }); * var geometry = Cesium.CylinderGeometry.createGeometry(cylinder); */ - var CylinderGeometry = function(options) { + function CylinderGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var length = options.length; @@ -104,8 +104,7 @@ define([ this._bottomRadius = bottomRadius; this._vertexFormat = VertexFormat.clone(vertexFormat); this._slices = slices; - this._workerName = 'createCylinderGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/CylinderOutlineGeometry.js b/Source/Core/CylinderOutlineGeometry.js index 89953caac132..b72203ba6993 100644 --- a/Source/Core/CylinderOutlineGeometry.js +++ b/Source/Core/CylinderOutlineGeometry.js @@ -63,7 +63,7 @@ define([ * }); * var geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder); */ - var CylinderOutlineGeometry = function(options) { + function CylinderOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var length = options.length; @@ -95,8 +95,7 @@ define([ this._bottomRadius = bottomRadius; this._slices = slices; this._numberOfVerticalLines = numberOfVerticalLines; - this._workerName = 'createCylinderOutlineGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/EllipseGeometry.js b/Source/Core/EllipseGeometry.js index e95ac358184b..fbe7c0790302 100644 --- a/Source/Core/EllipseGeometry.js +++ b/Source/Core/EllipseGeometry.js @@ -586,7 +586,7 @@ define([ * }); * var geometry = Cesium.EllipseGeometry.createGeometry(ellipse); */ - var EllipseGeometry = function(options) { + function EllipseGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var center = options.center; @@ -631,8 +631,7 @@ define([ this._vertexFormat = VertexFormat.clone(vertexFormat); this._extrudedHeight = defaultValue(extrudedHeight, height); this._extrude = extrude; - this._workerName = 'createEllipseGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/EllipseOutlineGeometry.js b/Source/Core/EllipseOutlineGeometry.js index f74f8cdfe6f4..c020fe5a06cf 100644 --- a/Source/Core/EllipseOutlineGeometry.js +++ b/Source/Core/EllipseOutlineGeometry.js @@ -161,7 +161,7 @@ define([ * }); * var geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse); */ - var EllipseOutlineGeometry = function(options) { + function EllipseOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var center = options.center; @@ -204,8 +204,7 @@ define([ this._extrudedHeight = defaultValue(extrudedHeight, 0.0); this._extrude = extrude; this._numberOfVerticalLines = Math.max(defaultValue(options.numberOfVerticalLines, 16), 0); - this._workerName = 'createEllipseOutlineGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/EllipsoidGeometry.js b/Source/Core/EllipsoidGeometry.js index 571dcbef3ddc..d06f0ef054c3 100644 --- a/Source/Core/EllipsoidGeometry.js +++ b/Source/Core/EllipsoidGeometry.js @@ -69,7 +69,7 @@ define([ * }); * var geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid); */ - var EllipsoidGeometry = function(options) { + function EllipsoidGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radii = defaultValue(options.radii, defaultRadii); @@ -90,8 +90,7 @@ define([ this._stackPartitions = stackPartitions; this._slicePartitions = slicePartitions; this._vertexFormat = VertexFormat.clone(vertexFormat); - this._workerName = 'createEllipsoidGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/EllipsoidOutlineGeometry.js b/Source/Core/EllipsoidOutlineGeometry.js index 70a523b743d0..491c302149b7 100644 --- a/Source/Core/EllipsoidOutlineGeometry.js +++ b/Source/Core/EllipsoidOutlineGeometry.js @@ -59,7 +59,7 @@ define([ * }); * var geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid); */ - var EllipsoidOutlineGeometry = function(options) { + function EllipsoidOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var radii = defaultValue(options.radii, defaultRadii); @@ -83,8 +83,7 @@ define([ this._stackPartitions = stackPartitions; this._slicePartitions = slicePartitions; this._subdivisions = subdivisions; - this._workerName = 'createEllipsoidOutlineGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/PolygonGeometry.js b/Source/Core/PolygonGeometry.js index cd87fd4f4562..358480a6f4e2 100644 --- a/Source/Core/PolygonGeometry.js +++ b/Source/Core/PolygonGeometry.js @@ -603,7 +603,7 @@ define([ * }); * var geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon); */ - var PolygonGeometry = function(options) { + function PolygonGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT); @@ -637,14 +637,13 @@ define([ this._extrude = extrude; this._polygonHierarchy = polygonHierarchy; this._perPositionHeight = perPositionHeight; - this._workerName = 'createPolygonGeometry'; /** * The number of elements used to pack the object into an array. * @type {Number} */ this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + Ellipsoid.packedLength + VertexFormat.packedLength + 6; - }; + } /** * A description of a polygon from an array of positions. diff --git a/Source/Core/PolygonOutlineGeometry.js b/Source/Core/PolygonOutlineGeometry.js index d7ae8bf92bc4..f5af844a14bc 100644 --- a/Source/Core/PolygonOutlineGeometry.js +++ b/Source/Core/PolygonOutlineGeometry.js @@ -298,7 +298,7 @@ define([ * }); * var geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon); */ - var PolygonOutlineGeometry = function(options) { + function PolygonOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); @@ -328,14 +328,13 @@ define([ this._extrude = extrude; this._polygonHierarchy = polygonHierarchy; this._perPositionHeight = perPositionHeight; - this._workerName = 'createPolygonOutlineGeometry'; /** * The number of elements used to pack the object into an array. * @type {Number} */ this.packedLength = PolygonGeometryLibrary.computeHierarchyPackedLength(polygonHierarchy) + Ellipsoid.packedLength + 5; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/PolylineGeometry.js b/Source/Core/PolylineGeometry.js index 026ee480ab76..411fae19f2ca 100644 --- a/Source/Core/PolylineGeometry.js +++ b/Source/Core/PolylineGeometry.js @@ -110,7 +110,7 @@ define([ * }); * var geometry = Cesium.PolylineGeometry.createGeometry(polyline); */ - var PolylineGeometry = function(options) { + function PolylineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var positions = options.positions; var colors = options.colors; @@ -137,7 +137,6 @@ define([ this._followSurface = defaultValue(options.followSurface, true); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); this._ellipsoid = Ellipsoid.clone(defaultValue(options.ellipsoid, Ellipsoid.WGS84)); - this._workerName = 'createPolylineGeometry'; var numComponents = 1 + positions.length * Cartesian3.packedLength; numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1; @@ -147,7 +146,7 @@ define([ * @type {Number} */ this.packedLength = numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 4; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/PolylineVolumeGeometry.js b/Source/Core/PolylineVolumeGeometry.js index e17a26928f34..c59619a299f2 100644 --- a/Source/Core/PolylineVolumeGeometry.js +++ b/Source/Core/PolylineVolumeGeometry.js @@ -213,7 +213,7 @@ define([ * shapePositions : computeCircle(100000.0) * }); */ - var PolylineVolumeGeometry = function(options) { + function PolylineVolumeGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var positions = options.polylinePositions; var shape = options.shapePositions; @@ -233,7 +233,6 @@ define([ this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._vertexFormat = VertexFormat.clone(defaultValue(options.vertexFormat, VertexFormat.DEFAULT)); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); - this._workerName = 'createPolylineVolumeGeometry'; var numComponents = 1 + positions.length * Cartesian3.packedLength; numComponents += 1 + shape.length * Cartesian2.packedLength; @@ -243,7 +242,7 @@ define([ * @type {Number} */ this.packedLength = numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 2; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/PolylineVolumeOutlineGeometry.js b/Source/Core/PolylineVolumeOutlineGeometry.js index fa1a0226377e..280e10d62a44 100644 --- a/Source/Core/PolylineVolumeOutlineGeometry.js +++ b/Source/Core/PolylineVolumeOutlineGeometry.js @@ -128,7 +128,7 @@ define([ * shapePositions : computeCircle(100000.0) * }); */ - var PolylineVolumeOutlineGeometry = function(options) { + function PolylineVolumeOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var positions = options.polylinePositions; var shape = options.shapePositions; @@ -147,7 +147,6 @@ define([ this._ellipsoid = Ellipsoid.clone(defaultValue(options.ellipsoid, Ellipsoid.WGS84)); this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); - this._workerName = 'createPolylineVolumeOutlineGeometry'; var numComponents = 1 + positions.length * Cartesian3.packedLength; numComponents += 1 + shape.length * Cartesian2.packedLength; @@ -157,7 +156,7 @@ define([ * @type {Number} */ this.packedLength = numComponents + Ellipsoid.packedLength + 2; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/RectangleGeometry.js b/Source/Core/RectangleGeometry.js index d27f0affc3cb..7d2f3ec5d5f5 100644 --- a/Source/Core/RectangleGeometry.js +++ b/Source/Core/RectangleGeometry.js @@ -543,7 +543,7 @@ define([ * }); * var geometry = Cesium.RectangleGeometry.createGeometry(rectangle); */ - var RectangleGeometry = function(options) { + function RectangleGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var rectangle = options.rectangle; @@ -579,8 +579,7 @@ define([ this._extrude = extrude; this._closeTop = closeTop; this._closeBottom = closeBottom; - this._workerName = 'createRectangleGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/RectangleOutlineGeometry.js b/Source/Core/RectangleOutlineGeometry.js index d36637df5b8b..26051f5cbf05 100644 --- a/Source/Core/RectangleOutlineGeometry.js +++ b/Source/Core/RectangleOutlineGeometry.js @@ -193,7 +193,7 @@ define([ * }); * var geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle); */ - var RectangleOutlineGeometry = function(options) { + function RectangleOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var rectangle = options.rectangle; @@ -219,8 +219,7 @@ define([ this._surfaceHeight = surfaceHeight; this._rotation = rotation; this._extrudedHeight = extrudedHeight; - this._workerName = 'createRectangleOutlineGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/SimplePolylineGeometry.js b/Source/Core/SimplePolylineGeometry.js index 203146b7a490..deec58558e0f 100644 --- a/Source/Core/SimplePolylineGeometry.js +++ b/Source/Core/SimplePolylineGeometry.js @@ -106,7 +106,7 @@ define([ * }); * var geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline); */ - var SimplePolylineGeometry = function(options) { + function SimplePolylineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var positions = options.positions; var colors = options.colors; @@ -127,7 +127,6 @@ define([ this._followSurface = defaultValue(options.followSurface, true); this._granularity = defaultValue(options.granularity, CesiumMath.RADIANS_PER_DEGREE); this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84); - this._workerName = 'createSimplePolylineGeometry'; var numComponents = 1 + positions.length * Cartesian3.packedLength; numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1; @@ -137,7 +136,7 @@ define([ * @type {Number} */ this.packedLength = numComponents + Ellipsoid.packedLength + 3; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/SphereGeometry.js b/Source/Core/SphereGeometry.js index a54da65075fe..428d08683d53 100644 --- a/Source/Core/SphereGeometry.js +++ b/Source/Core/SphereGeometry.js @@ -41,7 +41,7 @@ define([ * }); * var geometry = Cesium.SphereGeometry.createGeometry(sphere); */ - var SphereGeometry = function(options) { + function SphereGeometry(options) { var radius = defaultValue(options.radius, 1.0); var radii = new Cartesian3(radius, radius, radius); var ellipsoidOptions = { @@ -52,8 +52,7 @@ define([ }; this._ellipsoidGeometry = new EllipsoidGeometry(ellipsoidOptions); - this._workerName = 'createSphereGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/SphereOutlineGeometry.js b/Source/Core/SphereOutlineGeometry.js index 748ab6b12949..61ef9dfa5712 100644 --- a/Source/Core/SphereOutlineGeometry.js +++ b/Source/Core/SphereOutlineGeometry.js @@ -39,7 +39,7 @@ define([ * }); * var geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere); */ - var SphereOutlineGeometry = function(options) { + function SphereOutlineGeometry(options) { var radius = defaultValue(options.radius, 1.0); var radii = new Cartesian3(radius, radius, radius); var ellipsoidOptions = { @@ -50,8 +50,7 @@ define([ }; this._ellipsoidGeometry = new EllipsoidOutlineGeometry(ellipsoidOptions); - this._workerName = 'createSphereOutlineGeometry'; - }; + } /** * The number of elements used to pack the object into an array. diff --git a/Source/Core/WallGeometry.js b/Source/Core/WallGeometry.js index 79bdf9a77925..19e693a7e490 100644 --- a/Source/Core/WallGeometry.js +++ b/Source/Core/WallGeometry.js @@ -80,7 +80,7 @@ define([ * }); * var geometry = Cesium.WallGeometry.createGeometry(wall); */ - var WallGeometry = function(options) { + function WallGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var wallPositions = options.positions; @@ -109,7 +109,6 @@ define([ this._vertexFormat = VertexFormat.clone(vertexFormat); this._granularity = granularity; this._ellipsoid = Ellipsoid.clone(ellipsoid); - this._workerName = 'createWallGeometry'; var numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2; if (defined(minimumHeights)) { @@ -124,7 +123,7 @@ define([ * @type {Number} */ this.packedLength = numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 1; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Core/WallOutlineGeometry.js b/Source/Core/WallOutlineGeometry.js index 4ebc9e0a6df4..eabe64972bc6 100644 --- a/Source/Core/WallOutlineGeometry.js +++ b/Source/Core/WallOutlineGeometry.js @@ -71,7 +71,7 @@ define([ * }); * var geometry = Cesium.WallOutlineGeometry.createGeometry(wall); */ - var WallOutlineGeometry = function(options) { + function WallOutlineGeometry(options) { options = defaultValue(options, defaultValue.EMPTY_OBJECT); var wallPositions = options.positions; @@ -98,7 +98,6 @@ define([ this._maximumHeights = maximumHeights; this._granularity = granularity; this._ellipsoid = Ellipsoid.clone(ellipsoid); - this._workerName = 'createWallOutlineGeometry'; var numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2; if (defined(minimumHeights)) { @@ -113,7 +112,7 @@ define([ * @type {Number} */ this.packedLength = numComponents + Ellipsoid.packedLength + 1; - }; + } /** * Stores the provided instance into the provided array. diff --git a/Source/Scene/Primitive.js b/Source/Scene/Primitive.js index aaa2b30b12e6..a29ecadfcfe3 100644 --- a/Source/Scene/Primitive.js +++ b/Source/Scene/Primitive.js @@ -731,8 +731,14 @@ define([ for (i = 0; i < length; ++i) { geometry = instances[i].geometry; instanceIds.push(instances[i].id); + + var moduleName = geometry.constructor.name; + if (moduleName === "Object") { + moduleName = undefined; + } + subTasks.push({ - moduleName : geometry._workerName, + moduleName : moduleName, geometry : geometry }); } diff --git a/Source/Workers/createBoxGeometry.js b/Source/Workers/createBoxGeometry.js deleted file mode 100644 index aaf24fbe30ee..000000000000 --- a/Source/Workers/createBoxGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/BoxGeometry', - '../Core/defined' - ], function( - BoxGeometry, - defined) { - "use strict"; - - return function(boxGeometry, offset) { - if (defined(offset)) { - boxGeometry = BoxGeometry.unpack(boxGeometry, offset); - } - return BoxGeometry.createGeometry(boxGeometry); - }; -}); diff --git a/Source/Workers/createBoxOutlineGeometry.js b/Source/Workers/createBoxOutlineGeometry.js deleted file mode 100644 index 0c0ac8ae76c4..000000000000 --- a/Source/Workers/createBoxOutlineGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/BoxOutlineGeometry', - '../Core/defined' - ], function( - BoxOutlineGeometry, - defined) { - "use strict"; - - return function(boxGeometry, offset) { - if (defined(offset)) { - boxGeometry = BoxOutlineGeometry.unpack(boxGeometry, offset); - } - return BoxOutlineGeometry.createGeometry(boxGeometry); - }; -}); diff --git a/Source/Workers/createCircleGeometry.js b/Source/Workers/createCircleGeometry.js deleted file mode 100644 index 3eba599f2d13..000000000000 --- a/Source/Workers/createCircleGeometry.js +++ /dev/null @@ -1,24 +0,0 @@ -/*global define*/ -define([ - '../Core/Cartesian3', - '../Core/CircleGeometry', - '../Core/defined', - '../Core/Ellipsoid' - ], function( - Cartesian3, - CircleGeometry, - defined, - Ellipsoid) { - "use strict"; - - function createCircleGeometry(circleGeometry, offset) { - if (defined(offset)) { - circleGeometry = CircleGeometry.unpack(circleGeometry, offset); - } - circleGeometry._ellipseGeometry._center = Cartesian3.clone(circleGeometry._ellipseGeometry._center); - circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone(circleGeometry._ellipseGeometry._ellipsoid); - return CircleGeometry.createGeometry(circleGeometry); - } - - return createCircleGeometry; -}); diff --git a/Source/Workers/createCircleOutlineGeometry.js b/Source/Workers/createCircleOutlineGeometry.js deleted file mode 100644 index 5df6cc94814f..000000000000 --- a/Source/Workers/createCircleOutlineGeometry.js +++ /dev/null @@ -1,24 +0,0 @@ -/*global define*/ -define([ - '../Core/Cartesian3', - '../Core/CircleOutlineGeometry', - '../Core/defined', - '../Core/Ellipsoid' - ], function( - Cartesian3, - CircleOutlineGeometry, - defined, - Ellipsoid) { - "use strict"; - - function createCircleOutlineGeometry(circleGeometry, offset) { - if (defined(offset)) { - circleGeometry = CircleOutlineGeometry.unpack(circleGeometry, offset); - } - circleGeometry._ellipseGeometry._center = Cartesian3.clone(circleGeometry._ellipseGeometry._center); - circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone(circleGeometry._ellipseGeometry._ellipsoid); - return CircleOutlineGeometry.createGeometry(circleGeometry); - } - - return createCircleOutlineGeometry; -}); diff --git a/Source/Workers/createCorridorGeometry.js b/Source/Workers/createCorridorGeometry.js deleted file mode 100644 index ba673a27f803..000000000000 --- a/Source/Workers/createCorridorGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/CorridorGeometry', - '../Core/defined', - '../Core/Ellipsoid' - ], function( - CorridorGeometry, - defined, - Ellipsoid) { - "use strict"; - - function createCorridorGeometry(corridorGeometry, offset) { - if (defined(offset)) { - corridorGeometry = CorridorGeometry.unpack(corridorGeometry, offset); - } - corridorGeometry._ellipsoid = Ellipsoid.clone(corridorGeometry._ellipsoid); - return CorridorGeometry.createGeometry(corridorGeometry); - } - - return createCorridorGeometry; -}); diff --git a/Source/Workers/createCorridorOutlineGeometry.js b/Source/Workers/createCorridorOutlineGeometry.js deleted file mode 100644 index 45cca03cbc43..000000000000 --- a/Source/Workers/createCorridorOutlineGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/CorridorOutlineGeometry', - '../Core/defined', - '../Core/Ellipsoid' - ], function( - CorridorOutlineGeometry, - defined, - Ellipsoid) { - "use strict"; - - function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) { - if (defined(offset)) { - corridorOutlineGeometry = CorridorOutlineGeometry.unpack(corridorOutlineGeometry, offset); - } - corridorOutlineGeometry._ellipsoid = Ellipsoid.clone(corridorOutlineGeometry._ellipsoid); - return CorridorOutlineGeometry.createGeometry(corridorOutlineGeometry); - } - - return createCorridorOutlineGeometry; -}); diff --git a/Source/Workers/createCylinderGeometry.js b/Source/Workers/createCylinderGeometry.js deleted file mode 100644 index 309ea24cd175..000000000000 --- a/Source/Workers/createCylinderGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/CylinderGeometry', - '../Core/defined' - ], function( - CylinderGeometry, - defined) { - "use strict"; - - return function(cylinderGeometry, offset) { - if (defined(offset)) { - cylinderGeometry = CylinderGeometry.unpack(cylinderGeometry, offset); - } - return CylinderGeometry.createGeometry(cylinderGeometry); - }; -}); diff --git a/Source/Workers/createCylinderOutlineGeometry.js b/Source/Workers/createCylinderOutlineGeometry.js deleted file mode 100644 index e17895dd6608..000000000000 --- a/Source/Workers/createCylinderOutlineGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/CylinderOutlineGeometry', - '../Core/defined' - ], function( - CylinderOutlineGeometry, - defined) { - "use strict"; - - return function(cylinderGeometry, offset) { - if (defined(offset)) { - cylinderGeometry = CylinderOutlineGeometry.unpack(cylinderGeometry, offset); - } - return CylinderOutlineGeometry.createGeometry(cylinderGeometry); - }; -}); diff --git a/Source/Workers/createEllipseGeometry.js b/Source/Workers/createEllipseGeometry.js deleted file mode 100644 index 626e24e3dbb3..000000000000 --- a/Source/Workers/createEllipseGeometry.js +++ /dev/null @@ -1,24 +0,0 @@ -/*global define*/ -define([ - '../Core/Cartesian3', - '../Core/defined', - '../Core/EllipseGeometry', - '../Core/Ellipsoid' - ], function( - Cartesian3, - defined, - EllipseGeometry, - Ellipsoid) { - "use strict"; - - function createEllipseGeometry(ellipseGeometry, offset) { - if (defined(offset)) { - ellipseGeometry = EllipseGeometry.unpack(ellipseGeometry, offset); - } - ellipseGeometry._center = Cartesian3.clone(ellipseGeometry._center); - ellipseGeometry._ellipsoid = Ellipsoid.clone(ellipseGeometry._ellipsoid); - return EllipseGeometry.createGeometry(ellipseGeometry); - } - - return createEllipseGeometry; -}); diff --git a/Source/Workers/createEllipseOutlineGeometry.js b/Source/Workers/createEllipseOutlineGeometry.js deleted file mode 100644 index 9a0ffe328e46..000000000000 --- a/Source/Workers/createEllipseOutlineGeometry.js +++ /dev/null @@ -1,24 +0,0 @@ -/*global define*/ -define([ - '../Core/Cartesian3', - '../Core/defined', - '../Core/EllipseOutlineGeometry', - '../Core/Ellipsoid' - ], function( - Cartesian3, - defined, - EllipseOutlineGeometry, - Ellipsoid) { - "use strict"; - - function createEllipseOutlineGeometry(ellipseGeometry, offset) { - if (defined(offset)) { - ellipseGeometry = EllipseOutlineGeometry.unpack(ellipseGeometry, offset); - } - ellipseGeometry._center = Cartesian3.clone(ellipseGeometry._center); - ellipseGeometry._ellipsoid = Ellipsoid.clone(ellipseGeometry._ellipsoid); - return EllipseOutlineGeometry.createGeometry(ellipseGeometry); - } - - return createEllipseOutlineGeometry; -}); diff --git a/Source/Workers/createEllipsoidGeometry.js b/Source/Workers/createEllipsoidGeometry.js deleted file mode 100644 index a5de0a49bc8d..000000000000 --- a/Source/Workers/createEllipsoidGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/EllipsoidGeometry' - ], function( - defined, - EllipsoidGeometry) { - "use strict"; - - return function(ellipsoidGeometry, offset) { - if (defined(offset)) { - ellipsoidGeometry = EllipsoidGeometry.unpack(ellipsoidGeometry, offset); - } - return EllipsoidGeometry.createGeometry(ellipsoidGeometry); - }; -}); diff --git a/Source/Workers/createEllipsoidOutlineGeometry.js b/Source/Workers/createEllipsoidOutlineGeometry.js deleted file mode 100644 index 7f720a2df884..000000000000 --- a/Source/Workers/createEllipsoidOutlineGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/EllipsoidOutlineGeometry' - ], function( - defined, - EllipsoidOutlineGeometry) { - "use strict"; - - return function(ellipsoidGeometry, offset) { - if (defined(ellipsoidGeometry.buffer, offset)) { - ellipsoidGeometry = EllipsoidOutlineGeometry.unpack(ellipsoidGeometry, offset); - } - return EllipsoidOutlineGeometry.createGeometry(ellipsoidGeometry); - }; -}); diff --git a/Source/Workers/createGeometry.js b/Source/Workers/createGeometry.js index 24570db39d42..15d210b7a0da 100644 --- a/Source/Workers/createGeometry.js +++ b/Source/Workers/createGeometry.js @@ -17,9 +17,14 @@ define([ var module = moduleCache[moduleName]; if (!defined(module)) { // in web workers, require is synchronous - require(['./' + moduleName], function(f) { - module = f; - moduleCache[module] = f; + require(['../Core/' + moduleName], function(f) { + module = function(geometry, offset) { + if (defined(offset)) { + geometry = f.unpack(geometry, offset); + } + return f.createGeometry(geometry); + }; + moduleCache[moduleName] = module; }); } return module; diff --git a/Source/Workers/createPolygonGeometry.js b/Source/Workers/createPolygonGeometry.js deleted file mode 100644 index 1f03cc8386af..000000000000 --- a/Source/Workers/createPolygonGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/PolygonGeometry' - ], function( - defined, - Ellipsoid, - PolygonGeometry) { - "use strict"; - - function createPolygonGeometry(polygonGeometry, offset) { - if (defined(offset)) { - polygonGeometry = PolygonGeometry.unpack(polygonGeometry, offset); - } - polygonGeometry._ellipsoid = Ellipsoid.clone(polygonGeometry._ellipsoid); - return PolygonGeometry.createGeometry(polygonGeometry); - } - - return createPolygonGeometry; -}); diff --git a/Source/Workers/createPolygonOutlineGeometry.js b/Source/Workers/createPolygonOutlineGeometry.js deleted file mode 100644 index 1c298701111e..000000000000 --- a/Source/Workers/createPolygonOutlineGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/PolygonOutlineGeometry' - ], function( - defined, - Ellipsoid, - PolygonOutlineGeometry) { - "use strict"; - - function createPolygonOutlineGeometry(polygonGeometry, offset) { - if (defined(offset)) { - polygonGeometry = PolygonOutlineGeometry.unpack(polygonGeometry, offset); - } - polygonGeometry._ellipsoid = Ellipsoid.clone(polygonGeometry._ellipsoid); - return PolygonOutlineGeometry.createGeometry(polygonGeometry); - } - - return createPolygonOutlineGeometry; -}); diff --git a/Source/Workers/createPolylineGeometry.js b/Source/Workers/createPolylineGeometry.js deleted file mode 100644 index 4fb72ce64831..000000000000 --- a/Source/Workers/createPolylineGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/PolylineGeometry' - ], function( - defined, - Ellipsoid, - PolylineGeometry) { - "use strict"; - - function createPolylineGeometry(polylineGeometry, offset) { - if (defined(offset)) { - polylineGeometry = PolylineGeometry.unpack(polylineGeometry, offset); - } - polylineGeometry._ellipsoid = Ellipsoid.clone(polylineGeometry._ellipsoid); - return PolylineGeometry.createGeometry(polylineGeometry); - } - - return createPolylineGeometry; -}); diff --git a/Source/Workers/createPolylineVolumeGeometry.js b/Source/Workers/createPolylineVolumeGeometry.js deleted file mode 100644 index 914b710246e7..000000000000 --- a/Source/Workers/createPolylineVolumeGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/PolylineVolumeGeometry' - ], function( - defined, - Ellipsoid, - PolylineVolumeGeometry) { - "use strict"; - - function createPolylineVolumeGeometry(polylineVolumeGeometry, offset) { - if (defined(offset)) { - polylineVolumeGeometry = PolylineVolumeGeometry.unpack(polylineVolumeGeometry, offset); - } - polylineVolumeGeometry._ellipsoid = Ellipsoid.clone(polylineVolumeGeometry._ellipsoid); - return PolylineVolumeGeometry.createGeometry(polylineVolumeGeometry); - } - - return createPolylineVolumeGeometry; -}); diff --git a/Source/Workers/createPolylineVolumeOutlineGeometry.js b/Source/Workers/createPolylineVolumeOutlineGeometry.js deleted file mode 100644 index 5ef898e172c2..000000000000 --- a/Source/Workers/createPolylineVolumeOutlineGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/PolylineVolumeOutlineGeometry' - ], function( - defined, - Ellipsoid, - PolylineVolumeOutlineGeometry) { - "use strict"; - - function createPolylineVolumeOutlineGeometry(polylineVolumeOutlineGeometry, offset) { - if (defined(offset)) { - polylineVolumeOutlineGeometry = PolylineVolumeOutlineGeometry.unpack(polylineVolumeOutlineGeometry, offset); - } - polylineVolumeOutlineGeometry._ellipsoid = Ellipsoid.clone(polylineVolumeOutlineGeometry._ellipsoid); - return PolylineVolumeOutlineGeometry.createGeometry(polylineVolumeOutlineGeometry); - } - - return createPolylineVolumeOutlineGeometry; -}); diff --git a/Source/Workers/createRectangleGeometry.js b/Source/Workers/createRectangleGeometry.js deleted file mode 100644 index 13d87bffe571..000000000000 --- a/Source/Workers/createRectangleGeometry.js +++ /dev/null @@ -1,24 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/Rectangle', - '../Core/RectangleGeometry' - ], function( - defined, - Ellipsoid, - Rectangle, - RectangleGeometry) { - "use strict"; - - function createRectangleGeometry(rectangleGeometry, offset) { - if (defined(offset)) { - rectangleGeometry = RectangleGeometry.unpack(rectangleGeometry, offset); - } - rectangleGeometry._ellipsoid = Ellipsoid.clone(rectangleGeometry._ellipsoid); - rectangleGeometry._rectangle = Rectangle.clone(rectangleGeometry._rectangle); - return RectangleGeometry.createGeometry(rectangleGeometry); - } - - return createRectangleGeometry; -}); diff --git a/Source/Workers/createRectangleOutlineGeometry.js b/Source/Workers/createRectangleOutlineGeometry.js deleted file mode 100644 index afa790575283..000000000000 --- a/Source/Workers/createRectangleOutlineGeometry.js +++ /dev/null @@ -1,24 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/Rectangle', - '../Core/RectangleOutlineGeometry' - ], function( - defined, - Ellipsoid, - Rectangle, - RectangleOutlineGeometry) { - "use strict"; - - function createRectangleOutlineGeometry(rectangleGeometry, offset) { - if (defined(offset)) { - rectangleGeometry = RectangleOutlineGeometry.unpack(rectangleGeometry, offset); - } - rectangleGeometry._ellipsoid = Ellipsoid.clone(rectangleGeometry._ellipsoid); - rectangleGeometry._rectangle = Rectangle.clone(rectangleGeometry._rectangle); - return RectangleOutlineGeometry.createGeometry(rectangleGeometry); - } - - return createRectangleOutlineGeometry; -}); diff --git a/Source/Workers/createSimplePolylineGeometry.js b/Source/Workers/createSimplePolylineGeometry.js deleted file mode 100644 index 6ab03361b05e..000000000000 --- a/Source/Workers/createSimplePolylineGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/SimplePolylineGeometry' - ], function( - defined, - Ellipsoid, - SimplePolylineGeometry) { - "use strict"; - - function createSimplePolylineGeometry(simplePolylineGeometry, offset) { - if (defined(offset)) { - simplePolylineGeometry = SimplePolylineGeometry.unpack(simplePolylineGeometry, offset); - } - simplePolylineGeometry._ellipsoid = Ellipsoid.clone(simplePolylineGeometry._ellipsoid); - return SimplePolylineGeometry.createGeometry(simplePolylineGeometry); - } - - return createSimplePolylineGeometry; -}); diff --git a/Source/Workers/createSphereGeometry.js b/Source/Workers/createSphereGeometry.js deleted file mode 100644 index db749b945e19..000000000000 --- a/Source/Workers/createSphereGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/SphereGeometry' - ], function( - defined, - SphereGeometry) { - "use strict"; - - return function(sphereGeometry, offset) { - if (defined(offset)) { - sphereGeometry = SphereGeometry.unpack(sphereGeometry, offset); - } - return SphereGeometry.createGeometry(sphereGeometry); - }; -}); diff --git a/Source/Workers/createSphereOutlineGeometry.js b/Source/Workers/createSphereOutlineGeometry.js deleted file mode 100644 index 144a2944cc2e..000000000000 --- a/Source/Workers/createSphereOutlineGeometry.js +++ /dev/null @@ -1,16 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/SphereOutlineGeometry' - ], function( - defined, - SphereOutlineGeometry) { - "use strict"; - - return function(sphereGeometry, offset) { - if (defined(offset)) { - sphereGeometry = SphereOutlineGeometry.unpack(sphereGeometry, offset); - } - return SphereOutlineGeometry.createGeometry(sphereGeometry); - }; -}); diff --git a/Source/Workers/createWallGeometry.js b/Source/Workers/createWallGeometry.js deleted file mode 100644 index 8326b64f8e5f..000000000000 --- a/Source/Workers/createWallGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/WallGeometry' - ], function( - defined, - Ellipsoid, - WallGeometry) { - "use strict"; - - function createWallGeometry(wallGeometry, offset) { - if (defined(offset)) { - wallGeometry = WallGeometry.unpack(wallGeometry, offset); - } - wallGeometry._ellipsoid = Ellipsoid.clone(wallGeometry._ellipsoid); - return WallGeometry.createGeometry(wallGeometry); - } - - return createWallGeometry; -}); diff --git a/Source/Workers/createWallOutlineGeometry.js b/Source/Workers/createWallOutlineGeometry.js deleted file mode 100644 index fd555460b045..000000000000 --- a/Source/Workers/createWallOutlineGeometry.js +++ /dev/null @@ -1,21 +0,0 @@ -/*global define*/ -define([ - '../Core/defined', - '../Core/Ellipsoid', - '../Core/WallOutlineGeometry' - ], function( - defined, - Ellipsoid, - WallOutlineGeometry) { - "use strict"; - - function createWallOutlineGeometry(wallGeometry, offset) { - if (defined(offset)) { - wallGeometry = WallOutlineGeometry.unpack(wallGeometry, offset); - } - wallGeometry._ellipsoid = Ellipsoid.clone(wallGeometry._ellipsoid); - return WallOutlineGeometry.createGeometry(wallGeometry); - } - - return createWallOutlineGeometry; -});