diff --git a/Examples/Sandbox/CodeSnippets/Advanced.js b/Examples/Sandbox/CodeSnippets/Advanced.js index db7e48db8b2..d2c849fefb5 100644 --- a/Examples/Sandbox/CodeSnippets/Advanced.js +++ b/Examples/Sandbox/CodeSnippets/Advanced.js @@ -27,18 +27,18 @@ }; Sandbox.ExamplePrimitive.prototype.update = function(context, sceneState) { - var vs = ""; - vs += "attribute vec4 position;"; - vs += "void main()"; - vs += "{"; - vs += " gl_Position = agi_modelViewProjection * position;"; - vs += "}"; - var fs = ""; - fs += "uniform vec4 u_color;"; - fs += "void main()"; - fs += "{"; - fs += " gl_FragColor = u_color;"; - fs += "}"; + var vs = ''; + vs += 'attribute vec4 position;'; + vs += 'void main()'; + vs += '{'; + vs += ' gl_Position = agi_modelViewProjection * position;'; + vs += '}'; + var fs = ''; + fs += 'uniform vec4 u_color;'; + fs += 'void main()'; + fs += '{'; + fs += ' gl_FragColor = u_color;'; + fs += '}'; var zLength = this._ellipsoid.getRadii().getMaximumComponent() * 0.1; var mesh = Cesium.MeshFilters.toWireframeInPlace( diff --git a/Examples/Sandbox/CodeSnippets/Billboard.js b/Examples/Sandbox/CodeSnippets/Billboard.js index e40117a8abd..e9d6e0294eb 100644 --- a/Examples/Sandbox/CodeSnippets/Billboard.js +++ b/Examples/Sandbox/CodeSnippets/Billboard.js @@ -14,15 +14,15 @@ }); primitives.add(billboards); }; - image.src = "Images/logoColor.png"; + image.src = 'Images/logoColor.png'; }; }; Sandbox.SeveralBillboards = function (scene, ellipsoid, primitives) { this.code = function () { Cesium.Chain.run( - Cesium.Jobs.downloadImage("Images/logoColor.png"), - Cesium.Jobs.downloadImage("Images/facility.gif")).thenRun( + Cesium.Jobs.downloadImage('Images/logoColor.png'), + Cesium.Jobs.downloadImage('Images/facility.gif')).thenRun( function () { // Once both images are downloaded, they are combined into one image, // called a texture atlas, which is assigned to a billboard-collection. @@ -31,8 +31,8 @@ var billboards = new Cesium.BillboardCollection(undefined); billboards.setTextureAtlas(scene.getContext().createTextureAtlas([ - this.images["Images/logoColor.png"], - this.images["Images/facility.gif"] + this.images['Images/logoColor.png'], + this.images['Images/facility.gif'] ])); billboards.add({ @@ -63,14 +63,14 @@ // // The 2D canvas can draw much more than circles. See: // https://developer.mozilla.org/en/Canvas_tutorial - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = 16; canvas.height = 16; - var context2D = canvas.getContext("2d"); + var context2D = canvas.getContext('2d'); context2D.beginPath(); context2D.arc(8, 8, 8, 0, Cesium.Math.TWO_PI, true); context2D.closePath(); - context2D.fillStyle="rgb(255, 255, 255)"; + context2D.fillStyle='rgb(255, 255, 255)'; context2D.fill(); var billboards = new Cesium.BillboardCollection(undefined); @@ -189,7 +189,7 @@ }); primitives.add(billboards); }; - image.src = "Images/whiteShapes.png"; + image.src = 'Images/whiteShapes.png'; }; }; @@ -212,7 +212,7 @@ }); primitives.add(billboards); }; - image.src = "Images/logoColor.png"; + image.src = 'Images/logoColor.png'; }; }; @@ -236,7 +236,7 @@ primitives.add(billboards); }; - image.src = "Images/logoColor.png"; + image.src = 'Images/logoColor.png'; }; }; @@ -255,7 +255,7 @@ billboards.add({ position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0) }); // up primitives.add(billboards); }; - image.src = "Images/facility.gif"; + image.src = 'Images/facility.gif'; }; }; diff --git a/Examples/Sandbox/CodeSnippets/Imagery.js b/Examples/Sandbox/CodeSnippets/Imagery.js index b47e2a809c7..463ba480c23 100644 --- a/Examples/Sandbox/CodeSnippets/Imagery.js +++ b/Examples/Sandbox/CodeSnippets/Imagery.js @@ -6,7 +6,7 @@ this.code = function () { // Bing Maps var bing = new Cesium.BingMapsTileProvider({ - server : "dev.virtualearth.net", + server : 'dev.virtualearth.net', mapStyle : Cesium.BingMapsStyle.AERIAL, // Some versions of Safari support WebGL, but don't correctly implement // cross-origin image loading, so we need to load Bing imagery using a proxy. @@ -86,7 +86,7 @@ Sandbox.Single = function (scene, ellipsoid, primitives) { this.code = function () { // Single texture - var single = new Cesium.SingleTileProvider("Images/NE2_50M_SR_W_4096.jpg"); + var single = new Cesium.SingleTileProvider('Images/NE2_50M_SR_W_4096.jpg'); primitives.getCentralBody().dayTileProvider = single; }; @@ -96,7 +96,7 @@ this.code = function () { // Bing Maps var bing = new Cesium.BingMapsTileProvider({ - server : "dev.virtualearth.net", + server : 'dev.virtualearth.net', mapStyle : Cesium.BingMapsStyle.AERIAL, // Some versions of Safari support WebGL, but don't correctly implement // cross-origin image loading, so we need to load Bing imagery using a proxy. @@ -104,7 +104,7 @@ }); // Single texture - var single = new Cesium.SingleTileProvider("Images/NE2_50M_SR_W_4096.jpg"); + var single = new Cesium.SingleTileProvider('Images/NE2_50M_SR_W_4096.jpg'); // Composite tile provider var composite = new Cesium.CompositeTileProvider([{ diff --git a/Examples/Sandbox/CodeSnippets/Label.js b/Examples/Sandbox/CodeSnippets/Label.js index 153275b11c7..8cd73576d4b 100644 --- a/Examples/Sandbox/CodeSnippets/Label.js +++ b/Examples/Sandbox/CodeSnippets/Label.js @@ -7,7 +7,7 @@ var labels = new Cesium.LabelCollection(undefined); labels.add({ position : ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic2(-75.10, 39.57)), - text : "Philadelphia" + text : 'Philadelphia' }); primitives.add(labels); @@ -19,15 +19,15 @@ var labels = new Cesium.LabelCollection(undefined); labels.add({ position : ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic2(-75.10, 39.57)), - text : "Philadelphia" + text : 'Philadelphia' }); labels.add({ position : ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic2(-80.50, 35.14)), - text : "Charlotte" + text : 'Charlotte' }); labels.add({ position : ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic2(-80.12, 25.46)), - text : "Miami" + text : 'Miami' }); primitives.add(labels); @@ -39,9 +39,9 @@ var labels = new Cesium.LabelCollection(undefined); labels.add({ position : ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic2(-75.10, 39.57)), - text : "Philadelphia", + text : 'Philadelphia', // CSS font-family - font : "36px Helvetica", + font : '36px Helvetica', fillColor : { red : 0.0, blue : 1.0, green : 1.0, alpha : 1.0 }, outlineColor : { red : 0.0, blue : 0.0, green : 0.0, alpha : 1.0 }, style : Cesium.LabelStyle.FILL_AND_OUTLINE @@ -56,7 +56,7 @@ var labels = new Cesium.LabelCollection(undefined); var l = labels.add({ position : ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic2(-75.10, 39.57)), - text : "Philadelphia" + text : 'Philadelphia' }); l.setPosition(ellipsoid.cartographicDegreesToCartesian(new Cesium.Cartographic3(-75.10, 39.57, 300000.0))); @@ -74,19 +74,19 @@ labels.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center); labels.add({ position : new Cesium.Cartesian3(0.0, 0.0, 0.0), - text : "Center" + text : 'Center' }); labels.add({ position : new Cesium.Cartesian3(1000000.0, 0.0, 0.0), - text : "East" + text : 'East' }); labels.add({ position : new Cesium.Cartesian3(0.0, 1000000.0, 0.0), - text : "North" + text : 'North' }); labels.add({ position : new Cesium.Cartesian3(0.0, 0.0, 1000000.0), - text : "Up" + text : 'Up' }); primitives.add(labels); diff --git a/Examples/Sandbox/CodeSnippets/Picking.js b/Examples/Sandbox/CodeSnippets/Picking.js index 2ea992ff13f..f2f5df2d02e 100644 --- a/Examples/Sandbox/CodeSnippets/Picking.js +++ b/Examples/Sandbox/CodeSnippets/Picking.js @@ -15,11 +15,11 @@ if (p) { var d = Cesium.Math.cartographic2ToDegrees(ellipsoid.toCartographic2(p)); label.setShow(true); - label.setText("(" + d.longitude.toFixed(2) + ", " + d.latitude.toFixed(2) + ")"); + label.setText('(' + d.longitude.toFixed(2) + ', ' + d.latitude.toFixed(2) + ')'); label.setPosition(p); } else { - label.setText(""); + label.setText(''); } }, Cesium.MouseEventType.MOVE @@ -70,7 +70,7 @@ }); primitives.add(billboards); }; - image.src = "Images/logoColor.png"; + image.src = 'Images/logoColor.png'; }; this.clear = function () { @@ -164,7 +164,7 @@ billboard.highlighted = true; primitives.add(billboards); }; - image.src = "Images/logoColor.png"; + image.src = 'Images/logoColor.png'; }; this.clear = function () { @@ -298,7 +298,7 @@ // Prevent multiple erosions eroding = true; - scene.getAnimations().addProperty(sensor, "erosion", 1.0, 0.0, { + scene.getAnimations().addProperty(sensor, 'erosion', 1.0, 0.0, { onComplete : function() { sensors.remove(sensor); } diff --git a/Examples/Sandbox/CodeSnippets/Polygon.js b/Examples/Sandbox/CodeSnippets/Polygon.js index d75c2a7a0bb..047eab2e4f1 100644 --- a/Examples/Sandbox/CodeSnippets/Polygon.js +++ b/Examples/Sandbox/CodeSnippets/Polygon.js @@ -153,7 +153,7 @@ tRepeat : 1 }); }; - image.src = "../../Images/Cesium_Logo_Color.jpg"; + image.src = '../../Images/Cesium_Logo_Color.jpg'; primitives.add(polygon); }; @@ -249,7 +249,7 @@ }); primitives.add(polygon); - scene.getAnimations().addProperty(polygon, "erosion", 0.0, 1.0); + scene.getAnimations().addProperty(polygon, 'erosion', 0.0, 1.0); }; }; @@ -287,7 +287,7 @@ }); primitives.add(polygon); - scene.getAnimations().addProperty(polygon, "height", 2000000.0, 0.0); + scene.getAnimations().addProperty(polygon, 'height', 2000000.0, 0.0); }; }; diff --git a/Examples/Sandbox/CodeSnippets/SensorVolumes.js b/Examples/Sandbox/CodeSnippets/SensorVolumes.js index 0a2a3598e65..388773a864f 100644 --- a/Examples/Sandbox/CodeSnippets/SensorVolumes.js +++ b/Examples/Sandbox/CodeSnippets/SensorVolumes.js @@ -444,7 +444,7 @@ }); primitives.add(sensors); - scene.getAnimations().addProperty(sensor, "erosion", 0.0, 1.0); + scene.getAnimations().addProperty(sensor, 'erosion', 0.0, 1.0); }; this.camera = camera; diff --git a/Examples/Sandbox/Controls.js b/Examples/Sandbox/Controls.js index 487540e2f27..5f223eed759 100644 --- a/Examples/Sandbox/Controls.js +++ b/Examples/Sandbox/Controls.js @@ -5,48 +5,48 @@ dojo.addOnLoad(function() { // Entry animations var fadeOut = dojo.fadeOut({ - node : "toolbar", + node : 'toolbar', duration : 100 }); var preloaderFadeOut = dojo.fadeOut({ - node : "preloader", + node : 'preloader', onEnd : function() { - dojo.style("preloader", "display", "none"); + dojo.style('preloader', 'display', 'none'); }, duration : 100 }); var fadeIn = dojo.fadeIn({ - node : "toolbar", + node : 'toolbar', duration : 500 }); var wipeIn = dojo.fx.wipeIn({ - node : "toolbar", + node : 'toolbar', duration : 500 }); dojo.fx.chain([fadeOut, preloaderFadeOut, dojo.fx.combine([fadeIn, wipeIn])]).play(); // Tool tips - dijit.Tooltip.defaultPosition = ["above"]; + dijit.Tooltip.defaultPosition = ['above']; /*jslint nonew : false*/ new dijit.Tooltip({ - connectId : ["addOverlay"], - label : "Add or Edit an Overlay", + connectId : ['addOverlay'], + label : 'Add or Edit an Overlay', showDelay : 750 }); new dijit.Tooltip({ - connectId : ["removeOverlay"], - label : "Remove Overlay(s)", + connectId : ['removeOverlay'], + label : 'Remove Overlay(s)', showDelay : 750 }); new dijit.Tooltip({ - connectId : ["documentation"], - label : "Open documentation for selected text in new window", + connectId : ['documentation'], + label : 'Open documentation for selected text in new window', showDelay : 750 }); }); @@ -55,15 +55,15 @@ autofocus : false, closable : true, dimensions : [600, 400] - }, "overlayDialog"); + }, 'overlayDialog'); // Toolbar button controls var addOverlay = dojo.byId('addOverlay'); addOverlay.onmouseover = function() { - addOverlay.src = "./icons/addOverlayMouseOver.png"; + addOverlay.src = './icons/addOverlayMouseOver.png'; }; addOverlay.onmouseout = function() { - addOverlay.src = "./icons/addOverlay.png"; + addOverlay.src = './icons/addOverlay.png'; }; addOverlay.onclick = function() { @@ -74,14 +74,14 @@ autofocus : false, closable : true, dimensions : [250, 400] - }, "removeOverlayDialog"); + }, 'removeOverlayDialog'); var removeOverlay = dojo.byId('removeOverlay'); removeOverlay.onmouseover = function() { - removeOverlay.src = "./icons/removeOverlayMouseOver.png"; + removeOverlay.src = './icons/removeOverlayMouseOver.png'; }; removeOverlay.onmouseout = function() { - removeOverlay.src = "./icons/removeOverlay.png"; + removeOverlay.src = './icons/removeOverlay.png'; }; removeOverlay.onclick = function() { removeOverlayDialog.show(); @@ -89,9 +89,9 @@ var documentation = dojo.byId('documentation'); documentation.onmouseover = function() { - documentation.src = "./icons/documentationMouseOver.png"; + documentation.src = './icons/documentationMouseOver.png'; }; documentation.onmouseout = function() { - documentation.src = "./icons/documentation.png"; + documentation.src = './icons/documentation.png'; }; }()); \ No newline at end of file diff --git a/Examples/Sandbox/Editor.js b/Examples/Sandbox/Editor.js index 8817539d1a6..9685ba9ac90 100644 --- a/Examples/Sandbox/Editor.js +++ b/Examples/Sandbox/Editor.js @@ -11,11 +11,11 @@ */ Sandbox.Editor = function(id) { define('ace/mode/cesium', function(require, exports, module) { - var oop = require("pilot/oop"); - var TextMode = require("ace/mode/text").Mode; - var Tokenizer = require("ace/tokenizer").Tokenizer; - var WorkerClient = require("ace/worker/worker_client").WorkerClient; - var CesiumHighlightRules = require("ace/mode/cesium_highlight_rules").CesiumHighlightRules; + var oop = require('pilot/oop'); + var TextMode = require('ace/mode/text').Mode; + var Tokenizer = require('ace/tokenizer').Tokenizer; + var WorkerClient = require('ace/worker/worker_client').WorkerClient; + var CesiumHighlightRules = require('ace/mode/cesium_highlight_rules').CesiumHighlightRules; var Mode = function() { this.$tokenizer = new Tokenizer(new CesiumHighlightRules().getRules()); @@ -25,18 +25,18 @@ // Create a worker to enable jslint this.createWorker = function(session) { var doc = session.getDocument(); - var worker = new WorkerClient(["ace", "pilot"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker"); - worker.call("setValue", [doc.getValue()]); + var worker = new WorkerClient(['ace', 'pilot'], 'worker-javascript.js', 'ace/mode/javascript_worker', 'JavaScriptWorker'); + worker.call('setValue', [doc.getValue()]); - doc.on("change", function(e) { + doc.on('change', function(e) { e.range = { start : e.data.range.start, end : e.data.range.end }; - worker.emit("change", e); + worker.emit('change', e); }); - worker.on("jslint", function(results) { + worker.on('jslint', function(results) { var errors = []; for ( var i = 0; i < results.data.length; i++) { var error = results.data[i]; @@ -45,7 +45,7 @@ row : error.line - 1, column : error.character - 1, text : error.reason, - type : "warning", + type : 'warning', lint : error }); } @@ -53,11 +53,11 @@ session.setAnnotations(errors); }); - worker.on("narcissus", function(e) { + worker.on('narcissus', function(e) { session.setAnnotations([e.data]); }); - worker.on("terminate", function() { + worker.on('terminate', function() { session.clearAnnotations(); }); @@ -70,13 +70,13 @@ }); define('ace/mode/cesium_highlight_rules', function(require, exports, module) { - var oop = require("pilot/oop"); - var JavaScriptHighlightRules = require("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules; + var oop = require('pilot/oop'); + var JavaScriptHighlightRules = require('ace/mode/javascript_highlight_rules').JavaScriptHighlightRules; var CesiumHighlightRules = function() { this.$rules = new JavaScriptHighlightRules().getRules(); this.$rules.start.unshift({ - token : "variable.language", - regex : "Cesium.?[A-Za-z0-9]*" + token : 'variable.language', + regex : 'Cesium.?[A-Za-z0-9]*' }); }; oop.inherits(CesiumHighlightRules, JavaScriptHighlightRules); @@ -84,7 +84,7 @@ }); var editor = ace.edit(id); - var CesiumMode = require("ace/mode/cesium").Mode; + var CesiumMode = require('ace/mode/cesium').Mode; editor.getSession().setMode(new CesiumMode()); editor.renderer.setShowPrintMargin(false); editor.getSession().setUseSoftTabs(true); @@ -144,9 +144,9 @@ var docLink = document.getElementById('docLink'); var selection = editor.getSession().doc.getTextRange(editor.getSelectionRange()); if (selection.match(/Cesium\.?[A-za-z0-9]*/)) { - docLink.href = "../../Documentation/symbols/" + selection + ".html"; + docLink.href = '../../Documentation/symbols/' + selection + '.html'; } else { - docLink.href = "../../Documentation/index.html?classFilter=" + selection; + docLink.href = '../../Documentation/index.html?classFilter=' + selection; } }); }; diff --git a/Examples/Sandbox/Main.js b/Examples/Sandbox/Main.js index 1047fbc3cd2..6f4855bb8a6 100644 --- a/Examples/Sandbox/Main.js +++ b/Examples/Sandbox/Main.js @@ -19,22 +19,22 @@ } // Remove "use strict", which is in FF, not Chrome - var formattedCode = lines.join('\n').replace(/"use strict";\n\s*/, ""); + var formattedCode = lines.join('\n').replace(/"use strict";\n\s*/, ''); // Firefox workaround: Function.toString strips empty parenthesis from default constructors. // Add the removed parentheses to the first instance, assuming a semicolon follows. - var defaultConstructedTypes = ["Image"]; + var defaultConstructedTypes = ['Image']; for (i = 0; i < defaultConstructedTypes.length; i++) { - var regex = new RegExp(defaultConstructedTypes[i] + ";", "g"); - formattedCode = formattedCode.replace(regex, defaultConstructedTypes[i] + "();"); + var regex = new RegExp(defaultConstructedTypes[i] + ';', 'g'); + formattedCode = formattedCode.replace(regex, defaultConstructedTypes[i] + '();'); } return formattedCode; }; // Set up the Ace editor - var editor = new Sandbox.Editor("editor"); - var sampleMessage = "// Select one of the examples from the tree. The corresponding code will be\n// shown in this editor, which you can modify and run.\n"; + var editor = new Sandbox.Editor('editor'); + var sampleMessage = '// Select one of the examples from the tree. The corresponding code will be\n// shown in this editor, which you can modify and run.\n'; var compileTimer; editor.display(sampleMessage); editor.linkToDoc(); @@ -52,122 +52,122 @@ // Build and publish codesnippet treeview var divNum = 0; - var treeContainer = document.getElementById("tree"); + var treeContainer = document.getElementById('tree'); var treeDiv = document.createElement('div'); - treeDiv.id = "tree" + divNum.toString(); + treeDiv.id = 'tree' + divNum.toString(); treeContainer.appendChild(treeDiv); var tree = new Sandbox.Tree(treeDiv.id); - var pl = tree.addNode("Polyline", "", null, "Polyline"); - tree.addNode("Draw a line between two points", [new Sandbox.PolylineTwoPoints(scene, ellipsoid, primitives)], pl, "Polyline"); - tree.addNode("Draw a line between several points", [new Sandbox.PolylineSeveralPoints(scene, ellipsoid, primitives)], pl, "Polyline"); - tree.addNode("Set the interior and outline color", [new Sandbox.PolylineColor(scene, ellipsoid, primitives)], pl, "Polyline"); - tree.addNode("Set the interior and outline translucency", [new Sandbox.PolylineTranslucency(scene, ellipsoid, primitives)], pl, "Polyline"); - tree.addNode("Set the interior and outline width", [new Sandbox.PolylineWidth(scene, ellipsoid, primitives)], pl, "Polyline"); - tree.addNode("Draw a line in a local reference frame", [new Sandbox.PolylineReferenceFrame(scene, ellipsoid, primitives)], pl, "Polyline"); - - var pg = tree.addNode("Polygon", "", null, "Polygon"); - tree.addNode("Draw a polygon", [new Sandbox.Polygon(scene, ellipsoid, primitives)], pg, "Polygon"); - tree.addNode("Draw a polygon using an extent", [new Sandbox.PolygonWithExtent(scene, ellipsoid, primitives)], pg, "Polygon"); - var mat = tree.addNode("Materials", "", pg, "Material"); - tree.addNode("Modify the default material", [new Sandbox.PolygonColor(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a stripe material", [new Sandbox.StripePolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a checkerboard material", [new Sandbox.CheckerboardPolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a dot material", [new Sandbox.DotPolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a diffuse map material", [new Sandbox.DiffuseMapPolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a tie-dye material", [new Sandbox.TieDyePolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a facet material", [new Sandbox.FacetPolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - tree.addNode("Apply a blob material", [new Sandbox.BlobPolygonMaterial(scene, ellipsoid, primitives)], mat, "Material"); - var animate = tree.addNode("Animations", "", pg, "Animation"); - tree.addNode("Use an erosion animation", [new Sandbox.ErosionPolygonAnimation(scene, ellipsoid, primitives)], animate, "Animation"); - tree.addNode("Use an alpha animation", [new Sandbox.AlphaPolygonAnimation(scene, ellipsoid, primitives)], animate, "Animation"); - tree.addNode("Use a height animation", [new Sandbox.HeightPolygonAnimation(scene, ellipsoid, primitives)], animate, "Animation"); - - var cir = tree.addNode("Circle", "", null, "Circle"); - tree.addNode("Outline a circle", [new Sandbox.OutlineCircle(scene, ellipsoid, primitives)], cir, "Circle"); - tree.addNode("Fill a circle", [new Sandbox.FilledCircle(scene, ellipsoid, primitives)], cir, "Circle"); - tree.addNode("Fill an ellipse", [new Sandbox.FilledEllipse(scene, ellipsoid, primitives)], cir, "Circle"); - tree.addNode("Apply a material to a filled circle", [new Sandbox.FilledCircleMaterial(scene, ellipsoid, primitives)], cir, "Circle"); - - var bb = tree.addNode("Billboard", "", null, "Billboard"); - tree.addNode("Draw a billboard", [new Sandbox.Billboard(scene, ellipsoid, primitives)], bb, "Billboard"); - tree.addNode("Draw several billboards", [new Sandbox.SeveralBillboards(scene, ellipsoid, primitives)], bb, "Billboard"); - tree.addNode("Draw points using billboards", [new Sandbox.PointBillboards(scene, ellipsoid, primitives)], bb, "Billboard"); - tree.addNode("Draw markers using billboards", [new Sandbox.MarkerBillboards(scene, ellipsoid, primitives)], bb, "Billboard"); - tree.addNode("Set billboard properties at creation", [new Sandbox.BillboardPropertiesCreation(scene, ellipsoid, primitives)], bb, "Billboard"); - tree.addNode("Set billboard properties after creation", [new Sandbox.BillboardProperties(scene, ellipsoid, primitives)], bb, "Billboard"); - tree.addNode("Draw billboards in a local reference frame", [new Sandbox.BillboardReferenceFrame(scene, ellipsoid, primitives)], bb, "Billboard"); - - var lbl = tree.addNode("Label", "", null, "Label"); - tree.addNode("Draw a label", [new Sandbox.Label(scene, ellipsoid, primitives)], lbl, "Label"); - tree.addNode("Draw several labels", [new Sandbox.Labels(scene, ellipsoid, primitives)], lbl, "Label"); - tree.addNode("Set label font and style at creation", [new Sandbox.LabelFont(scene, ellipsoid, primitives)], lbl, "Label"); - tree.addNode("Set label properties after creation", [new Sandbox.LabelProperties(scene, ellipsoid, primitives)], lbl, "Label"); - tree.addNode("Draw labels in a local reference frame", [new Sandbox.LabelReferenceFrame(scene, ellipsoid, primitives)], lbl, "Label"); - - var sens = tree.addNode("Sensor", "", null, "Sensor"); - - var rs = tree.addNode("Rectangular Sensors", "", sens, "Sensor"); - tree.addNode("Draw a rectangular sensor", [new Sandbox.RectangularPyramidSensorVolume(scene, ellipsoid, primitives)], rs, "Sensor"); - - var customSensors = tree.addNode("Custom Sensors", "", sens, "Sensor"); - tree.addNode("Draw a custom sensor", [new Sandbox.CustomSensorVolume(scene, ellipsoid, primitives)], customSensors, "Sensor"); - - var cs = tree.addNode("Conic Sensors", "", sens, "Sensor"); - tree.addNode("Draw a conic sensor", [new Sandbox.ConicSensorVolume(scene, ellipsoid, primitives)], cs, "Sensor"); - tree.addNode("Draw a conic sensor with clock angles", [new Sandbox.ConicSensorVolumeClockAngles(scene, ellipsoid, primitives)], cs, "Sensor"); - var mt = tree.addNode("Materials", "", sens, "Material"); - tree.addNode("Modify the default material", [new Sandbox.SensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a stripe material", [new Sandbox.StripeSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a distance interval material", [new Sandbox.DistanceIntervalSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a checkerboard material", [new Sandbox.CheckerboardSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a dot material", [new Sandbox.DotSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a tie-dye material", [new Sandbox.TieDyeSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a facet material", [new Sandbox.FacetSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply a blob material", [new Sandbox.BlobSensorMaterial(scene, ellipsoid, primitives)], mt, "Material"); - tree.addNode("Apply multiple materials to a conic sensor", [new Sandbox.SensorMaterialPerSurface(scene, ellipsoid, primitives)], mt, "Material"); - var anim = tree.addNode("Animation", "", sens, "Animation"); - tree.addNode("Use an erosion animation", [new Sandbox.ErosionSensorAnimation(scene, ellipsoid, primitives)], anim, "Animation"); - tree.addNode("Use an alpha animation", [new Sandbox.AlphaSensorAnimation(scene, ellipsoid, primitives)], anim, "Animation"); - tree.addNode("Animate stripes", [new Sandbox.AnimateSensorStripes(scene, ellipsoid, primitives)], anim, "Animation"); - - var comp = tree.addNode("Composite", "", null, "Composite"); - tree.addNode("Layer primitives on top of each other", [new Sandbox.CompositeLayering(scene, ellipsoid, primitives)], comp, "Composite"); - - var cam = tree.addNode("Camera", "", null, "Camera"); - tree.addNode("Fly to Los Angeles", [new Sandbox.CameraFlyToLosAngeles(scene, ellipsoid, primitives)], cam, "Camera"); - tree.addNode("Set camera's reference frame", [new Sandbox.CameraReferenceFrame(scene, ellipsoid, primitives)], cam, "Camera"); - tree.addNode("View an extent", [new Sandbox.ViewExtent(scene, ellipsoid, primitives)], cam, "Camera"); - - var pick = tree.addNode("Picking", "", null, "Picking"); - tree.addNode("Show cartographic position on mouse-over", [new Sandbox.PickingCartographicMouseOver(scene, ellipsoid, primitives)], pick, "Picking"); - tree.addNode("Highlight a billboard on mouse-over", [new Sandbox.PickingBillboardMouseOver(scene, ellipsoid, primitives)], pick, "Picking"); - var ani = tree.addNode("Animations", "", pick, "Animation"); - tree.addNode("Animate highlighting a billboard on mouse-over", [new Sandbox.PickingBillboardAnimationMouseOver(scene, ellipsoid, primitives)], ani, "Animation"); - tree.addNode("Animate highlighting a polygon on mouse-over", [new Sandbox.PickingPolygonAnimationMouseOver(scene, ellipsoid, primitives)], ani, "Animation"); - tree.addNode("Erode a sensor on double-click", [new Sandbox.PickingErodeSensorDoubleClick(scene, ellipsoid, primitives)], ani, "Animation"); - - var cenbod = tree.addNode("Central Body", "", null, "Central Body"); - tree.addNode("Toggle clouds", [new Sandbox.CentralBodyShowClouds(cb), new Sandbox.CentralBodyHideClouds(cb)], cenbod, "CentralBody"); - tree.addNode("Toggle cloud shadows", [new Sandbox.CentralBodyShowCloudShadows(cb), new Sandbox.CentralBodyHideCloudShadows(cb)], cenbod, "CentralBody"); - tree.addNode("Toggle bumps", [new Sandbox.CentralBodyShowBumps(cb), new Sandbox.CentralBodyHideBumps(cb)], cenbod, "CentralBody"); - tree.addNode("Toggle specular", [new Sandbox.CentralBodyShowSpecular(cb), new Sandbox.CentralBodyHideSpecular(cb)], cenbod, "CentralBody"); - tree.addNode("Toggle sky atmosphere", [new Sandbox.CentralBodyShowSkyAtmosphere(cb), new Sandbox.CentralBodyHideSkyAtmosphere(cb)], cenbod, "CentralBody"); - tree.addNode("Toggle ground atmosphere", [new Sandbox.CentralBodyShowGroundAtmosphere(cb), new Sandbox.CentralBodyHideGroundAtmosphere(cb)], cenbod, "CentralBody"); - - var imagery = tree.addNode("Imagery", "", null, "Imagery"); - tree.addNode("Use Bing Maps imagery", [new Sandbox.BingMaps(scene, ellipsoid, primitives)], imagery, "Imagery"); - tree.addNode("Use ArcGIS World Street Maps imagery", [new Sandbox.ArcGIS(scene, ellipsoid, primitives)], imagery, "Imagery"); - tree.addNode("Use OpenStreetMaps imagery", [new Sandbox.OSM(scene, ellipsoid, primitives)], imagery, "Imagery"); - tree.addNode("Use MapQuest OpenStreetMaps imagery", [new Sandbox.MQOSM(scene, ellipsoid, primitives)], imagery, "Imagery"); - tree.addNode("Use MapQuest Aerial OpenStreetMaps imagery", [new Sandbox.MQAerialOSM(scene, ellipsoid, primitives)], imagery, "Imagery"); - tree.addNode("Use Stamen maps", [new Sandbox.Stamen(scene, ellipsoid, primitives)], imagery, "Imagery"); - - tree.addNode("Use a single texture", [new Sandbox.Single(scene, ellipsoid, primitives)], imagery, "Imagery"); - tree.addNode("Use a composite imagery", [new Sandbox.CompositeTiler(scene, ellipsoid, primitives)], imagery, "Imagery"); - - var adv = tree.addNode("Advanced", "", null, "Advanced"); - tree.addNode("Draw a box using custom rendering", [new Sandbox.CustomRendering(scene, ellipsoid, primitives)], adv, "Advanced"); + var pl = tree.addNode('Polyline', '', null, 'Polyline'); + tree.addNode('Draw a line between two points', [new Sandbox.PolylineTwoPoints(scene, ellipsoid, primitives)], pl, 'Polyline'); + tree.addNode('Draw a line between several points', [new Sandbox.PolylineSeveralPoints(scene, ellipsoid, primitives)], pl, 'Polyline'); + tree.addNode('Set the interior and outline color', [new Sandbox.PolylineColor(scene, ellipsoid, primitives)], pl, 'Polyline'); + tree.addNode('Set the interior and outline translucency', [new Sandbox.PolylineTranslucency(scene, ellipsoid, primitives)], pl, 'Polyline'); + tree.addNode('Set the interior and outline width', [new Sandbox.PolylineWidth(scene, ellipsoid, primitives)], pl, 'Polyline'); + tree.addNode('Draw a line in a local reference frame', [new Sandbox.PolylineReferenceFrame(scene, ellipsoid, primitives)], pl, 'Polyline'); + + var pg = tree.addNode('Polygon', '', null, 'Polygon'); + tree.addNode('Draw a polygon', [new Sandbox.Polygon(scene, ellipsoid, primitives)], pg, 'Polygon'); + tree.addNode('Draw a polygon using an extent', [new Sandbox.PolygonWithExtent(scene, ellipsoid, primitives)], pg, 'Polygon'); + var mat = tree.addNode('Materials', '', pg, 'Material'); + tree.addNode('Modify the default material', [new Sandbox.PolygonColor(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a stripe material', [new Sandbox.StripePolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a checkerboard material', [new Sandbox.CheckerboardPolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a dot material', [new Sandbox.DotPolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a diffuse map material', [new Sandbox.DiffuseMapPolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a tie-dye material', [new Sandbox.TieDyePolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a facet material', [new Sandbox.FacetPolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + tree.addNode('Apply a blob material', [new Sandbox.BlobPolygonMaterial(scene, ellipsoid, primitives)], mat, 'Material'); + var animate = tree.addNode('Animations', '', pg, 'Animation'); + tree.addNode('Use an erosion animation', [new Sandbox.ErosionPolygonAnimation(scene, ellipsoid, primitives)], animate, 'Animation'); + tree.addNode('Use an alpha animation', [new Sandbox.AlphaPolygonAnimation(scene, ellipsoid, primitives)], animate, 'Animation'); + tree.addNode('Use a height animation', [new Sandbox.HeightPolygonAnimation(scene, ellipsoid, primitives)], animate, 'Animation'); + + var cir = tree.addNode('Circle', '', null, 'Circle'); + tree.addNode('Outline a circle', [new Sandbox.OutlineCircle(scene, ellipsoid, primitives)], cir, 'Circle'); + tree.addNode('Fill a circle', [new Sandbox.FilledCircle(scene, ellipsoid, primitives)], cir, 'Circle'); + tree.addNode('Fill an ellipse', [new Sandbox.FilledEllipse(scene, ellipsoid, primitives)], cir, 'Circle'); + tree.addNode('Apply a material to a filled circle', [new Sandbox.FilledCircleMaterial(scene, ellipsoid, primitives)], cir, 'Circle'); + + var bb = tree.addNode('Billboard', '', null, 'Billboard'); + tree.addNode('Draw a billboard', [new Sandbox.Billboard(scene, ellipsoid, primitives)], bb, 'Billboard'); + tree.addNode('Draw several billboards', [new Sandbox.SeveralBillboards(scene, ellipsoid, primitives)], bb, 'Billboard'); + tree.addNode('Draw points using billboards', [new Sandbox.PointBillboards(scene, ellipsoid, primitives)], bb, 'Billboard'); + tree.addNode('Draw markers using billboards', [new Sandbox.MarkerBillboards(scene, ellipsoid, primitives)], bb, 'Billboard'); + tree.addNode('Set billboard properties at creation', [new Sandbox.BillboardPropertiesCreation(scene, ellipsoid, primitives)], bb, 'Billboard'); + tree.addNode('Set billboard properties after creation', [new Sandbox.BillboardProperties(scene, ellipsoid, primitives)], bb, 'Billboard'); + tree.addNode('Draw billboards in a local reference frame', [new Sandbox.BillboardReferenceFrame(scene, ellipsoid, primitives)], bb, 'Billboard'); + + var lbl = tree.addNode('Label', '', null, 'Label'); + tree.addNode('Draw a label', [new Sandbox.Label(scene, ellipsoid, primitives)], lbl, 'Label'); + tree.addNode('Draw several labels', [new Sandbox.Labels(scene, ellipsoid, primitives)], lbl, 'Label'); + tree.addNode('Set label font and style at creation', [new Sandbox.LabelFont(scene, ellipsoid, primitives)], lbl, 'Label'); + tree.addNode('Set label properties after creation', [new Sandbox.LabelProperties(scene, ellipsoid, primitives)], lbl, 'Label'); + tree.addNode('Draw labels in a local reference frame', [new Sandbox.LabelReferenceFrame(scene, ellipsoid, primitives)], lbl, 'Label'); + + var sens = tree.addNode('Sensor', '', null, 'Sensor'); + + var rs = tree.addNode('Rectangular Sensors', '', sens, 'Sensor'); + tree.addNode('Draw a rectangular sensor', [new Sandbox.RectangularPyramidSensorVolume(scene, ellipsoid, primitives)], rs, 'Sensor'); + + var customSensors = tree.addNode('Custom Sensors', '', sens, 'Sensor'); + tree.addNode('Draw a custom sensor', [new Sandbox.CustomSensorVolume(scene, ellipsoid, primitives)], customSensors, 'Sensor'); + + var cs = tree.addNode('Conic Sensors', '', sens, 'Sensor'); + tree.addNode('Draw a conic sensor', [new Sandbox.ConicSensorVolume(scene, ellipsoid, primitives)], cs, 'Sensor'); + tree.addNode('Draw a conic sensor with clock angles', [new Sandbox.ConicSensorVolumeClockAngles(scene, ellipsoid, primitives)], cs, 'Sensor'); + var mt = tree.addNode('Materials', '', sens, 'Material'); + tree.addNode('Modify the default material', [new Sandbox.SensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a stripe material', [new Sandbox.StripeSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a distance interval material', [new Sandbox.DistanceIntervalSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a checkerboard material', [new Sandbox.CheckerboardSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a dot material', [new Sandbox.DotSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a tie-dye material', [new Sandbox.TieDyeSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a facet material', [new Sandbox.FacetSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply a blob material', [new Sandbox.BlobSensorMaterial(scene, ellipsoid, primitives)], mt, 'Material'); + tree.addNode('Apply multiple materials to a conic sensor', [new Sandbox.SensorMaterialPerSurface(scene, ellipsoid, primitives)], mt, 'Material'); + var anim = tree.addNode('Animation', '', sens, 'Animation'); + tree.addNode('Use an erosion animation', [new Sandbox.ErosionSensorAnimation(scene, ellipsoid, primitives)], anim, 'Animation'); + tree.addNode('Use an alpha animation', [new Sandbox.AlphaSensorAnimation(scene, ellipsoid, primitives)], anim, 'Animation'); + tree.addNode('Animate stripes', [new Sandbox.AnimateSensorStripes(scene, ellipsoid, primitives)], anim, 'Animation'); + + var comp = tree.addNode('Composite', '', null, 'Composite'); + tree.addNode('Layer primitives on top of each other', [new Sandbox.CompositeLayering(scene, ellipsoid, primitives)], comp, 'Composite'); + + var cam = tree.addNode('Camera', '', null, 'Camera'); + tree.addNode('Fly to Los Angeles', [new Sandbox.CameraFlyToLosAngeles(scene, ellipsoid, primitives)], cam, 'Camera'); + tree.addNode('Set the camera reference frame', [new Sandbox.CameraReferenceFrame(scene, ellipsoid, primitives)], cam, 'Camera'); + tree.addNode('View an extent', [new Sandbox.ViewExtent(scene, ellipsoid, primitives)], cam, 'Camera'); + + var pick = tree.addNode('Picking', '', null, 'Picking'); + tree.addNode('Show cartographic position on mouse-over', [new Sandbox.PickingCartographicMouseOver(scene, ellipsoid, primitives)], pick, 'Picking'); + tree.addNode('Highlight a billboard on mouse-over', [new Sandbox.PickingBillboardMouseOver(scene, ellipsoid, primitives)], pick, 'Picking'); + var ani = tree.addNode('Animations', '', pick, 'Animation'); + tree.addNode('Animate highlighting a billboard on mouse-over', [new Sandbox.PickingBillboardAnimationMouseOver(scene, ellipsoid, primitives)], ani, 'Animation'); + tree.addNode('Animate highlighting a polygon on mouse-over', [new Sandbox.PickingPolygonAnimationMouseOver(scene, ellipsoid, primitives)], ani, 'Animation'); + tree.addNode('Erode a sensor on double-click', [new Sandbox.PickingErodeSensorDoubleClick(scene, ellipsoid, primitives)], ani, 'Animation'); + + var cenbod = tree.addNode('Central Body', '', null, 'Central Body'); + tree.addNode('Toggle clouds', [new Sandbox.CentralBodyShowClouds(cb), new Sandbox.CentralBodyHideClouds(cb)], cenbod, 'CentralBody'); + tree.addNode('Toggle cloud shadows', [new Sandbox.CentralBodyShowCloudShadows(cb), new Sandbox.CentralBodyHideCloudShadows(cb)], cenbod, 'CentralBody'); + tree.addNode('Toggle bumps', [new Sandbox.CentralBodyShowBumps(cb), new Sandbox.CentralBodyHideBumps(cb)], cenbod, 'CentralBody'); + tree.addNode('Toggle specular', [new Sandbox.CentralBodyShowSpecular(cb), new Sandbox.CentralBodyHideSpecular(cb)], cenbod, 'CentralBody'); + tree.addNode('Toggle sky atmosphere', [new Sandbox.CentralBodyShowSkyAtmosphere(cb), new Sandbox.CentralBodyHideSkyAtmosphere(cb)], cenbod, 'CentralBody'); + tree.addNode('Toggle ground atmosphere', [new Sandbox.CentralBodyShowGroundAtmosphere(cb), new Sandbox.CentralBodyHideGroundAtmosphere(cb)], cenbod, 'CentralBody'); + + var imagery = tree.addNode('Imagery', '', null, 'Imagery'); + tree.addNode('Use Bing Maps imagery', [new Sandbox.BingMaps(scene, ellipsoid, primitives)], imagery, 'Imagery'); + tree.addNode('Use ArcGIS World Street Maps imagery', [new Sandbox.ArcGIS(scene, ellipsoid, primitives)], imagery, 'Imagery'); + tree.addNode('Use OpenStreetMaps imagery', [new Sandbox.OSM(scene, ellipsoid, primitives)], imagery, 'Imagery'); + tree.addNode('Use MapQuest OpenStreetMaps imagery', [new Sandbox.MQOSM(scene, ellipsoid, primitives)], imagery, 'Imagery'); + tree.addNode('Use MapQuest Aerial OpenStreetMaps imagery', [new Sandbox.MQAerialOSM(scene, ellipsoid, primitives)], imagery, 'Imagery'); + tree.addNode('Use Stamen maps', [new Sandbox.Stamen(scene, ellipsoid, primitives)], imagery, 'Imagery'); + + tree.addNode('Use a single texture', [new Sandbox.Single(scene, ellipsoid, primitives)], imagery, 'Imagery'); + tree.addNode('Use a composite imagery', [new Sandbox.CompositeTiler(scene, ellipsoid, primitives)], imagery, 'Imagery'); + + var adv = tree.addNode('Advanced', '', null, 'Advanced'); + tree.addNode('Draw a box using custom rendering', [new Sandbox.CustomRendering(scene, ellipsoid, primitives)], adv, 'Advanced'); tree.publish(); @@ -184,16 +184,16 @@ }; function connectTreeToCodeSnippets(tree) { - dojo.connect(tree.getTree(), "onClick", function(item, node, evt) { + dojo.connect(tree.getTree(), 'onClick', function(item, node, evt) { if (currentCodeSnippet && currentCodeSnippet.clear) { currentCodeSnippet.clear(); } - currentCodeSnippet = tree.getStore().getValue(item, "codeSnippet", "null"); + currentCodeSnippet = tree.getStore().getValue(item, 'codeSnippet', 'null'); if (currentCodeSnippet && currentCodeSnippet.code) { - editor.display(Sandbox.beautify(currentCodeSnippet.code.toString().replace("(undefined);", "();"))); + editor.display(Sandbox.beautify(currentCodeSnippet.code.toString().replace('(undefined);', '();'))); scene.getCamera().lookAt(currentCodeSnippet.camera || { eye : new Cesium.Cartesian3(2203128.2853925996, -7504680.128731707, 5615591.201449535), @@ -216,7 +216,7 @@ function recompile() { /*jslint evil : true*/ - var func = new Function("scene", "ellipsoid", "primitives", "cb", editor.getValue()); + var func = new Function('scene', 'ellipsoid', 'primitives', 'cb', editor.getValue()); Sandbox.reset(); func.apply(currentCodeSnippet, [scene, ellipsoid, primitives, cb]); @@ -233,23 +233,23 @@ }); // Search - var searchBox = document.getElementById("searchBox"); + var searchBox = document.getElementById('searchBox'); searchBox.onkeyup = function() { - treeContainer.removeChild(document.getElementById("tree" + (divNum).toString())); + treeContainer.removeChild(document.getElementById('tree' + (divNum).toString())); divNum++; var newTree = document.createElement('div'); - newTree.id = "tree" + (divNum).toString(); + newTree.id = 'tree' + (divNum).toString(); treeContainer.appendChild(newTree); var searchResultsTree = new Sandbox.Tree(newTree.id, tree.search(searchBox.value)); searchResultsTree.publish(); connectTreeToCodeSnippets(searchResultsTree); var fadeOut = dojo.fadeOut({ - node : "tree", + node : 'tree', duration : 1 }); var fadeIn = dojo.fadeIn({ - node : "tree", + node : 'tree', duration : 500 }); dojo.fx.chain([fadeOut, fadeIn]).play(); @@ -259,15 +259,15 @@ // Load Help Content var downloadFile = function(url) { var request = new XMLHttpRequest(); - request.open("GET", url, false); + request.open('GET', url, false); request.send(null); if (request.status !== 200) { - throw new Cesium.RuntimeError("Could not download file: " + url + "."); + throw new Cesium.RuntimeError('Could not download file: ' + url + '.'); } return request.responseText; }; - var helpFile = downloadFile("./help.html"); - var helpBox = document.getElementById("help"); + var helpFile = downloadFile('./help.html'); + var helpBox = document.getElementById('help'); helpBox.innerHTML = helpFile; // Resize Editor @@ -275,27 +275,27 @@ var moveConnects = {}; var spl = borderContainer.getSplitter(region); - dojo.connect(spl, "_startDrag", function() { - moveConnects[spl.widgetId] = dojo.connect(spl.domNode, "onmousemove", function(evt) { + dojo.connect(spl, '_startDrag', function() { + moveConnects[spl.widgetId] = dojo.connect(spl.domNode, 'onmousemove', function(evt) { editor.resize(); }); }); - dojo.connect(spl, "_stopDrag", function(evt) { + dojo.connect(spl, '_stopDrag', function(evt) { editor.resize(); dojo.disconnect(moveConnects[spl.widgetId]); delete moveConnects[spl.widgetId]; }); } dojo.ready(function() { - dojo.style(dojo.byId("sandboxExamples").parentNode, "overflow", "hidden"); + dojo.style(dojo.byId('sandboxExamples').parentNode, 'overflow', 'hidden'); editor.resize(); - watchSplitters(dijit.byId("appLayout"), "left"); - watchSplitters(dijit.byId("inner"), "bottom"); - var editorContainer = dijit.byId("editorContainer"); - dojo.connect(editorContainer, "onMouseEnter", function(evt) { + watchSplitters(dijit.byId('appLayout'), 'left'); + watchSplitters(dijit.byId('inner'), 'bottom'); + var editorContainer = dijit.byId('editorContainer'); + dojo.connect(editorContainer, 'onMouseEnter', function(evt) { editor.resize(); }); - dojo.connect(editorContainer, "onFocus", function(evt) { + dojo.connect(editorContainer, 'onFocus', function(evt) { editor.resize(); }); }); diff --git a/Examples/Sandbox/Overlay.js b/Examples/Sandbox/Overlay.js index fcbeae39145..b389290507a 100644 --- a/Examples/Sandbox/Overlay.js +++ b/Examples/Sandbox/Overlay.js @@ -17,18 +17,18 @@ */ Sandbox.Overlay = function(id, content, sandbox) { if (!id) { - throw new Cesium.DeveloperError("id is required."); + throw new Cesium.DeveloperError('id is required.'); } if (!content) { - throw new Cesium.DeveloperError("content is required."); + throw new Cesium.DeveloperError('content is required.'); } if (!sandbox) { - throw new Cesium.DeveloperError("sandbox is required."); + throw new Cesium.DeveloperError('sandbox is required.'); } - var overlayContainer = document.getElementById("userOverlays"); + var overlayContainer = document.getElementById('userOverlays'); var ellipsoid = sandbox.getEllipsoid(); var primitives = sandbox.getScene().getPrimitives(); @@ -56,15 +56,15 @@ // Default position: top right corner. // Can be changed via Sandbox.Overlay.prototype.setPosition - overlay.style.top = "10px"; - overlay.style.right = "10px"; - overlay.style.position = "absolute"; + overlay.style.top = '10px'; + overlay.style.right = '10px'; + overlay.style.position = 'absolute'; // Inherited styles can be changed by editing the overlays class in the CSS file. - overlay.style.border = "inherit"; - overlay.style.backgroundColor = "inherit"; - overlay.style.padding = "inherit"; - overlay.style.borderRadius = "inherit"; + overlay.style.border = 'inherit'; + overlay.style.backgroundColor = 'inherit'; + overlay.style.padding = 'inherit'; + overlay.style.borderRadius = 'inherit'; this._overlay = overlay; this._id = id; @@ -72,11 +72,11 @@ this._interval = window.setInterval(function() { /*jslint evil : true*/ - var tempFunc = new Function("ellipsoid", "primitives", "cb", "sb", "display", content); + var tempFunc = new Function('ellipsoid', 'primitives', 'cb', 'sb', 'display', content); overlay.innerHTML = content; tempFunc(ellipsoid, primitives, cb, sandbox, function display(content) { if (typeof content === 'string') { - content = content.replace(/\n|\r/g, "
"); + content = content.replace(/\n|\r/g, '
'); } overlay.innerHTML = content; }); @@ -115,7 +115,7 @@ */ Sandbox.Overlay.prototype.update = function(newContent) { this._content = newContent; - this._overlay.innerHTML = newContent.replace(/\n|\r/g, "
"); + this._overlay.innerHTML = newContent.replace(/\n|\r/g, '
'); }; /** @@ -128,13 +128,13 @@ * @exception {Cesium.DeveloperError} positions is required. * * @example - * var overlay = new Sandbox.Overlay("test", "Hello World!"); - * overlay.setPosition({"top": "25px", "left": "50%"}); + * var overlay = new Sandbox.Overlay('test', 'Hello World!'); + * overlay.setPosition({'top': '25px', 'left': '50%'}); * */ Sandbox.Overlay.prototype.setPosition = function(positions) { if (!positions) { - throw new Cesium.DeveloperError("positions is required"); + throw new Cesium.DeveloperError('positions is required'); } // Clear old position so the overlay does not stretch this._overlay.style.left = null; @@ -161,13 +161,13 @@ * Removes the overlay from the page. */ Sandbox.Overlay.prototype.remove = function() { - var overlayContainer = document.getElementById("userOverlays"); + var overlayContainer = document.getElementById('userOverlays'); var child = document.getElementById(this._id); if (child) { overlayContainer.removeChild(child); } if (!overlayContainer.children.length) { - overlayContainer.setAttribute("style", "visibility: hidden;"); + overlayContainer.setAttribute('style', 'visibility: hidden;'); } window.clearInterval(this._interval); }; diff --git a/Examples/Sandbox/OverlayCreator.js b/Examples/Sandbox/OverlayCreator.js index 0c08882fef2..f2ba3dd339c 100644 --- a/Examples/Sandbox/OverlayCreator.js +++ b/Examples/Sandbox/OverlayCreator.js @@ -7,81 +7,81 @@ function initializeOverlayCreator(sb) { // Create Position Drop Down Menu var position = { - "top" : "10px", - "right" : "10px" + 'top' : '10px', + 'right' : '10px' }; var positionMenu = new dijit.Menu({ - style : "display: none;" + style : 'display: none;' }); var topLeft = new dijit.MenuItem({ - label : "Top Left", + label : 'Top Left', onClick : function() { position = { - "top" : "10px", - "left" : "10px" + 'top' : '10px', + 'left' : '10px' }; } }); var topCenter = new dijit.MenuItem({ - label : "Top Center", + label : 'Top Center', onClick : function() { position = { - "top" : "10px", - "left" : "45%" + 'top' : '10px', + 'left' : '45%' }; } }); var topRight = new dijit.MenuItem({ - label : "Top Right", + label : 'Top Right', onClick : function() { position = { - "top" : "10px", - "right" : "10px" + 'top' : '10px', + 'right' : '10px' }; } }); var rightCenter = new dijit.MenuItem({ - label : "Right Center", + label : 'Right Center', onClick : function() { position = { - "top" : "40%", - "right" : "10px" + 'top' : '40%', + 'right' : '10px' }; } }); var bottomRight = new dijit.MenuItem({ - label : "Bottom Right", + label : 'Bottom Right', onClick : function() { position = { - "bottom" : "40px", - "right" : "10px" + 'bottom' : '40px', + 'right' : '10px' }; } }); var bottomCenter = new dijit.MenuItem({ - label : "Bottom Center", + label : 'Bottom Center', onClick : function() { position = { - "bottom" : "40px", - "left" : "40%" + 'bottom' : '40px', + 'left' : '40%' }; } }); var bottomLeft = new dijit.MenuItem({ - label : "Bottom Left", + label : 'Bottom Left', onClick : function() { position = { - "bottom" : "40px", - "left" : "10px" + 'bottom' : '40px', + 'left' : '10px' }; } }); var leftCenter = new dijit.MenuItem({ - label : "Left Center", + label : 'Left Center', onClick : function() { position = { - "top" : "40%", - "left" : "10px" + 'top' : '40%', + 'left' : '10px' }; } }); @@ -96,47 +96,47 @@ function initializeOverlayCreator(sb) { positionMenu.addChild(leftCenter); var positionSelect = new dijit.form.DropDownButton({ - label : "Select Position", - style : "right: 18%; top: 90%; position: absolute;", + label : 'Select Position', + style : 'right: 18%; top: 90%; position: absolute;', dropDown : positionMenu }); - dojo.byId("positionSelect").appendChild(positionSelect.domNode); + dojo.byId('positionSelect').appendChild(positionSelect.domNode); - var overlayEditor = new Sandbox.Editor("overlayEditor"); - dojo.connect(dijit.byId("overlayEditorContainer"), "onmouseover", function(evt) { + var overlayEditor = new Sandbox.Editor('overlayEditor'); + dojo.connect(dijit.byId('overlayEditorContainer'), 'onmouseover', function(evt) { overlayEditor.resize(); }); - overlayEditor.display("// Use the function display() to print formatted or evaluated output."); + overlayEditor.display('// Use the function display() to print formatted or evaluated output.'); var overlayId = new dijit.form.TextBox({ - style : "width: 31%; left: 31%; top: 91%; position: absolute;", - placeHolder : "Enter a unique ID" - }, "overlayId"); + style : 'width: 31%; left: 31%; top: 91%; position: absolute;', + placeHolder : 'Enter a unique ID' + }, 'overlayId'); var removeOverlaysMenu = new dijit.Menu({ - style : "width: 100%; border-color: #FFFFFF;" + style : 'width: 100%; border-color: #FFFFFF;' }); removeOverlaysMenu.startup(); - dojo.byId("removeOverlaysMenu").appendChild(removeOverlaysMenu.domNode); + dojo.byId('removeOverlaysMenu').appendChild(removeOverlaysMenu.domNode); // Create overlays menu and add examples var overlayMenu = new dijit.Menu({ - style : "width: 100%; border-color: #FFFFFF" + style : 'width: 100%; border-color: #FFFFFF' }); overlayMenu.startup(); - dojo.byId("overlayMenu").appendChild(overlayMenu.domNode); + dojo.byId('overlayMenu').appendChild(overlayMenu.domNode); //Add Preset Overlay Examples function getCamera() { var camera = sb.getScene().getCamera(); - display("Position: " + camera.position + "\n" + "Direction: " + camera.direction + "\n" + "Up: " + camera.up); + display('Position: ' + camera.position + '\n' + 'Direction: ' + camera.direction + '\n' + 'Up: ' + camera.up); } function numPrimitives() { - display("Number of Primitives: " + (sb.getScene().getPrimitives().getLength() - 1)); // Do not include atmosphere + display('Number of Primitives: ' + (sb.getScene().getPrimitives().getLength() - 1)); // Do not include atmosphere } - userOverlays.push(new Sandbox.Overlay("Camera Coordinates", Sandbox.beautify(getCamera.toString()), sb)); - userOverlays.push(new Sandbox.Overlay("Number of Primtiives", Sandbox.beautify(numPrimitives.toString()), sb)); + userOverlays.push(new Sandbox.Overlay('Camera Coordinates', Sandbox.beautify(getCamera.toString()), sb)); + userOverlays.push(new Sandbox.Overlay('Number of Primtiives', Sandbox.beautify(numPrimitives.toString()), sb)); var displayOverlayInfo = function() { overlayEditor.display(this.overlay.getContent()); @@ -159,8 +159,8 @@ function initializeOverlayCreator(sb) { // Create the overlay and update the dialog menus /*jslint nonew : false*/ new dijit.form.Button({ - label : "Submit Overlay", - style : "right: 10px; top: 90%; position: absolute;", + label : 'Submit Overlay', + style : 'right: 10px; top: 90%; position: absolute;', onClick : function() { var content = overlayEditor.getValue(); @@ -171,7 +171,7 @@ function initializeOverlayCreator(sb) { var overlay = new Sandbox.Overlay(id, content, sb); overlay.getDiv().style.visibility = 'visible'; overlay.setPosition(position); - dijit.byId("overlayDialog").hide(); + dijit.byId('overlayDialog').hide(); var numUserOverlays = userOverlays.length; var found = false; @@ -193,8 +193,8 @@ function initializeOverlayCreator(sb) { } })); } - overlayEditor.display(""); - overlayId.set('value', ""); + overlayEditor.display(''); + overlayId.set('value', ''); found = false; var removeMenuItems = removeOverlaysMenu.getChildren(); @@ -211,12 +211,12 @@ function initializeOverlayCreator(sb) { })); } } - }, "createOverlayButton"); + }, 'createOverlayButton'); // Remove Overlay Dialog Features new dijit.form.Button({ - label : "Select All", - style : "padding-left: 35px;", + label : 'Select All', + style : 'padding-left: 35px;', onClick : function() { var removeMenuItems = removeOverlaysMenu.getChildren(); var numMenuItems = removeMenuItems.length; @@ -226,10 +226,10 @@ function initializeOverlayCreator(sb) { } } } - }, "selectAll"); + }, 'selectAll'); new dijit.form.Button({ - label : "Remove Overlay(s)", + label : 'Remove Overlay(s)', onClick : function() { var removeMenuItems = removeOverlaysMenu.getChildren(); var numMenuItems = removeMenuItems.length; @@ -240,6 +240,6 @@ function initializeOverlayCreator(sb) { } } } - }, "removeOverlayButton"); + }, 'removeOverlayButton'); }); } \ No newline at end of file diff --git a/Examples/Sandbox/Sandbox.js b/Examples/Sandbox/Sandbox.js index 2ac0d76bde8..c21488af7ec 100644 --- a/Examples/Sandbox/Sandbox.js +++ b/Examples/Sandbox/Sandbox.js @@ -7,14 +7,14 @@ var Sandbox = Sandbox || {}; * @constructor */ Cesium.Sandbox = function() { - var canvas = document.getElementById("glCanvas"); + var canvas = document.getElementById('glCanvas'); var scene = new Cesium.Scene(canvas); var primitives = scene.getPrimitives(); var ellipsoid = Cesium.Ellipsoid.WGS84; // TODO: make multiple tile providers available var bing = new Cesium.BingMapsTileProvider({ - server : "dev.virtualearth.net", + server : 'dev.virtualearth.net', mapStyle : Cesium.BingMapsStyle.AERIAL, // Some versions of Safari support WebGL, but don't correctly implement // cross-origin image loading, so we need to load Bing imagery using a proxy. @@ -23,10 +23,10 @@ var Sandbox = Sandbox || {}; var cb = new Cesium.CentralBody(ellipsoid); cb.dayTileProvider = bing; - cb.nightImageSource = "Images/land_ocean_ice_lights_2048.jpg"; - cb.specularMapSource = "Images/earthspec1k.jpg"; - cb.cloudsMapSource = "Images/earthcloudmaptrans.jpg"; - cb.bumpMapSource = "Images/earthbump1k.jpg"; + cb.nightImageSource = 'Images/land_ocean_ice_lights_2048.jpg'; + cb.specularMapSource = 'Images/earthspec1k.jpg'; + cb.cloudsMapSource = 'Images/earthcloudmaptrans.jpg'; + cb.bumpMapSource = 'Images/earthbump1k.jpg'; cb.showSkyAtmosphere = true; cb.showGroundAtmosphere = true; diff --git a/Examples/Sandbox/TextOverlay.js b/Examples/Sandbox/TextOverlay.js index e729c9c5437..1ed1c60f1a6 100644 --- a/Examples/Sandbox/TextOverlay.js +++ b/Examples/Sandbox/TextOverlay.js @@ -12,22 +12,22 @@ */ Sandbox.TextOverlay = function(content, position) { if (!content) { - throw new Cesium.DeveloperError("content is required."); + throw new Cesium.DeveloperError('content is required.'); } - var overlayContainer = document.getElementById("textOverlays"); + var overlayContainer = document.getElementById('textOverlays'); var overlay = document.createElement('div'); overlay.id = content; overlayContainer.appendChild(overlay); - overlay.innerHTML = content.replace(/\n|\r/g, "
"); + overlay.innerHTML = content.replace(/\n|\r/g, '
'); // Inherited styles can be changed by editing the overlays class in the CSS file. - overlay.style.border = "inherit"; - overlay.style.backgroundColor = "inherit"; - overlay.style.padding = "inherit"; - overlay.style.borderRadius = "inherit"; - overlay.style.visibility = "visible"; + overlay.style.border = 'inherit'; + overlay.style.backgroundColor = 'inherit'; + overlay.style.padding = 'inherit'; + overlay.style.borderRadius = 'inherit'; + overlay.style.visibility = 'visible'; this._overlay = overlay; this._content = content; @@ -36,10 +36,10 @@ this.setPosition(position); } else { // Default position: top right corner. - overlay.style.top = "10px"; - overlay.style.right = "10px"; + overlay.style.top = '10px'; + overlay.style.right = '10px'; } - overlay.style.position = "absolute"; + overlay.style.position = 'absolute'; }; /** @@ -65,7 +65,7 @@ */ Sandbox.TextOverlay.prototype.update = function(newContent) { this._content = newContent; - this._overlay.innerHTML = newContent.replace(/\n|\r/g, "
"); + this._overlay.innerHTML = newContent.replace(/\n|\r/g, '
'); }; /** @@ -78,12 +78,12 @@ * @exception {Cesium.DeveloperError} positions is required. * * @example - * var textOverlay = new Sandbox.TextOverlay("Welcome to the Cesium Sandbox"); - * textOverlay.setPosition({"top": "50%", "left": "10px"}); + * var textOverlay = new Sandbox.TextOverlay('Welcome to the Cesium Sandbox'); + * textOverlay.setPosition({'top': '50%', 'left': '10px'}); */ Sandbox.TextOverlay.prototype.setPosition = function(positions) { if (!positions) { - throw new Cesium.DeveloperError("positions is required"); + throw new Cesium.DeveloperError('positions is required'); } // Clear old position so the overlay does not stretch this._overlay.style.left = null; @@ -110,7 +110,7 @@ * Removes the overlay from the page. */ Sandbox.TextOverlay.prototype.remove = function() { - var overlayContainer = document.getElementById("textOverlays"); + var overlayContainer = document.getElementById('textOverlays'); var child = document.getElementById(this._content); if (child) { overlayContainer.removeChild(child); @@ -121,8 +121,8 @@ * Removes all text overlays from the page. */ Sandbox.TextOverlay.removeAll = function() { - var overlayContainer = document.getElementById("textOverlays"); - overlayContainer.setAttribute("style", "visibility: hidden;"); + var overlayContainer = document.getElementById('textOverlays'); + overlayContainer.setAttribute('style', 'visibility: hidden;'); if (overlayContainer.hasChildNodes()) { while (overlayContainer.childNodes.length >= 1) { overlayContainer.removeChild(overlayContainer.firstChild); diff --git a/Examples/Sandbox/Tree.js b/Examples/Sandbox/Tree.js index d7f9c9fa647..f782a381371 100644 --- a/Examples/Sandbox/Tree.js +++ b/Examples/Sandbox/Tree.js @@ -5,7 +5,7 @@ "use strict"; /*global Cesium,Sandbox,dojo,dijit,SandboxTree,SandboxTreeNode*/ - dojo.declare("SandboxTree", [dijit.Tree], { // Extend dojo's tree display + dojo.declare('SandboxTree', [dijit.Tree], { // Extend dojo's tree display optionScope : null, optionMethod : null, @@ -16,9 +16,9 @@ } }); - dojo.provide("SandboxTreeNode"); // Import the custom tree class + dojo.provide('SandboxTreeNode'); // Import the custom tree class - dojo.declare("SandboxTreeNode", [dijit._TreeNode], { // Extend dojo's tree node + dojo.declare('SandboxTreeNode', [dijit._TreeNode], { // Extend dojo's tree node // Override the default constructor _createTreeNode : function( /*Object*/args) { @@ -38,15 +38,15 @@ var containerDOM = this.domNode.children[0]; // Create the On/Off buttons - var toggleOn = dojo.create("a", { - className : "treeIcon toggleOn" - }, containerDOM, "last"); - var toggleOff = dojo.create("a", { - className : "treeIcon toggleOff" - }, containerDOM, "last"); + var toggleOn = dojo.create('a', { + className : 'treeIcon toggleOn' + }, containerDOM, 'last'); + var toggleOff = dojo.create('a', { + className : 'treeIcon toggleOff' + }, containerDOM, 'last'); // Place them next to the tree item - dojo.style(containerDOM, "position", "relative"); + dojo.style(containerDOM, 'position', 'relative'); // Set up event handling: @@ -54,7 +54,7 @@ var onCode = this.item.codeSnippet[0]; - dojo.connect(toggleOn, "onclick", this, function(e) { // On button + dojo.connect(toggleOn, 'onclick', this, function(e) { // On button Sandbox.reset(); editor.display(Sandbox.beautify(onCode.code.toString())); @@ -66,7 +66,7 @@ var offCode = this.item.codeSnippet[1]; - dojo.connect(toggleOff, "onclick", this, function(e) { // Off button + dojo.connect(toggleOff, 'onclick', this, function(e) { // Off button Sandbox.reset(); editor.display(Sandbox.beautify(offCode.code.toString())); @@ -141,14 +141,14 @@ // Connect the node with it's corresponding icon class // See notes in all.css . if (item.icon && item.icon[0]) { - return ('treeIcon ' + item.icon[0]) || "dijitLeaf"; + return ('treeIcon ' + item.icon[0]) || 'dijitLeaf'; } // Handle node's with children and no icon - return (opened ? "dijitFolderOpened" : "dijitFolderClosed"); + return (opened ? 'dijitFolderOpened' : 'dijitFolderClosed'); }); /* Dojo's pseudo-database. Data after construction can be accessed - * via the query method; e.g., store.query("String") + * via the query method; e.g., store.query('String') * This is needed because Dojo's tree display was designed to connect * to a database and/or a JSON containing URI. * @@ -167,7 +167,7 @@ */ var treeModel = new dijit.tree.ForestStoreModel({ store : store, - childrenAttrs : ["children"] + childrenAttrs : ['children'] }); // The actual Dojo Tree object @@ -297,7 +297,7 @@ return null; // No keyword found } - keyword = keyword || document.getElementById("searchBox").value; + keyword = keyword || document.getElementById('searchBox').value; if (keyword.length) { diff --git a/Examples/Skeleton/Skeleton.js b/Examples/Skeleton/Skeleton.js index c8432a6ec8c..4220d03ace2 100644 --- a/Examples/Skeleton/Skeleton.js +++ b/Examples/Skeleton/Skeleton.js @@ -7,14 +7,14 @@ require({ //are actually used, instead of requiring the Cesium module, which //includes everything. - var canvas = document.getElementById("glCanvas"); + var canvas = document.getElementById('glCanvas'); var ellipsoid = Cesium.Ellipsoid.WGS84; // Used in many Sandbox examples var scene = new Cesium.Scene(canvas); var primitives = scene.getPrimitives(); // Bing Maps var bing = new Cesium.BingMapsTileProvider({ - server : "dev.virtualearth.net", + server : 'dev.virtualearth.net', mapStyle : Cesium.BingMapsStyle.AERIAL, // Some versions of Safari support WebGL, but don't correctly implement // cross-origin image loading, so we need to load Bing imagery using a proxy. @@ -23,11 +23,11 @@ require({ var cb = new Cesium.CentralBody(ellipsoid); cb.dayTileProvider = bing; - cb.nightImageSource = "../../Images/land_ocean_ice_lights_2048.jpg"; - cb.specularMapSource = "../../Images/earthspec1k.jpg"; + cb.nightImageSource = '../../Images/land_ocean_ice_lights_2048.jpg'; + cb.specularMapSource = '../../Images/earthspec1k.jpg'; if (scene.getContext().getMaximumTextureSize() > 2048) { - cb.cloudsMapSource = "../../Images/earthcloudmaptrans.jpg"; - cb.bumpMapSource = "../../Images/earthbump1k.jpg"; + cb.cloudsMapSource = '../../Images/earthcloudmaptrans.jpg'; + cb.bumpMapSource = '../../Images/earthbump1k.jpg'; } cb.showSkyAtmosphere = true; cb.showGroundAtmosphere = true; @@ -63,7 +63,7 @@ require({ handler.setKeyAction(function() { /* ... */ // Handler for key press - }, "1"); + }, '1'); handler.setMouseAction(function(movement) { /* ... */ diff --git a/Examples/Skeleton2D/Skeleton2D.js b/Examples/Skeleton2D/Skeleton2D.js index b01d71a165a..72a95ee4e57 100644 --- a/Examples/Skeleton2D/Skeleton2D.js +++ b/Examples/Skeleton2D/Skeleton2D.js @@ -9,14 +9,14 @@ require({ var ellipsoid = Cesium.Ellipsoid.WGS84; - var canvas3D = document.getElementById("canvas3D"); + var canvas3D = document.getElementById('canvas3D'); var scene3D = new Cesium.Scene(canvas3D); - var canvas2D = document.getElementById("canvas2D"); + var canvas2D = document.getElementById('canvas2D'); var scene2D = new Cesium.Scene(canvas2D); var bing3D = new Cesium.BingMapsTileProvider({ - server : "dev.virtualearth.net", + server : 'dev.virtualearth.net', mapStyle : Cesium.BingMapsStyle.AERIAL, // Some versions of Safari support WebGL, but don't correctly implement // cross-origin image loading, so we need to load Bing imagery using a proxy. @@ -24,7 +24,7 @@ require({ }); var bing2D = new Cesium.BingMapsTileProvider({ - server : "dev.virtualearth.net", + server : 'dev.virtualearth.net', mapStyle : Cesium.BingMapsStyle.AERIAL, // Some versions of Safari support WebGL, but don't correctly implement // cross-origin image loading, so we need to load Bing imagery using a proxy. @@ -35,9 +35,9 @@ require({ var primitives = scene.getPrimitives(); var cb = new Cesium.CentralBody(ellipsoid); cb.dayTileProvider = imagery; - cb.nightImageSource = "../../Images/land_ocean_ice_lights_2048.jpg"; - cb.specularMapSource = "../../Images/earthspec1k.jpg"; - cb.bumpMapSource = "../../Images/earthbump1k.jpg"; + cb.nightImageSource = '../../Images/land_ocean_ice_lights_2048.jpg'; + cb.specularMapSource = '../../Images/earthspec1k.jpg'; + cb.bumpMapSource = '../../Images/earthbump1k.jpg'; primitives.setCentralBody(cb); /////////////////////////////////////////////////////////////////////////// @@ -67,13 +67,13 @@ require({ handler.setKeyAction(function() { transitioner.morphTo3D(); - }, "1"); + }, '1'); handler.setKeyAction(function() { transitioner.morphTo2D(); - }, "2"); + }, '2'); handler.setKeyAction(function() { transitioner.morphToColumbusView(); - }, "3"); + }, '3'); canvas3D.oncontextmenu = canvas2D.oncontextmenu = function() { return false; diff --git a/Source/Core/AxisAlignedBoundingBox.js b/Source/Core/AxisAlignedBoundingBox.js index 5afd08d013c..5eb10680686 100644 --- a/Source/Core/AxisAlignedBoundingBox.js +++ b/Source/Core/AxisAlignedBoundingBox.js @@ -29,7 +29,7 @@ define([ */ function AxisAlignedBoundingBox(positions) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } var length = positions.length; diff --git a/Source/Core/BoundingSphere.js b/Source/Core/BoundingSphere.js index 71e7f40591d..793df48ff79 100644 --- a/Source/Core/BoundingSphere.js +++ b/Source/Core/BoundingSphere.js @@ -31,7 +31,7 @@ define([ * @exception {DeveloperError} positions is required. * * @see AxisAlignedBoundingBox - * @see Bounding Sphere computation article + * @see Bounding Sphere computation article * * @constructor * @immutable @@ -46,7 +46,7 @@ define([ */ function BoundingSphere(positions, radius) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } if ((arguments.length === 2) && (typeof arguments[1] === 'number')) { diff --git a/Source/Core/BoxTessellator.js b/Source/Core/BoxTessellator.js index e4c268aeb9d..d20abd7a285 100644 --- a/Source/Core/BoxTessellator.js +++ b/Source/Core/BoxTessellator.js @@ -37,7 +37,7 @@ define([ var dimensions = template.dimensions || new Cartesian3(1.0, 1.0, 1.0); if (dimensions.x < 0 || dimensions.y < 0 || dimensions.z < 0) { - throw new DeveloperError("All dimensions components must be greater than or equal to zero."); + throw new DeveloperError('All dimensions components must be greater than or equal to zero.'); } var corner = dimensions.multiplyWithScalar(0.5); diff --git a/Source/Core/Cache.js b/Source/Core/Cache.js index 914d22ee35e..510150c308e 100644 --- a/Source/Core/Cache.js +++ b/Source/Core/Cache.js @@ -24,15 +24,15 @@ define([ */ function Cache(policy) { if (!policy) { - throw new DeveloperError("policy is required."); + throw new DeveloperError('policy is required.'); } - if (!policy.hit || typeof policy.hit !== "function") { - throw new DeveloperError("policy.hit must be a function."); + if (!policy.hit || typeof policy.hit !== 'function') { + throw new DeveloperError('policy.hit must be a function.'); } - if (!policy.miss || typeof policy.miss !== "function") { - throw new DeveloperError("policy.miss must be a function."); + if (!policy.miss || typeof policy.miss !== 'function') { + throw new DeveloperError('policy.miss must be a function.'); } this._cache = {}; @@ -48,8 +48,8 @@ define([ * @param {Object} key The key of the object to remove from the cache. * * @exception {DeveloperError} key is required. - * @exception {DeveloperError} key must be a string, have a string property called "key", or - * have a function called "getKey" that returns a string. + * @exception {DeveloperError} key must be a string, have a string property called 'key', or + * have a function called 'getKey' that returns a string. * * @return {Object} The object stored in the cache at key. * @@ -57,7 +57,7 @@ define([ */ Cache.prototype.find = function(key) { if (!key) { - throw new DeveloperError("key is required."); + throw new DeveloperError('key is required.'); } var name = key; @@ -66,7 +66,7 @@ define([ } if (!name) { - throw new DeveloperError("key must be a string, or an object with a string key property or getKey function."); + throw new DeveloperError('key must be a string, or an object with a string key property or getKey function.'); } var element = this._cache[name]; diff --git a/Source/Core/CachePolicy.js b/Source/Core/CachePolicy.js index 23906169626..a3c0a88c65c 100644 --- a/Source/Core/CachePolicy.js +++ b/Source/Core/CachePolicy.js @@ -33,14 +33,14 @@ define([ CachePolicy.LRU = function(description) { var desc = description || {}; - if (!desc.fetchFunc || typeof desc.fetchFunc !== "function") { - throw new DeveloperError("description.fetchFunc is a required function."); + if (!desc.fetchFunc || typeof desc.fetchFunc !== 'function') { + throw new DeveloperError('description.fetchFunc is a required function.'); } this._limit = desc.limit || 128; this._count = 0; this._fetchFunc = desc.fetchFunc; - this._removeFunc = (typeof desc.removeFunc === "function") ? desc.removeFunc : null; + this._removeFunc = (typeof desc.removeFunc === 'function') ? desc.removeFunc : null; }; /** diff --git a/Source/Core/Cartesian2.js b/Source/Core/Cartesian2.js index d614f99741c..fdf0c1d8ef3 100644 --- a/Source/Core/Cartesian2.js +++ b/Source/Core/Cartesian2.js @@ -26,7 +26,7 @@ define(function() { * * @see Cartesian2.y */ - this.x = (typeof x !== "undefined") ? x : 0.0; + this.x = (typeof x !== 'undefined') ? x : 0.0; /** * DOC_TBA @@ -35,7 +35,7 @@ define(function() { * * @see Cartesian2.x */ - this.y = (typeof y !== "undefined") ? y : 0.0; + this.y = (typeof y !== 'undefined') ? y : 0.0; } /** @@ -219,7 +219,7 @@ define(function() { * @return {String} A string representing this instance. */ Cartesian2.prototype.toString = function() { - return "(" + this.x + ", " + this.y + ")"; + return '(' + this.x + ', ' + this.y + ')'; }; return Cartesian2; diff --git a/Source/Core/Cartesian3.js b/Source/Core/Cartesian3.js index 70a0aff3a74..0b63ebd340a 100644 --- a/Source/Core/Cartesian3.js +++ b/Source/Core/Cartesian3.js @@ -27,7 +27,7 @@ define(['./Cartesian2'], function(Cartesian2) { * @see Cartesian3.y * @see Cartesian3.z */ - this.x = (typeof x !== "undefined") ? x : 0.0; + this.x = (typeof x !== 'undefined') ? x : 0.0; /** * DOC_TBA @@ -37,7 +37,7 @@ define(['./Cartesian2'], function(Cartesian2) { * @see Cartesian3.x * @see Cartesian3.z */ - this.y = (typeof y !== "undefined") ? y : 0.0; + this.y = (typeof y !== 'undefined') ? y : 0.0; /** * DOC_TBA @@ -47,7 +47,7 @@ define(['./Cartesian2'], function(Cartesian2) { * @see Cartesian3.x * @see Cartesian3.y */ - this.z = (typeof z !== "undefined") ? z : 0.0; + this.z = (typeof z !== 'undefined') ? z : 0.0; } /** @@ -404,7 +404,7 @@ define(['./Cartesian2'], function(Cartesian2) { * @return {String} A string representing this instance. */ Cartesian3.prototype.toString = function() { - return "(" + this.x + ", " + this.y + ", " + this.z + ")"; + return '(' + this.x + ', ' + this.y + ', ' + this.z + ')'; }; return Cartesian3; diff --git a/Source/Core/Cartesian4.js b/Source/Core/Cartesian4.js index a3c325999d1..607f8c0efd1 100644 --- a/Source/Core/Cartesian4.js +++ b/Source/Core/Cartesian4.js @@ -39,7 +39,7 @@ define([ * @see Cartesian4.z * @see Cartesian4.w */ - this.x = (typeof x !== "undefined") ? x : 0.0; + this.x = (typeof x !== 'undefined') ? x : 0.0; /** * DOC_TBA @@ -50,7 +50,7 @@ define([ * @see Cartesian4.z * @see Cartesian4.w */ - this.y = (typeof y !== "undefined") ? y : 0.0; + this.y = (typeof y !== 'undefined') ? y : 0.0; /** * DOC_TBA @@ -61,7 +61,7 @@ define([ * @see Cartesian4.y * @see Cartesian4.w */ - this.z = (typeof z !== "undefined") ? z : 0.0; + this.z = (typeof z !== 'undefined') ? z : 0.0; /** * DOC_TBA @@ -72,7 +72,7 @@ define([ * @see Cartesian4.y * @see Cartesian4.z */ - this.w = (typeof w !== "undefined") ? w : 0.0; + this.w = (typeof w !== 'undefined') ? w : 0.0; } /** @@ -351,7 +351,7 @@ define([ * @return {String} A string representing this instance. */ Cartesian4.prototype.toString = function() { - return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + ")"; + return '(' + this.x + ', ' + this.y + ', ' + this.z + ', ' + this.w + ')'; }; return Cartesian4; diff --git a/Source/Core/Cartographic2.js b/Source/Core/Cartographic2.js index e44e9d2dadf..cd0136bc68d 100644 --- a/Source/Core/Cartographic2.js +++ b/Source/Core/Cartographic2.js @@ -97,7 +97,7 @@ define(function() { * @return {String} Returns a string representing this instance. */ Cartographic2.prototype.toString = function() { - return "(" + this.longitude + ", " + this.latitude + ")"; + return '(' + this.longitude + ', ' + this.latitude + ')'; }; return Cartographic2; diff --git a/Source/Core/Cartographic3.js b/Source/Core/Cartographic3.js index a2df8647836..6f97df2fa9c 100644 --- a/Source/Core/Cartographic3.js +++ b/Source/Core/Cartographic3.js @@ -114,7 +114,7 @@ define(function() { * @return {String} Returns a string representing this instance. */ Cartographic3.prototype.toString = function() { - return "(" + this.longitude + ", " + this.latitude + ", " + this.height + ")"; + return '(' + this.longitude + ', ' + this.latitude + ', ' + this.height + ')'; }; return Cartographic3; diff --git a/Source/Core/CatmullRomSpline.js b/Source/Core/CatmullRomSpline.js index 40fb02ea922..795accf8b9f 100644 --- a/Source/Core/CatmullRomSpline.js +++ b/Source/Core/CatmullRomSpline.js @@ -46,7 +46,7 @@ define([ */ function CatmullRomSpline(controlPoints, firstTangent, lastTangent) { if (!controlPoints || !(controlPoints instanceof Array) || controlPoints.length < 3) { - throw new DeveloperError("controlPoints is required and must be an array of objects with point and time properties, with a length of at least 3."); + throw new DeveloperError('controlPoints is required and must be an array of objects with point and time properties, with a length of at least 3.'); } this._points = controlPoints; @@ -186,12 +186,12 @@ define([ * var position = spline.evaluate(5.0); */ CatmullRomSpline.prototype.evaluate = function(time) { - if (typeof time === "undefined") { - throw new DeveloperError("time is required."); + if (typeof time === 'undefined') { + throw new DeveloperError('time is required.'); } if (time < this._points[0].time || time > this._points[this._points.length - 1].time) { - throw new DeveloperError("time is out of range."); + throw new DeveloperError('time is out of range.'); } var i = this._findIndex(time); diff --git a/Source/Core/ComponentDatatype.js b/Source/Core/ComponentDatatype.js index 593b657b0d3..40179f42b5b 100644 --- a/Source/Core/ComponentDatatype.js +++ b/Source/Core/ComponentDatatype.js @@ -26,7 +26,7 @@ define(['./Enumeration'], function(Enumeration) { * @type {Enumeration} * @memberOf ComponentDatatype */ - ComponentDatatype.BYTE = new Enumeration(0x1400, "BYTE"); + ComponentDatatype.BYTE = new Enumeration(0x1400, 'BYTE'); ComponentDatatype.BYTE.sizeInBytes = Int8Array.BYTES_PER_ELEMENT; ComponentDatatype.BYTE.toTypedArray = function(values) { return new Int8Array(values); @@ -43,7 +43,7 @@ define(['./Enumeration'], function(Enumeration) { * @type {Enumeration} * @memberOf ComponentDatatype */ - ComponentDatatype.UNSIGNED_BYTE = new Enumeration(0x1401, "UNSIGNED_BYTE"); + ComponentDatatype.UNSIGNED_BYTE = new Enumeration(0x1401, 'UNSIGNED_BYTE'); ComponentDatatype.UNSIGNED_BYTE.sizeInBytes = Uint8Array.BYTES_PER_ELEMENT; ComponentDatatype.UNSIGNED_BYTE.toTypedArray = function(values) { return new Uint8Array(values); @@ -60,7 +60,7 @@ define(['./Enumeration'], function(Enumeration) { * @type {Enumeration} * @memberOf ComponentDatatype */ - ComponentDatatype.SHORT = new Enumeration(0x1402, "SHORT"); + ComponentDatatype.SHORT = new Enumeration(0x1402, 'SHORT'); ComponentDatatype.SHORT.sizeInBytes = Int16Array.BYTES_PER_ELEMENT; ComponentDatatype.SHORT.toTypedArray = function(values) { return new Int16Array(values); @@ -77,7 +77,7 @@ define(['./Enumeration'], function(Enumeration) { * @type {Enumeration} * @memberOf ComponentDatatype */ - ComponentDatatype.UNSIGNED_SHORT = new Enumeration(0x1403, "UNSIGNED_SHORT"); + ComponentDatatype.UNSIGNED_SHORT = new Enumeration(0x1403, 'UNSIGNED_SHORT'); ComponentDatatype.UNSIGNED_SHORT.sizeInBytes = Uint16Array.BYTES_PER_ELEMENT; ComponentDatatype.UNSIGNED_SHORT.toTypedArray = function(values) { return new Uint16Array(values); @@ -94,7 +94,7 @@ define(['./Enumeration'], function(Enumeration) { * @type {Enumeration} * @memberOf ComponentDatatype */ - ComponentDatatype.FLOAT = new Enumeration(0x1406, "FLOAT"); + ComponentDatatype.FLOAT = new Enumeration(0x1406, 'FLOAT'); ComponentDatatype.FLOAT.sizeInBytes = Float32Array.BYTES_PER_ELEMENT; ComponentDatatype.FLOAT.toTypedArray = function(values) { return new Float32Array(values); diff --git a/Source/Core/CubeMapEllipsoidTessellator.js b/Source/Core/CubeMapEllipsoidTessellator.js index 41509eddcb7..969b7e63ce6 100644 --- a/Source/Core/CubeMapEllipsoidTessellator.js +++ b/Source/Core/CubeMapEllipsoidTessellator.js @@ -31,10 +31,10 @@ define([ */ CubeMapEllipsoidTessellator.compute = function(ellipsoid, numberOfPartitions, attributeName) { if (numberOfPartitions <= 0) { - throw new DeveloperError("numberOfPartitions must be greater than zero."); + throw new DeveloperError('numberOfPartitions must be greater than zero.'); } - attributeName = attributeName || "position"; + attributeName = attributeName || 'position'; var positions = []; var indices = []; diff --git a/Source/Core/DeveloperError.js b/Source/Core/DeveloperError.js index f87ed41e781..6b0940283dd 100644 --- a/Source/Core/DeveloperError.js +++ b/Source/Core/DeveloperError.js @@ -21,12 +21,12 @@ define(function() { */ function DeveloperError(message) { /** - * "DeveloperError" indicating that this exception was thrown due to a developer error. + * 'DeveloperError' indicating that this exception was thrown due to a developer error. * * @constant * @type String */ - this.name = "DeveloperError"; + this.name = 'DeveloperError'; /** * The explanation for why this exception was thrown. diff --git a/Source/Core/Ellipsoid.js b/Source/Core/Ellipsoid.js index 4fe44133c1b..dfc7ffc3211 100644 --- a/Source/Core/Ellipsoid.js +++ b/Source/Core/Ellipsoid.js @@ -27,11 +27,11 @@ define([ */ function Ellipsoid(radii) { if (arguments.length === 0) { - throw new DeveloperError("radii is required."); + throw new DeveloperError('radii is required.'); } if (radii.x < 0 || radii.y < 0 || radii.z < 0) { - throw new DeveloperError("All radii components must be greater than or equal to zero."); + throw new DeveloperError('All radii components must be greater than or equal to zero.'); } radii = Cartesian3.clone(radii); diff --git a/Source/Core/EllipsoidTangentPlane.js b/Source/Core/EllipsoidTangentPlane.js index 73ebd4530ab..7679b794e2e 100644 --- a/Source/Core/EllipsoidTangentPlane.js +++ b/Source/Core/EllipsoidTangentPlane.js @@ -41,7 +41,7 @@ define([ */ EllipsoidTangentPlane.create = function(ellipsoid, positions) { if (!ellipsoid || !positions) { - throw new DeveloperError("ellipsoid and positions are required."); + throw new DeveloperError('ellipsoid and positions are required.'); } var box = new AxisAlignedBoundingBox(positions); @@ -55,7 +55,7 @@ define([ */ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function(positions) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } var positionsOnPlane = []; @@ -93,7 +93,7 @@ define([ */ EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function(positions) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } var positionsOnEllipsoid = []; diff --git a/Source/Core/Enumeration.js b/Source/Core/Enumeration.js index b8d0e9af6c3..d13af32f8e1 100644 --- a/Source/Core/Enumeration.js +++ b/Source/Core/Enumeration.js @@ -15,8 +15,8 @@ define(function() { * @example * // Create an object with two enumerations. * var filter = { - * NEAREST : new Enumeration(0x2600, "NEAREST"), - * LINEAR : new Enumeration(0x2601, "LINEAR") + * NEAREST : new Enumeration(0x2600, 'NEAREST'), + * LINEAR : new Enumeration(0x2601, 'LINEAR') * }; */ function Enumeration(value, name, properties) { diff --git a/Source/Core/EventHandler.js b/Source/Core/EventHandler.js index c6d6214360a..bbe9b22514f 100644 --- a/Source/Core/EventHandler.js +++ b/Source/Core/EventHandler.js @@ -233,7 +233,7 @@ define([ * @see EventHandler#removeKeyAction * * @example - * // Set the camera to a "home" position when 'h' is pressed. + * // Set the camera to a 'home' position when 'h' is pressed. * customHandler.setKeyAction( * function() { * var position = new Cartesian3(2.0 * Ellipsoid.WGS84.getRadii().getMaximumComponent(), 0.0, 0.0); @@ -243,16 +243,16 @@ define([ * camera.direction = dir; * camera.up = up; * }, - * "h" + * 'h' * ); */ EventHandler.prototype.setKeyAction = function(action, key, modifier) { if (!action) { - throw new DeveloperError("action is required."); + throw new DeveloperError('action is required.'); } if (!key) { - throw new DeveloperError("key is required."); + throw new DeveloperError('key is required.'); } var keyEvents; @@ -283,7 +283,7 @@ define([ */ EventHandler.prototype.getKeyAction = function(key, modifier) { if (!key) { - throw new DeveloperError("key is required."); + throw new DeveloperError('key is required.'); } var keyEvents; @@ -316,7 +316,7 @@ define([ */ EventHandler.prototype.removeKeyAction = function(key, modifier) { if (!key) { - throw new DeveloperError("key is required."); + throw new DeveloperError('key is required.'); } var keyEvents; @@ -350,11 +350,11 @@ define([ */ EventHandler.prototype.setMouseAction = function(action, type, modifier) { if (!action) { - throw new DeveloperError("action is required."); + throw new DeveloperError('action is required.'); } if (!type) { - throw new DeveloperError("type is required."); + throw new DeveloperError('type is required.'); } var mouseEvents; @@ -385,7 +385,7 @@ define([ */ EventHandler.prototype.getMouseAction = function(type, modifier) { if (!type) { - throw new DeveloperError("type is required."); + throw new DeveloperError('type is required.'); } var mouseEvents; @@ -418,7 +418,7 @@ define([ */ EventHandler.prototype.removeMouseAction = function(type, modifier) { if (!type) { - throw new DeveloperError("type is required."); + throw new DeveloperError('type is required.'); } var mouseEvents; diff --git a/Source/Core/EventModifier.js b/Source/Core/EventModifier.js index d4103c793ba..a2783abac70 100644 --- a/Source/Core/EventModifier.js +++ b/Source/Core/EventModifier.js @@ -15,7 +15,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SHIFT : new Enumeration(0, "SHIFT"), + SHIFT : new Enumeration(0, 'SHIFT'), /** * Represents the control key being held down. @@ -23,7 +23,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CTRL : new Enumeration(1, "CTRL"), + CTRL : new Enumeration(1, 'CTRL'), /** * Represents the alt key being held down. @@ -31,7 +31,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ALT : new Enumeration(2, "ALT") + ALT : new Enumeration(2, 'ALT') }; return EventModifier; diff --git a/Source/Core/Extent.js b/Source/Core/Extent.js index 97430826b0e..75d05f6b404 100644 --- a/Source/Core/Extent.js +++ b/Source/Core/Extent.js @@ -88,27 +88,27 @@ define([ */ Extent.validate = function(extent) { if (!extent || - typeof extent.north === "undefined" || - typeof extent.south === "undefined" || - typeof extent.west === "undefined" || - typeof extent.east === "undefined") { - throw new DeveloperError("extent is required and must have north, south, east and west attributes."); + typeof extent.north === 'undefined' || + typeof extent.south === 'undefined' || + typeof extent.west === 'undefined' || + typeof extent.east === 'undefined') { + throw new DeveloperError('extent is required and must have north, south, east and west attributes.'); } if (extent.north < -CesiumMath.PI_OVER_TWO || extent.north > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError("extent.north must be in the interval [-Pi/2, Pi/2]."); + throw new DeveloperError('extent.north must be in the interval [-Pi/2, Pi/2].'); } if (extent.south < -CesiumMath.PI_OVER_TWO || extent.south > CesiumMath.PI_OVER_TWO) { - throw new DeveloperError("extent.south must be in the interval [-Pi/2, Pi/2]."); + throw new DeveloperError('extent.south must be in the interval [-Pi/2, Pi/2].'); } if (extent.west < -CesiumMath.PI || extent.west > CesiumMath.PI) { - throw new DeveloperError("extent.west must be in the interval [-Pi, Pi]."); + throw new DeveloperError('extent.west must be in the interval [-Pi, Pi].'); } if (extent.east < -CesiumMath.PI || extent.east > CesiumMath.PI) { - throw new DeveloperError("extent.east must be in the interval [-Pi, Pi]."); + throw new DeveloperError('extent.east must be in the interval [-Pi, Pi].'); } }; @@ -124,7 +124,7 @@ define([ Extent._computePositions = function(extent, ellipsoid, time, projection) { if (typeof extent === 'undefined') { - throw new DeveloperError("extent is required."); + throw new DeveloperError('extent is required.'); } Extent.validate(extent); @@ -224,13 +224,13 @@ define([ */ Extent.computeBoundingRectangle = function(extent, projection) { if (typeof extent === 'undefined') { - throw new DeveloperError("extent is required."); + throw new DeveloperError('extent is required.'); } Extent.validate(extent); if (typeof projection === 'undefined') { - throw new DeveloperError("projection is required."); + throw new DeveloperError('projection is required.'); } var lla = new Cartographic2(extent.west, extent.south); diff --git a/Source/Core/ExtentTessellator.js b/Source/Core/ExtentTessellator.js index fef8844a531..a6fd971045f 100644 --- a/Source/Core/ExtentTessellator.js +++ b/Source/Core/ExtentTessellator.js @@ -179,8 +179,8 @@ define([ desc.relativeToCenter = (desc.relativeToCenter) ? Cartesian3.clone(desc.relativeToCenter) : Cartesian3.ZERO; desc.boundaryWidth = desc.boundaryWidth || 0; // NOTE: may want to expose in the future. desc.interleave = false; - desc.positionName = desc.positionName || "position"; - desc.textureCoordName = desc.textureCoordName || "textureCoordinates"; + desc.positionName = desc.positionName || 'position'; + desc.textureCoordName = desc.textureCoordName || 'textureCoordinates'; var vertices = []; var indices = []; @@ -320,8 +320,8 @@ define([ Extent.validate(desc.extent); desc.ellipsoid = desc.ellipsoid || Ellipsoid.WGS84; - desc.granularity = (typeof desc.granularity !== "undefined" && desc.granularity > 0.0) ? desc.granularity : 0.1; - desc.altitude = (typeof desc.altitude !== "undefined" && desc.altitude > 0.0) ? desc.altitude : 0.0; + desc.granularity = (typeof desc.granularity !== 'undefined' && desc.granularity > 0.0) ? desc.granularity : 0.1; + desc.altitude = (typeof desc.altitude !== 'undefined' && desc.altitude > 0.0) ? desc.altitude : 0.0; desc.relativeToCenter = (desc.relativeToCenter) ? Cartesian3.clone(desc.relativeToCenter) : Cartesian3.ZERO; desc.boundaryWidth = desc.boundaryWidth || 0; // NOTE: may want to expose in the future. diff --git a/Source/Core/FeatureDetection.js b/Source/Core/FeatureDetection.js index 806dbfcf7e7..95c203f2f86 100644 --- a/Source/Core/FeatureDetection.js +++ b/Source/Core/FeatureDetection.js @@ -92,7 +92,7 @@ define(['Core/FullScreen' * * @returns true if the browser can load cross-origin streaming imagery, false if not. * - * @see Cross-Origin Resource Sharing + * @see Cross-Origin Resource Sharing */ FeatureDetection.supportsCrossOriginImagery = function() { if (typeof _supportsCrossOriginImagery === 'undefined') { @@ -115,7 +115,7 @@ define(['Core/FullScreen' * @returns true if the supports the full screen standard, false if not. * * @see FullScreen - * @see W3C Fullscreen Living Specification + * @see W3C Fullscreen Living Specification */ FeatureDetection.supportsFullScreen = function() { return FullScreen.supportsFullScreen(); diff --git a/Source/Core/FullScreen.js b/Source/Core/FullScreen.js index 606e0039099..409e2a8d661 100644 --- a/Source/Core/FullScreen.js +++ b/Source/Core/FullScreen.js @@ -11,7 +11,7 @@ define(['Core/DeveloperError' * * @exports FullScreen * - * @see W3C Fullscreen Living Specification + * @see W3C Fullscreen Living Specification */ var FullScreen = { /** diff --git a/Source/Core/HermiteSpline.js b/Source/Core/HermiteSpline.js index ba87e574e47..dbd8b5ebf22 100644 --- a/Source/Core/HermiteSpline.js +++ b/Source/Core/HermiteSpline.js @@ -65,7 +65,7 @@ define([ */ function HermiteSpline(controlPoints) { if (!controlPoints || !(controlPoints instanceof Array) || controlPoints.length < 3) { - throw new DeveloperError("controlPoints is required. It must be an array with at least a length of 3."); + throw new DeveloperError('controlPoints is required. It must be an array with at least a length of 3.'); } this._points = controlPoints; @@ -207,12 +207,12 @@ define([ * var position = spline.evaluate(5.0); */ HermiteSpline.prototype.evaluate = function(time) { - if (typeof time === "undefined") { - throw new DeveloperError("time is required."); + if (typeof time === 'undefined') { + throw new DeveloperError('time is required.'); } if (time < this._points[0].time || time > this._points[this._points.length - 1].time) { - throw new DeveloperError("time is out of range."); + throw new DeveloperError('time is out of range.'); } var i = this._findIndex(time); diff --git a/Source/Core/IndexDatatype.js b/Source/Core/IndexDatatype.js index 423bf9ef1d8..b30e5432751 100644 --- a/Source/Core/IndexDatatype.js +++ b/Source/Core/IndexDatatype.js @@ -14,14 +14,14 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - UNSIGNED_BYTE : new Enumeration(0x1401, "UNSIGNED_BYTE"), + UNSIGNED_BYTE : new Enumeration(0x1401, 'UNSIGNED_BYTE'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - UNSIGNED_SHORT : new Enumeration(0x1403, "UNSIGNED_SHORT") + UNSIGNED_SHORT : new Enumeration(0x1403, 'UNSIGNED_SHORT') }; return IndexDatatype; diff --git a/Source/Core/Intersect.js b/Source/Core/Intersect.js index b6ef4033560..23803b06b75 100644 --- a/Source/Core/Intersect.js +++ b/Source/Core/Intersect.js @@ -17,7 +17,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - OUTSIDE : new Enumeration(-1, "OUTSIDE"), + OUTSIDE : new Enumeration(-1, 'OUTSIDE'), /** * Represents that an object intersects one of the frustum's planes. @@ -25,7 +25,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INTERSECTING : new Enumeration(0, "INTERSECTING"), + INTERSECTING : new Enumeration(0, 'INTERSECTING'), /** * Represents that an object is fully within the frustum. @@ -33,7 +33,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INSIDE : new Enumeration(1, "INSIDE") + INSIDE : new Enumeration(1, 'INSIDE') }; return Intersect; diff --git a/Source/Core/IntersectionTests.js b/Source/Core/IntersectionTests.js index 2abceca9830..5a2d527a991 100644 --- a/Source/Core/IntersectionTests.js +++ b/Source/Core/IntersectionTests.js @@ -31,19 +31,19 @@ define([ */ rayPlane : function(rayOrigin, rayDirection, planeNormal, planeD) { if (!rayOrigin) { - throw new DeveloperError("rayOrigin is required."); + throw new DeveloperError('rayOrigin is required.'); } if (!rayDirection) { - throw new DeveloperError("rayDirection is required."); + throw new DeveloperError('rayDirection is required.'); } if (!planeNormal) { - throw new DeveloperError("planeNormal is required."); + throw new DeveloperError('planeNormal is required.'); } if (!planeD) { - throw new DeveloperError("planeD is required."); + throw new DeveloperError('planeD is required.'); } var origin = Cartesian3.clone(rayOrigin); @@ -68,15 +68,15 @@ define([ rayEllipsoid : function(rayOrigin, rayDirection, ellipsoid) { if (!rayOrigin) { - throw new DeveloperError("rayOrigin is required."); + throw new DeveloperError('rayOrigin is required.'); } if (!rayDirection) { - throw new DeveloperError("rayDirection is required."); + throw new DeveloperError('rayDirection is required.'); } if (!ellipsoid) { - throw new DeveloperError("ellipsoid is required."); + throw new DeveloperError('ellipsoid is required.'); } var inverseRadii = ellipsoid.getOneOverRadii(); diff --git a/Source/Core/Jobs.js b/Source/Core/Jobs.js index a89a983d960..e47786764c8 100644 --- a/Source/Core/Jobs.js +++ b/Source/Core/Jobs.js @@ -5,16 +5,16 @@ define(function() { // TODO: Need tests for this when interface is solid. /** - * Jobs for use with {@link chain.js}. + * Jobs for use with {@link chain.js}. * Jobs can be used to asynchronously download resources, such as images, and create * function dependencies, e.g., download these images asynchronously, and create a texture for * each when the download completes. * @exports Jobs - * @see chain.js + * @see chain.js */ var Jobs = { /** - * Creates a function to asynchronously download an image for use with {@link chain.js}. + * Creates a function to asynchronously download an image for use with {@link chain.js}. * This allows multiple images to be downloaded in parallel, and other functions to depend on the download as shown in the example below. *

* When a download completes, the image object is available to functions later in the chain via this.images[url]. @@ -23,20 +23,20 @@ define(function() { * * @returns {Object} A function to asynchronously download the image for use with chain.js. * - * @see chain.js + * @see chain.js * * @example * // Asynchronously download two images, then create textures. * run( - * Jobs.downloadImage("diffuse.jpg"), - * Jobs.downloadImage("specular.jpg")).thenRun( + * Jobs.downloadImage('diffuse.jpg'), + * Jobs.downloadImage('specular.jpg')).thenRun( * function() { * var diffuseTexture = context.createTexture2D({ - * source : this.images["diffuse.jpg"], + * source : this.images['diffuse.jpg'], * pixelFormat : PixelFormat.RGB * }); * var specularTexture = context.createTexture2D({ - * source : this.images["specular.jpg"], + * source : this.images['specular.jpg'], * pixelFormat : PixelFormat.RGB * }); * // ... diff --git a/Source/Core/JulianDate.js b/Source/Core/JulianDate.js index 75970b6cbdd..9268585f7bd 100644 --- a/Source/Core/JulianDate.js +++ b/Source/Core/JulianDate.js @@ -65,7 +65,7 @@ function(DeveloperError, // Match hours/minutes HH:MM:SS HHMMSS.xxxxx var matchHoursMinutesSeconds = /^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source + utcOffset.source; - var iso8601ErrorMessage = "Valid ISO 8601 date string required."; + var iso8601ErrorMessage = 'Valid ISO 8601 date string required.'; /** *

Constructs an immutable JulianDate instance from a Julian day number and the number of seconds elapsed @@ -116,15 +116,15 @@ function(DeveloperError, //use UTC if not supplied timeStandard = TimeStandard.UTC; } else if (!TimeStandard.isKnownStandard(timeStandard)) { - throw new DeveloperError("timeStandard is not a known TimeStandard."); + throw new DeveloperError('timeStandard is not a known TimeStandard.'); } if (julianDayNumber === null || isNaN(julianDayNumber)) { - throw new DeveloperError("julianDayNumber is required."); + throw new DeveloperError('julianDayNumber is required.'); } if (julianSecondsOfDay === null || isNaN(julianSecondsOfDay)) { - throw new DeveloperError("julianSecondsOfDay is required."); + throw new DeveloperError('julianSecondsOfDay is required.'); } //coerce to integer @@ -176,17 +176,17 @@ function(DeveloperError, * @see JulianDate.fromIso8601 * @see TimeStandard * @see LeapSecond - * @see JavaScript Date Object on w3schools. - * @see JavaScript Date Object Reference on w3schools. + * @see JavaScript Date Object on w3schools. + * @see JavaScript Date Object Reference on w3schools. * * @example * // Construct a Julian date specifying the UTC time standard - * var date = new Date("January 1, 2011 12:00:00 EST"); + * var date = new Date('January 1, 2011 12:00:00 EST'); * var julianDate = JulianDate.fromDate(date, TimeStandard.UTC); */ JulianDate.fromDate = function(date, timeStandard) { if (typeof date === 'undefined' || date === null || isNaN(date.getTime())) { - throw new DeveloperError("date must be a valid JavaScript Date."); + throw new DeveloperError('date must be a valid JavaScript Date.'); } var components = computeJulianDateComponentsFromDate(date); @@ -214,15 +214,15 @@ function(DeveloperError, * @see JulianDate.fromTotalDays * @see JulianDate.fromDate * @see LeapSecond - * @see ISO 8601 on Wikipedia. + * @see ISO 8601 on Wikipedia. * * @example * // Example 1. Construct a Julian date in UTC at April 24th, 2012 6:08PM UTC - * var julianDate = JulianDate.fromIso8601("2012-04-24T18:08Z"); + * var julianDate = JulianDate.fromIso8601('2012-04-24T18:08Z'); * // Example 2. Construct a Julian date in local time April 24th, 2012 12:00 AM - * var localDay = JulianDate.fromIso8601("2012-04-24"); + * var localDay = JulianDate.fromIso8601('2012-04-24'); * // Example 3. Construct a Julian date 5 hours behind UTC April 24th, 2012 5:00 pm UTC - * var localDay = JulianDate.fromIso8601("2012-04-24T12:00-05:00"); + * var localDay = JulianDate.fromIso8601('2012-04-24T12:00-05:00'); */ JulianDate.fromIso8601 = function(iso8601String) { if (typeof iso8601String !== 'string') { @@ -479,7 +479,7 @@ function(DeveloperError, */ JulianDate.fromTotalDays = function(totalDays, timeStandard) { if (totalDays === null || isNaN(totalDays)) { - throw new DeveloperError("totalDays is required."); + throw new DeveloperError('totalDays is required.'); } return new JulianDate(totalDays, 0, timeStandard); }; @@ -664,8 +664,8 @@ function(DeveloperError, * @see JulianDate#getMinutesDifference * * @example - * var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00")); - * var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00")); + * var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00')); + * var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00')); * var difference = start.getSecondsDifference(end); // 86460.0 seconds */ JulianDate.prototype.getSecondsDifference = function(other) { @@ -696,8 +696,8 @@ function(DeveloperError, * @see JulianDate#getSecondsDifference * * @example - * var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00")); - * var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00")); + * var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00')); + * var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00')); * var difference = start.getMinutesDifference(end); // 1441.0 minutes */ JulianDate.prototype.getMinutesDifference = function(other) { @@ -731,7 +731,7 @@ function(DeveloperError, * @see TimeStandard * * @example - * var date = new Date("July 11, 2011 12:00:00 UTC"); + * var date = new Date('July 11, 2011 12:00:00 UTC'); * var julianDate = JulianDate.fromDate(date, TimeStandard.TAI); * var difference = julianDate.getTaiMinusUtc(); // 34 */ @@ -798,7 +798,7 @@ function(DeveloperError, */ JulianDate.prototype.addSeconds = function(duration) { if (duration === null || isNaN(duration)) { - throw new DeveloperError("duration is required and must be a number."); + throw new DeveloperError('duration is required and must be a number.'); } var newSecondsOfDay = this._secondsOfDay + duration; return new JulianDate(this._julianDayNumber, newSecondsOfDay, this._timeStandard); @@ -829,7 +829,7 @@ function(DeveloperError, */ JulianDate.prototype.addMinutes = function(duration) { if (duration === null || isNaN(duration)) { - throw new DeveloperError("duration is required and must be a number."); + throw new DeveloperError('duration is required and must be a number.'); } var newSecondsOfDay = this._secondsOfDay + (duration * TimeConstants.SECONDS_PER_MINUTE); return new JulianDate(this._julianDayNumber, newSecondsOfDay, this._timeStandard); @@ -860,7 +860,7 @@ function(DeveloperError, */ JulianDate.prototype.addHours = function(duration) { if (duration === null || isNaN(duration)) { - throw new DeveloperError("duration is required and must be a number."); + throw new DeveloperError('duration is required and must be a number.'); } var newSecondsOfDay = this._secondsOfDay + (duration * TimeConstants.SECONDS_PER_HOUR); return new JulianDate(this._julianDayNumber, newSecondsOfDay, this._timeStandard); @@ -891,7 +891,7 @@ function(DeveloperError, */ JulianDate.prototype.addDays = function(duration) { if (duration === null || isNaN(duration)) { - throw new DeveloperError("duration is required and must be a number."); + throw new DeveloperError('duration is required and must be a number.'); } var newJulianDayNumber = this._julianDayNumber + duration; return new JulianDate(newJulianDayNumber, this._secondsOfDay, this._timeStandard); @@ -911,8 +911,8 @@ function(DeveloperError, * @see JulianDate#greaterThanOrEquals * * @example - * var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - * var end = JulianDate.fromDate(new Date("July 6, 2011 12:01:00")); + * var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + * var end = JulianDate.fromDate(new Date('July 6, 2011 12:01:00')); * start.lessThan(end); // true */ JulianDate.prototype.lessThan = function(other) { @@ -933,8 +933,8 @@ function(DeveloperError, * @see JulianDate#greaterThanOrEquals * * @example - * var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - * var end = JulianDate.fromDate(new Date("July 6, 2011 12:00:00")); + * var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + * var end = JulianDate.fromDate(new Date('July 6, 2011 12:00:00')); * start.lessThanOrEquals(end); // true */ JulianDate.prototype.lessThanOrEquals = function(other) { @@ -955,8 +955,8 @@ function(DeveloperError, * @see JulianDate#greaterThanOrEquals * * @example - * var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - * var end = JulianDate.fromDate(new Date("July 6, 2011 12:01:00")); + * var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + * var end = JulianDate.fromDate(new Date('July 6, 2011 12:01:00')); * end.greaterThan(start); // true */ JulianDate.prototype.greaterThan = function(other) { @@ -977,8 +977,8 @@ function(DeveloperError, * @see JulianDate#greaterThan * * @example - * var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - * var end = JulianDate.fromDate(new Date("July 6, 2011 12:00:00")); + * var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + * var end = JulianDate.fromDate(new Date('July 6, 2011 12:00:00')); * end.greaterThanOrEquals(start); // true */ JulianDate.prototype.greaterThanOrEquals = function(other) { @@ -998,8 +998,8 @@ function(DeveloperError, * @see JulianDate#equalsEpsilon * * @example - * var original = JulianDate.fromDate(new Date("July 4, 2011 12:00:00")); - * var clone = JulianDate.fromDate(new Date("July 4, 2011 12:00:00")); + * var original = JulianDate.fromDate(new Date('July 4, 2011 12:00:00')); + * var clone = JulianDate.fromDate(new Date('July 4, 2011 12:00:00')); * original.equals(clone); // true */ JulianDate.prototype.equals = function(other) { @@ -1024,13 +1024,13 @@ function(DeveloperError, * @see JulianDate#equals * * @example - * var original = JulianDate.fromDate(new Date("July 4, 2011 12:00:00")); - * var clone = JulianDate.fromDate(new Date("July 4, 2011 12:00:01")); + * var original = JulianDate.fromDate(new Date('July 4, 2011 12:00:00')); + * var clone = JulianDate.fromDate(new Date('July 4, 2011 12:00:01')); * original.equalsEpsilon(clone, 2); // true */ JulianDate.prototype.equalsEpsilon = function(other, epsilon) { if (epsilon === null || isNaN(epsilon)) { - throw new DeveloperError("epsilon is required and must be number."); + throw new DeveloperError('epsilon is required and must be number.'); } return Math.abs(this.getSecondsDifference(other)) <= epsilon; }; diff --git a/Source/Core/LeapSecond.js b/Source/Core/LeapSecond.js index 33189b03476..fa27412b8f1 100644 --- a/Source/Core/LeapSecond.js +++ b/Source/Core/LeapSecond.js @@ -36,14 +36,14 @@ define([ * * @example * // Example 1. Construct a LeapSecond using a JulianDate - * var date = new Date("January 1, 1990 00:00:00 UTC"); + * var date = new Date('January 1, 1990 00:00:00 UTC'); * var leapSecond = new LeapSecond(JulianDate.fromDate(date), 25.0); * var offset = leapSecond.offset; // 25.0 * * ////////////////////////////////////////////////////////////////// * * // Example 2. Construct a LeapSecond using a date string - * var date = "January 1, 1990 00:00:00 UTC"; + * var date = 'January 1, 1990 00:00:00 UTC'; * var leapSecond = new LeapSecond(date, 25.0); */ function LeapSecond(date, offset) { @@ -51,10 +51,10 @@ define([ var totalTaiOffsetFromUtc; if (!date) { - throw new DeveloperError("date is required."); + throw new DeveloperError('date is required.'); } if (typeof offset === 'undefined') { - throw new DeveloperError("offset is required."); + throw new DeveloperError('offset is required.'); } if (typeof date === 'object') { @@ -106,11 +106,11 @@ define([ * // Set the list of leap seconds using user defined data. * var data = [ * { - * date: "January 1, 1972 00:00:00 UTC", + * date: 'January 1, 1972 00:00:00 UTC', * offset: 10.0 * }, * { - * date: "July 1, 1972 00:00:00 UTC", + * date: 'July 1, 1972 00:00:00 UTC', * offset: 11.0 * } * ]; @@ -119,7 +119,7 @@ define([ */ LeapSecond.setLeapSeconds = function(data) { if (!data) { - throw new DeveloperError("data is required."); + throw new DeveloperError('data is required.'); } LeapSecond._leapSeconds = []; @@ -144,32 +144,32 @@ define([ if (!LeapSecond._leapSeconds) { LeapSecond._leapSeconds = [ - new LeapSecond("January 1, 1972 00:00:00 UTC", 10), - new LeapSecond("July 1, 1972 00:00:00 UTC", 11), - new LeapSecond("January 1, 1973 00:00:00 UTC", 12), - new LeapSecond("January 1, 1974 00:00:00 UTC", 13), - new LeapSecond("January 1, 1975 00:00:00 UTC", 14), - new LeapSecond("January 1, 1976 00:00:00 UTC", 15), - new LeapSecond("January 1, 1977 00:00:00 UTC", 16), - new LeapSecond("January 1, 1978 00:00:00 UTC", 17), - new LeapSecond("January 1, 1979 00:00:00 UTC", 18), - new LeapSecond("January 1, 1980 00:00:00 UTC", 19), - new LeapSecond("July 1, 1981 00:00:00 UTC", 20), - new LeapSecond("July 1, 1982 00:00:00 UTC", 21), - new LeapSecond("July 1, 1983 00:00:00 UTC", 22), - new LeapSecond("July 1, 1985 00:00:00 UTC", 23), - new LeapSecond("January 1, 1988 00:00:00 UTC", 24), - new LeapSecond("January 1, 1990 00:00:00 UTC", 25), - new LeapSecond("January 1, 1991 00:00:00 UTC", 26), - new LeapSecond("July 1, 1992 00:00:00 UTC", 27), - new LeapSecond("July 1, 1993 00:00:00 UTC", 28), - new LeapSecond("July 1, 1994 00:00:00 UTC", 29), - new LeapSecond("January 1, 1996 00:00:00 UTC", 30), - new LeapSecond("July 1, 1997 00:00:00 UTC", 31), - new LeapSecond("January 1, 1999 00:00:00 UTC", 32), - new LeapSecond("January 1, 2006 00:00:00 UTC", 33), - new LeapSecond("January 1, 2009 00:00:00 UTC", 34), - new LeapSecond("July 1, 2012 00:00:00 UTC", 35) + new LeapSecond('January 1, 1972 00:00:00 UTC', 10), + new LeapSecond('July 1, 1972 00:00:00 UTC', 11), + new LeapSecond('January 1, 1973 00:00:00 UTC', 12), + new LeapSecond('January 1, 1974 00:00:00 UTC', 13), + new LeapSecond('January 1, 1975 00:00:00 UTC', 14), + new LeapSecond('January 1, 1976 00:00:00 UTC', 15), + new LeapSecond('January 1, 1977 00:00:00 UTC', 16), + new LeapSecond('January 1, 1978 00:00:00 UTC', 17), + new LeapSecond('January 1, 1979 00:00:00 UTC', 18), + new LeapSecond('January 1, 1980 00:00:00 UTC', 19), + new LeapSecond('July 1, 1981 00:00:00 UTC', 20), + new LeapSecond('July 1, 1982 00:00:00 UTC', 21), + new LeapSecond('July 1, 1983 00:00:00 UTC', 22), + new LeapSecond('July 1, 1985 00:00:00 UTC', 23), + new LeapSecond('January 1, 1988 00:00:00 UTC', 24), + new LeapSecond('January 1, 1990 00:00:00 UTC', 25), + new LeapSecond('January 1, 1991 00:00:00 UTC', 26), + new LeapSecond('July 1, 1992 00:00:00 UTC', 27), + new LeapSecond('July 1, 1993 00:00:00 UTC', 28), + new LeapSecond('July 1, 1994 00:00:00 UTC', 29), + new LeapSecond('January 1, 1996 00:00:00 UTC', 30), + new LeapSecond('July 1, 1997 00:00:00 UTC', 31), + new LeapSecond('January 1, 1999 00:00:00 UTC', 32), + new LeapSecond('January 1, 2006 00:00:00 UTC', 33), + new LeapSecond('January 1, 2009 00:00:00 UTC', 34), + new LeapSecond('July 1, 2012 00:00:00 UTC', 35) ]; } return LeapSecond._leapSeconds; @@ -185,7 +185,7 @@ define([ * @return {Boolean} true if the leap seconds are equal; otherwise, false. * * @example - * var date = new Date("January 1, 1990 00:00:00 UTC"); + * var date = new Date('January 1, 1990 00:00:00 UTC'); * var leapSecond1 = new LeapSecond(JulianDate.fromDate(date), 25.0); * var leapSecond2 = new LeapSecond(JulianDate.fromDate(date), 25.0); * leapSecond1.equals(leapSecond2); // true @@ -211,7 +211,7 @@ define([ * @see JulianDate#isAfter * * @example - * var date = new Date("January 1, 2006 00:00:00 UTC"); + * var date = new Date('January 1, 2006 00:00:00 UTC'); * var leapSecond1 = new LeapSecond(JulianDate.fromDate(date), 33.0); * var leapSecond2 = new LeapSecond(JulianDate.fromDate(date), 34.0); * LeapSecond.compareLeapSecondDate(leapSecond1, leapSecond2); // returns 0 diff --git a/Source/Core/Matrix2.js b/Source/Core/Matrix2.js index edf09502c16..890a3ee3dae 100644 --- a/Source/Core/Matrix2.js +++ b/Source/Core/Matrix2.js @@ -99,7 +99,7 @@ define([ */ Matrix2.prototype.getColumnMajorValue = function(index) { if (index < 0 || index > 3) { - throw new DeveloperError("index must be between 0 and 3."); + throw new DeveloperError('index must be between 0 and 3.'); } return this.values[index]; @@ -316,7 +316,7 @@ define([ columnMajorValues[1], columnMajorValues[3]); } - throw new DeveloperError("columnMajorValues must have 4 elements."); + throw new DeveloperError('columnMajorValues must have 4 elements.'); } return new Matrix2(); }; @@ -409,8 +409,8 @@ define([ * @return {String} Returns a string representing this instance. */ Matrix2.prototype.toString = function() { - return "(" + this.getColumn0Row0() + ", " + this.getColumn1Row0() + ")\n" + - "(" + this.getColumn0Row1() + ", " + this.getColumn1Row1() + ")"; + return '(' + this.getColumn0Row0() + ', ' + this.getColumn1Row0() + ')\n' + + '(' + this.getColumn0Row1() + ', ' + this.getColumn1Row1() + ')'; }; return Matrix2; diff --git a/Source/Core/Matrix3.js b/Source/Core/Matrix3.js index 479fad464ea..17abe67fb7e 100644 --- a/Source/Core/Matrix3.js +++ b/Source/Core/Matrix3.js @@ -162,7 +162,7 @@ define([ */ Matrix3.prototype.getColumnMajorValue = function(index) { if (index < 0 || index > 8) { - throw new DeveloperError("index must be between 0 and 8."); + throw new DeveloperError('index must be between 0 and 8.'); } return this.values[index]; @@ -462,7 +462,7 @@ define([ columnMajorValues[2], columnMajorValues[5], columnMajorValues[8]); } - throw new DeveloperError("columnMajorValues must have 9 elements."); + throw new DeveloperError('columnMajorValues must have 9 elements.'); } return new Matrix3(); }; @@ -648,9 +648,9 @@ define([ * @return {String} Returns a string representing this instance. */ Matrix3.prototype.toString = function() { - return "(" + this.getColumn0Row0() + ", " + this.getColumn1Row0() + ", " + this.getColumn2Row0() + ")\n" + - "(" + this.getColumn0Row1() + ", " + this.getColumn1Row1() + ", " + this.getColumn2Row1() + ")\n" + - "(" + this.getColumn0Row2() + ", " + this.getColumn1Row2() + ", " + this.getColumn2Row2() + ")"; + return '(' + this.getColumn0Row0() + ', ' + this.getColumn1Row0() + ', ' + this.getColumn2Row0() + ')\n' + + '(' + this.getColumn0Row1() + ', ' + this.getColumn1Row1() + ', ' + this.getColumn2Row1() + ')\n' + + '(' + this.getColumn0Row2() + ', ' + this.getColumn1Row2() + ', ' + this.getColumn2Row2() + ')'; }; /** diff --git a/Source/Core/Matrix4.js b/Source/Core/Matrix4.js index c60ef13731c..76b52b9f1e1 100644 --- a/Source/Core/Matrix4.js +++ b/Source/Core/Matrix4.js @@ -295,7 +295,7 @@ define([ */ Matrix4.prototype.getColumnMajorValue = function(index) { if (index < 0 || index > 15) { - throw new DeveloperError("index must be between 0 and 15."); + throw new DeveloperError('index must be between 0 and 15.'); } return this.values[index]; @@ -630,7 +630,7 @@ define([ columnMajorValues[3], columnMajorValues[7], columnMajorValues[11], columnMajorValues[15]); } - throw new DeveloperError("columnMajorValues must have 16 elements."); + throw new DeveloperError('columnMajorValues must have 16 elements.'); } return new Matrix4(); @@ -728,19 +728,19 @@ define([ */ Matrix4.createPerspectiveFieldOfView = function(fovy, aspect, zNear, zFar) { if (fovy <= 0.0 || fovy > Math.PI) { - throw new DeveloperError("fovy must be in [0, PI)."); + throw new DeveloperError('fovy must be in [0, PI).'); } if (aspect <= 0.0) { - throw new DeveloperError("aspect must be greater than zero."); + throw new DeveloperError('aspect must be greater than zero.'); } if (zNear <= 0.0) { - throw new DeveloperError("zNear must be greater than zero."); + throw new DeveloperError('zNear must be greater than zero.'); } if (zFar <= 0.0) { - throw new DeveloperError("zFar must be greater than zero."); + throw new DeveloperError('zFar must be greater than zero.'); } var bottom = Math.tan(fovy * 0.5); @@ -865,7 +865,7 @@ define([ v.width = v.width || 0.0; v.height = v.height || 0.0; nearDepthRange = nearDepthRange || 0.0; - farDepthRange = (typeof farDepthRange === "undefined") ? 1.0 : farDepthRange; + farDepthRange = (typeof farDepthRange === 'undefined') ? 1.0 : farDepthRange; var halfWidth = v.width * 0.5; var halfHeight = v.height * 0.5; @@ -1101,7 +1101,7 @@ define([ det = src[0] * dst[0] + src[1] * dst[1] + src[2] * dst[2] + src[3] * dst[3]; if (Math.abs(det) < CesiumMath.EPSILON20) { - throw new RuntimeError("This matrix is not invertible because its determinate is zero."); + throw new RuntimeError('This matrix is not invertible because its determinate is zero.'); } // calculate matrix inverse @@ -1352,10 +1352,10 @@ define([ * @return {String} Returns a string representing this instance. */ Matrix4.prototype.toString = function() { - return "(" + this.getColumn0Row0() + ", " + this.getColumn1Row0() + ", " + this.getColumn2Row0() + ", " + this.getColumn3Row0() + ")\n" + - "(" + this.getColumn0Row1() + ", " + this.getColumn1Row1() + ", " + this.getColumn2Row1() + ", " + this.getColumn3Row1() + ")\n" + - "(" + this.getColumn0Row2() + ", " + this.getColumn1Row2() + ", " + this.getColumn2Row2() + ", " + this.getColumn3Row2() + ")\n" + - "(" + this.getColumn0Row3() + ", " + this.getColumn1Row3() + ", " + this.getColumn2Row3() + ", " + this.getColumn3Row3() + ")"; + return '(' + this.getColumn0Row0() + ', ' + this.getColumn1Row0() + ', ' + this.getColumn2Row0() + ', ' + this.getColumn3Row0() + ')\n' + + '(' + this.getColumn0Row1() + ', ' + this.getColumn1Row1() + ', ' + this.getColumn2Row1() + ', ' + this.getColumn3Row1() + ')\n' + + '(' + this.getColumn0Row2() + ', ' + this.getColumn1Row2() + ', ' + this.getColumn2Row2() + ', ' + this.getColumn3Row2() + ')\n' + + '(' + this.getColumn0Row3() + ', ' + this.getColumn1Row3() + ', ' + this.getColumn2Row3() + ', ' + this.getColumn3Row3() + ')'; }; return Matrix4; diff --git a/Source/Core/MeshFilters.js b/Source/Core/MeshFilters.js index fd6668ebb3e..3709ddfad02 100644 --- a/Source/Core/MeshFilters.js +++ b/Source/Core/MeshFilters.js @@ -166,7 +166,7 @@ define([ var attribute = mesh.attributes[property]; var num = attribute.values.length / attribute.componentsPerAttribute; if ((numberOfVertices !== num) && (numberOfVertices !== -1)) { - throw new DeveloperError("All mesh attribute lists must have the same number of attributes."); + throw new DeveloperError('All mesh attribute lists must have the same number of attributes.'); } numberOfVertices = num; } @@ -222,7 +222,7 @@ define([ } else { tempIndex = indicesIn[intoIndicesIn]; if (tempIndex >= numVertices) { - throw new DeveloperError("Input indices contains a value greater than or equal to the number of vertices"); + throw new DeveloperError('Input indices contains a value greater than or equal to the number of vertices'); } indexCrossReferenceOldToNew[tempIndex] = nextIndex; @@ -279,7 +279,7 @@ define([ * * @see MeshFilters.reorderForPreVertexCache * @see Tipsify - * @see + * @see * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw * by Sander, Nehab, and Barczak * @@ -314,7 +314,7 @@ define([ var length = indexLists.length; for ( var i = 0; i < length; ++i) { if (indexLists[i].primitiveType !== PrimitiveType.TRIANGLES) { - throw new DeveloperError("The mesh's index-lists must have PrimitiveType equal to PrimitiveType.TRIANGLES."); + throw new DeveloperError('indexLists must have PrimitiveType equal to PrimitiveType.TRIANGLES.'); } } }; @@ -398,7 +398,7 @@ define([ var x2 = originalIndices[j + 2]; var i0 = oldToNewIndex[x0]; - if (typeof i0 === "undefined") { + if (typeof i0 === 'undefined') { i0 = currentIndex++; oldToNewIndex[x0] = i0; @@ -406,7 +406,7 @@ define([ } var i1 = oldToNewIndex[x1]; - if (typeof i1 === "undefined") { + if (typeof i1 === 'undefined') { i1 = currentIndex++; oldToNewIndex[x1] = i1; @@ -414,7 +414,7 @@ define([ } var i2 = oldToNewIndex[x2]; - if (typeof i2 === "undefined") { + if (typeof i2 === 'undefined') { i2 = currentIndex++; oldToNewIndex[x2] = i2; diff --git a/Source/Core/MouseEventType.js b/Source/Core/MouseEventType.js index e95a8b853f9..c9f3d895d68 100644 --- a/Source/Core/MouseEventType.js +++ b/Source/Core/MouseEventType.js @@ -14,7 +14,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LEFT_DOWN : new Enumeration(0, "LEFT_DOWN"), + LEFT_DOWN : new Enumeration(0, 'LEFT_DOWN'), /** * Represents a mouse left button up event. @@ -22,7 +22,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LEFT_UP : new Enumeration(1, "LEFT_UP"), + LEFT_UP : new Enumeration(1, 'LEFT_UP'), /** * Represents a mouse left click event. @@ -30,7 +30,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LEFT_CLICK : new Enumeration(2, "LEFT_CLICK"), + LEFT_CLICK : new Enumeration(2, 'LEFT_CLICK'), /** * Represents a mouse left double click event. @@ -38,7 +38,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LEFT_DOUBLE_CLICK : new Enumeration(3, "LEFT_DOUBLE_CLICK"), + LEFT_DOUBLE_CLICK : new Enumeration(3, 'LEFT_DOUBLE_CLICK'), /** * Represents a mouse left button down event. @@ -46,7 +46,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RIGHT_DOWN : new Enumeration(5, "RIGHT_DOWN"), + RIGHT_DOWN : new Enumeration(5, 'RIGHT_DOWN'), /** * Represents a mouse right button up event. @@ -54,7 +54,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RIGHT_UP : new Enumeration(6, "RIGHT_UP"), + RIGHT_UP : new Enumeration(6, 'RIGHT_UP'), /** * Represents a mouse right click event. @@ -62,7 +62,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RIGHT_CLICK : new Enumeration(7, "RIGHT_CLICK"), + RIGHT_CLICK : new Enumeration(7, 'RIGHT_CLICK'), /** * Represents a mouse right double click event. @@ -70,7 +70,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RIGHT_DOUBLE_CLICK : new Enumeration(8, "RIGHT_DOUBLE_CLICK"), + RIGHT_DOUBLE_CLICK : new Enumeration(8, 'RIGHT_DOUBLE_CLICK'), /** * Represents a mouse middle button down event. @@ -78,7 +78,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MIDDLE_DOWN : new Enumeration(10, "MIDDLE_DOWN"), + MIDDLE_DOWN : new Enumeration(10, 'MIDDLE_DOWN'), /** * Represents a mouse middle button up event. @@ -86,7 +86,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MIDDLE_UP : new Enumeration(11, "MIDDLE_UP"), + MIDDLE_UP : new Enumeration(11, 'MIDDLE_UP'), /** * Represents a mouse middle click event. @@ -94,7 +94,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MIDDLE_CLICK : new Enumeration(12, "MIDDLE_CLICK"), + MIDDLE_CLICK : new Enumeration(12, 'MIDDLE_CLICK'), /** * Represents a mouse middle double click event. @@ -102,7 +102,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MIDDLE_DOUBLE_CLICK : new Enumeration(13, "MIDDLE_DOUBLE_CLICK"), + MIDDLE_DOUBLE_CLICK : new Enumeration(13, 'MIDDLE_DOUBLE_CLICK'), /** * Represents a mouse move event. @@ -110,7 +110,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MOVE : new Enumeration(15, "MOVE"), + MOVE : new Enumeration(15, 'MOVE'), /** * Represents a mouse wheel event. @@ -118,7 +118,7 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - WHEEL : new Enumeration(16, "WHEEL") + WHEEL : new Enumeration(16, 'WHEEL') }; return MouseEventType; diff --git a/Source/Core/Occluder.js b/Source/Core/Occluder.js index 9b87a87b697..80a1af24629 100644 --- a/Source/Core/Occluder.js +++ b/Source/Core/Occluder.js @@ -34,11 +34,11 @@ define([ */ function Occluder(occluderBoundingSphere, cameraPosition) { if (!occluderBoundingSphere) { - throw new DeveloperError("occluderBoundingSphere is required."); + throw new DeveloperError('occluderBoundingSphere is required.'); } if (!cameraPosition) { - throw new DeveloperError("camera position is required."); + throw new DeveloperError('camera position is required.'); } this._occluderPosition = occluderBoundingSphere.center.clone(); @@ -262,15 +262,15 @@ define([ Occluder.getOccludeePoint = function(occluderBoundingSphere, occludeePosition, positions) { // Validate input data if (!occluderBoundingSphere) { - throw new DeveloperError("occluderBoundingSphere is required."); + throw new DeveloperError('occluderBoundingSphere is required.'); } if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } if (positions.length === 0) { - throw new DeveloperError("positions must contain at least one element"); + throw new DeveloperError('positions must contain at least one element'); } var occludeePos = Cartesian3.clone(occludeePosition); @@ -279,7 +279,7 @@ define([ var numPositions = positions.length; if (occluderPosition.equals(occludeePosition)) { - throw new DeveloperError("Argument occludeePosition must be different than argument occluderBoundingSphere's center point"); + throw new DeveloperError('occludeePosition must be different than occluderBoundingSphere.center'); } var valid = true; diff --git a/Source/Core/OrientationInterpolator.js b/Source/Core/OrientationInterpolator.js index 19e45360eea..aca163d0438 100644 --- a/Source/Core/OrientationInterpolator.js +++ b/Source/Core/OrientationInterpolator.js @@ -26,7 +26,7 @@ define([ */ function OrientationInterpolator(controlPoints) { if (!controlPoints || !(controlPoints instanceof Array) || controlPoints.length < 2) { - throw new DeveloperError("controlPoints is required. It must be an array with at least a length of 3."); + throw new DeveloperError('controlPoints is required. It must be an array with at least a length of 3.'); } this._points = controlPoints; @@ -91,12 +91,12 @@ define([ * @return {Quaternion} The orientation at the given time. */ OrientationInterpolator.prototype.evaluate = function(time) { - if (typeof time === "undefined") { - throw new DeveloperError("time is required."); + if (typeof time === 'undefined') { + throw new DeveloperError('time is required.'); } if (time < this._points[0].time || time > this._points[this._points.length - 1].time) { - throw new DeveloperError("time is out of range."); + throw new DeveloperError('time is out of range.'); } var i = this._findIndex(time); diff --git a/Source/Core/PlaneTessellator.js b/Source/Core/PlaneTessellator.js index 57edae8dbe0..5c029cca248 100644 --- a/Source/Core/PlaneTessellator.js +++ b/Source/Core/PlaneTessellator.js @@ -29,7 +29,7 @@ define([ var onInterpolation = template.onInterpolation; // Can be undefined if (resolution.x <= 1 || resolution.y <= 1) { - throw new DeveloperError("Resolution must be greater than one in both the x and y directions."); + throw new DeveloperError('Resolution must be greater than one in both the x and y directions.'); } var i; diff --git a/Source/Core/PolygonPipeline.js b/Source/Core/PolygonPipeline.js index 2d026ef9d52..c4ea0f7dfef 100644 --- a/Source/Core/PolygonPipeline.js +++ b/Source/Core/PolygonPipeline.js @@ -86,12 +86,12 @@ define([ */ cleanUp : function(positions) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } var length = positions.length; if (length < 3) { - throw new DeveloperError("At least three positions are required."); + throw new DeveloperError('At least three positions are required.'); } var cleanedPositions = []; @@ -116,12 +116,12 @@ define([ */ computeArea2D : function(positions) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } var length = positions.length; if (length < 3) { - throw new DeveloperError("At least three positions are required."); + throw new DeveloperError('At least three positions are required.'); } var area = 0.0; @@ -170,12 +170,12 @@ define([ // * http://blogs.agi.com/insight3d/index.php/2008/03/20/triangulation-rhymes-with-strangulation/ if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } var length = positions.length; if (length < 3) { - throw new DeveloperError("At least three positions are required."); + throw new DeveloperError('At least three positions are required.'); } var remainingPositions = new DoublyLinkedList(); @@ -259,24 +259,24 @@ define([ */ computeSubdivision : function(positions, indices, granularity) { if (!positions) { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } if (!indices) { - throw new DeveloperError("indices is required."); + throw new DeveloperError('indices is required.'); } if (indices.length < 3) { - throw new DeveloperError("At least three indices are required."); + throw new DeveloperError('At least three indices are required.'); } if (indices.length % 3 !== 0) { - throw new DeveloperError("The number of indices must be divisable by three."); + throw new DeveloperError('The number of indices must be divisable by three.'); } granularity = granularity || CesiumMath.toRadians(1.0); if (granularity <= 0.0) { - throw new DeveloperError("granularity must be greater than zero."); + throw new DeveloperError('granularity must be greater than zero.'); } // Use a queue for triangles that need (or might need) to be subdivided. @@ -315,7 +315,7 @@ define([ if (max > granularity) { if (g0 === max) { - edge = Math.min(triangle.i0, triangle.i1).toString() + " " + Math.max(triangle.i0, triangle.i1).toString(); + edge = Math.min(triangle.i0, triangle.i1).toString() + ' ' + Math.max(triangle.i0, triangle.i1).toString(); i = edges[edge]; if (!i) { @@ -335,7 +335,7 @@ define([ i2 : triangle.i2 }); } else if (g1 === max) { - edge = Math.min(triangle.i1, triangle.i2).toString() + " " + Math.max(triangle.i1, triangle.i2).toString(); + edge = Math.min(triangle.i1, triangle.i2).toString() + ' ' + Math.max(triangle.i1, triangle.i2).toString(); i = edges[edge]; if (!i) { @@ -355,7 +355,7 @@ define([ i2 : triangle.i0 }); } else if (g2 === max) { - edge = Math.min(triangle.i2, triangle.i0).toString() + " " + Math.max(triangle.i2, triangle.i0).toString(); + edge = Math.min(triangle.i2, triangle.i0).toString() + ' ' + Math.max(triangle.i2, triangle.i0).toString(); i = edges[edge]; if (!i) { @@ -405,7 +405,7 @@ define([ */ scaleToGeodeticHeight : function(ellipsoid, mesh, height) { if (!ellipsoid) { - throw new DeveloperError("ellipsoid is required."); + throw new DeveloperError('ellipsoid is required.'); } height = height || 0.0; diff --git a/Source/Core/PrimitiveType.js b/Source/Core/PrimitiveType.js index 3febcaf821f..ccd31d03498 100644 --- a/Source/Core/PrimitiveType.js +++ b/Source/Core/PrimitiveType.js @@ -14,49 +14,49 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - POINTS : new Enumeration(0x0000, "POINTS"), + POINTS : new Enumeration(0x0000, 'POINTS'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - LINES : new Enumeration(0x0001, "LINES"), + LINES : new Enumeration(0x0001, 'LINES'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - LINE_LOOP : new Enumeration(0x0002, "LINE_LOOP"), + LINE_LOOP : new Enumeration(0x0002, 'LINE_LOOP'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - LINE_STRIP : new Enumeration(0x0003, "LINE_STRIP"), + LINE_STRIP : new Enumeration(0x0003, 'LINE_STRIP'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - TRIANGLES : new Enumeration(0x0004, "TRIANGLES"), + TRIANGLES : new Enumeration(0x0004, 'TRIANGLES'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - TRIANGLE_STRIP : new Enumeration(0x0005, "TRIANGLE_STRIP"), + TRIANGLE_STRIP : new Enumeration(0x0005, 'TRIANGLE_STRIP'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - TRIANGLE_FAN : new Enumeration(0x0006, "TRIANGLE_FAN"), + TRIANGLE_FAN : new Enumeration(0x0006, 'TRIANGLE_FAN'), /** * DOC_TBA diff --git a/Source/Core/Quaternion.js b/Source/Core/Quaternion.js index 45123c5395d..502b2f733ee 100644 --- a/Source/Core/Quaternion.js +++ b/Source/Core/Quaternion.js @@ -36,7 +36,7 @@ define([ * @see Quaternion.z * @see Quaternion.w */ - this.x = (typeof x !== "undefined") ? x : 0.0; + this.x = (typeof x !== 'undefined') ? x : 0.0; /** * The y coordinate. @@ -47,7 +47,7 @@ define([ * @see Quaternion.z * @see Quaternion.w */ - this.y = (typeof y !== "undefined") ? y : 0.0; + this.y = (typeof y !== 'undefined') ? y : 0.0; /** * The z coordinate. @@ -58,7 +58,7 @@ define([ * @see Quaternion.y * @see Quaternion.w */ - this.z = (typeof z !== "undefined") ? z : 0.0; + this.z = (typeof z !== 'undefined') ? z : 0.0; /** * The w coordinate. @@ -69,7 +69,7 @@ define([ * @see Quaternion.y * @see Quaternion.z */ - this.w = (typeof w !== "undefined") ? w : 0.0; + this.w = (typeof w !== 'undefined') ? w : 0.0; } /** @@ -489,7 +489,7 @@ define([ * @return {String} A string representing this Quaternion. */ Quaternion.prototype.toString = function() { - return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + ")"; + return '(' + this.x + ', ' + this.y + ', ' + this.z + ', ' + this.w + ')'; }; /** diff --git a/Source/Core/Rectangle.js b/Source/Core/Rectangle.js index 37d36d398ff..b533534eebd 100644 --- a/Source/Core/Rectangle.js +++ b/Source/Core/Rectangle.js @@ -54,11 +54,11 @@ define(['./DeveloperError'], function(DeveloperError) { Rectangle.createAxisAlignedBoundingRectangle = function(positions) { if (typeof positions === 'undefined') { - throw new DeveloperError("positions is required."); + throw new DeveloperError('positions is required.'); } if (typeof positions.length === 'undefined' || positions.length <= 0) { - throw new DeveloperError("The length of positions must be greater than zero."); + throw new DeveloperError('The length of positions must be greater than zero.'); } var length = positions.length; @@ -147,7 +147,7 @@ define(['./DeveloperError'], function(DeveloperError) { * @return {String} A string representing this rectangle. */ Rectangle.prototype.toString = function() { - return "(" + this.x + ", " + this.y + ", " + this.width + ", " + this.height + ")"; + return '(' + this.x + ', ' + this.y + ', ' + this.width + ', ' + this.height + ')'; }; /** diff --git a/Source/Core/RuntimeError.js b/Source/Core/RuntimeError.js index 5c29d8ede34..1c206650f3f 100644 --- a/Source/Core/RuntimeError.js +++ b/Source/Core/RuntimeError.js @@ -20,12 +20,12 @@ define(function() { */ function RuntimeError(message) { /** - * "RuntimeError" indicating that this exception was thrown due to a runtime error. + * 'RuntimeError' indicating that this exception was thrown due to a runtime error. * * @constant * @type String */ - this.name = "RuntimeError"; + this.name = 'RuntimeError'; /** * The explanation for why this exception was thrown. diff --git a/Source/Core/Shapes.js b/Source/Core/Shapes.js index 03be85caa33..c3d6d5e72d5 100644 --- a/Source/Core/Shapes.js +++ b/Source/Core/Shapes.js @@ -101,16 +101,16 @@ define([ */ computeCircleBoundary : function(ellipsoid, center, radius, granularity) { if (!ellipsoid || !center || !radius) { - throw new DeveloperError("ellipsoid, center, and radius are required."); + throw new DeveloperError('ellipsoid, center, and radius are required.'); } if (radius <= 0.0) { - throw new DeveloperError("radius must be greater than zero."); + throw new DeveloperError('radius must be greater than zero.'); } granularity = granularity || CesiumMath.toRadians(1.0); if (granularity <= 0.0) { - throw new DeveloperError("granularity must be greater than zero."); + throw new DeveloperError('granularity must be greater than zero.'); } return this.computeEllipseBoundary(ellipsoid, center, radius, radius, 0, granularity); @@ -152,18 +152,18 @@ define([ */ computeEllipseBoundary : function(ellipsoid, center, semiMajorAxis, semiMinorAxis, bearing, granularity) { if (!ellipsoid || !center || !semiMajorAxis || !semiMinorAxis) { - throw new DeveloperError("ellipsoid, center, semiMajorAxis, and semiMinorAxis are required."); + throw new DeveloperError('ellipsoid, center, semiMajorAxis, and semiMinorAxis are required.'); } if (semiMajorAxis <= 0.0 || semiMinorAxis <= 0.0) { - throw new DeveloperError("Semi-major and semi-minor axes must be greater than zero."); + throw new DeveloperError('Semi-major and semi-minor axes must be greater than zero.'); } bearing = bearing || 0.0; granularity = granularity || CesiumMath.toRadians(1.0); if (granularity <= 0.0) { - throw new DeveloperError("granularity must be greater than zero.", "granularity"); + throw new DeveloperError('granularity must be greater than zero.', 'granularity'); } if (semiMajorAxis < semiMinorAxis) { diff --git a/Source/Core/TimeStandard.js b/Source/Core/TimeStandard.js index fc8569ad393..ec3f5b79bbc 100644 --- a/Source/Core/TimeStandard.js +++ b/Source/Core/TimeStandard.js @@ -71,13 +71,13 @@ define(['require', './DeveloperError', './binarySearch', './LeapSecond'], functi */ convertTaiToUtc : function(julianDate) { if (!julianDate) { - throw new DeveloperError("julianDate is required."); + throw new DeveloperError('julianDate is required.'); } if (julianDate.getTimeStandard() === TimeStandard.UTC) { return julianDate; } if (julianDate.getTimeStandard() !== TimeStandard.TAI) { - throw new DeveloperError("julianDate is not in the TAI time standard."); + throw new DeveloperError('julianDate is not in the TAI time standard.'); } // treat the request date as if it were UTC, and search for the most recent leap second. @@ -128,19 +128,19 @@ define(['require', './DeveloperError', './binarySearch', './LeapSecond'], functi * @return {JulianDate} A Julian date representing the input date in the TAI time standard. * * @example - * var date = new Date("July 11, 2011 12:00:00 UTC"); + * var date = new Date('July 11, 2011 12:00:00 UTC'); * var julianDateUtc = JulianDate.fromDate(date, TimeStandard.UTC); * var julianDateTai = TimeStandard.convertUtcToTai(julianDateUtc); */ convertUtcToTai : function(julianDate) { if (!julianDate) { - throw new DeveloperError("julianDate is required."); + throw new DeveloperError('julianDate is required.'); } if (julianDate.getTimeStandard() === TimeStandard.TAI) { return julianDate; } if (julianDate.getTimeStandard() !== TimeStandard.UTC) { - throw new DeveloperError("julianDate is not in the UTC time standard."); + throw new DeveloperError('julianDate is not in the UTC time standard.'); } var newDate = julianDate.addSeconds(julianDate.getTaiMinusUtc()); diff --git a/Source/Core/Tipsify.js b/Source/Core/Tipsify.js index 6d275e07a19..beda9aa6610 100644 --- a/Source/Core/Tipsify.js +++ b/Source/Core/Tipsify.js @@ -5,12 +5,12 @@ define(['./DeveloperError'], function(DeveloperError) { /** * Encapsulates an algorithm to optimize triangles for the post * vertex-shader cache. This is based on the 2007 SIGGRAPH paper - * "Fast Triangle Reordering for Vertex Locality and Reduced Overdraw." + * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.' * The runtime is linear but several passes are made. * * @exports Tipsify * - * @see + * @see * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw * by Sander, Nehab, and Barczak */ @@ -44,19 +44,19 @@ define(['./DeveloperError'], function(DeveloperError) { var cacheSize = description.cacheSize || 24; if (!indices) { - throw new DeveloperError("indices is required."); + throw new DeveloperError('indices is required.'); } var numIndices = indices.length; if ((numIndices < 3) || (numIndices % 3 !== 0)) { - throw new DeveloperError("indices length must be a multiple of three."); + throw new DeveloperError('indices length must be a multiple of three.'); } if (maximumIndex <= 0) { - throw new DeveloperError("maximumIndex must be greater than zero."); + throw new DeveloperError('maximumIndex must be greater than zero.'); } if (cacheSize < 3) { - throw new DeveloperError("cacheSize must be greater than two."); + throw new DeveloperError('cacheSize must be greater than two.'); } // Compute the maximumIndex if not given @@ -167,18 +167,18 @@ define(['./DeveloperError'], function(DeveloperError) { } if (!indices) { - throw new DeveloperError("indices is required."); + throw new DeveloperError('indices is required.'); } var numIndices = indices.length; if ((numIndices < 3) || (numIndices % 3 !== 0)) { - throw new DeveloperError("indices length must be a multiple of three."); + throw new DeveloperError('indices length must be a multiple of three.'); } if (maximumIndex <= 0) { - throw new DeveloperError("maximumIndex must be greater than zero."); + throw new DeveloperError('maximumIndex must be greater than zero.'); } if (cacheSize < 3) { - throw new DeveloperError("cacheSize must be greater than two."); + throw new DeveloperError('cacheSize must be greater than two.'); } // Determine maximum index diff --git a/Source/Core/Transforms.js b/Source/Core/Transforms.js index 4e376beb469..49a77b5442c 100644 --- a/Source/Core/Transforms.js +++ b/Source/Core/Transforms.js @@ -55,7 +55,7 @@ define([ */ eastNorthUpToFixedFrame : function(position, ellipsoid) { if (!position) { - throw new DeveloperError("position is required."); + throw new DeveloperError('position is required.'); } ellipsoid = ellipsoid || Ellipsoid.WGS84; @@ -109,7 +109,7 @@ define([ */ northEastDownToFixedFrame : function(position, ellipsoid) { if (!position) { - throw new DeveloperError("position is required."); + throw new DeveloperError('position is required.'); } ellipsoid = ellipsoid || Ellipsoid.WGS84; @@ -156,15 +156,15 @@ define([ */ pointToWindowCoordinates : function (modelViewProjectionMatrix, viewportTransformation, point) { if (typeof modelViewProjectionMatrix === 'undefined') { - throw new DeveloperError("modelViewProjectionMatrix is required."); + throw new DeveloperError('modelViewProjectionMatrix is required.'); } if (typeof viewportTransformation === 'undefined') { - throw new DeveloperError("viewportTransformation is required."); + throw new DeveloperError('viewportTransformation is required.'); } if (typeof point === 'undefined') { - throw new DeveloperError("point is required."); + throw new DeveloperError('point is required.'); } var pnt = new Cartesian4(point.x, point.y, point.z, 1.0); diff --git a/Source/Core/TridiagonalSystemSolver.js b/Source/Core/TridiagonalSystemSolver.js index e7b25b0ff08..30df1760481 100644 --- a/Source/Core/TridiagonalSystemSolver.js +++ b/Source/Core/TridiagonalSystemSolver.js @@ -46,29 +46,29 @@ define(['./DeveloperError'], function(DeveloperError) { */ TridiagonalSystemSolver.solve = function(lower, diagonal, upper, right) { if (!lower || !(lower instanceof Array)) { - throw new DeveloperError("The array lower is required."); + throw new DeveloperError('The array lower is required.'); } if (!diagonal || !(diagonal instanceof Array)) { - throw new DeveloperError("The array diagonal is required."); + throw new DeveloperError('The array diagonal is required.'); } if (!upper || !(upper instanceof Array)) { - throw new DeveloperError("The array upper is required."); + throw new DeveloperError('The array upper is required.'); } if (!right || !(right instanceof Array)) { - throw new DeveloperError("The array right is required."); + throw new DeveloperError('The array right is required.'); } if (diagonal.length !== right.length) { - throw new DeveloperError("diagonal and right must have the same lengths."); + throw new DeveloperError('diagonal and right must have the same lengths.'); } if (lower.length !== upper.length) { - throw new DeveloperError("lower and upper must have the same lengths."); + throw new DeveloperError('lower and upper must have the same lengths.'); } else if (lower.length !== diagonal.length - 1) { - throw new DeveloperError("lower and upper must be one less than the length of diagonal."); + throw new DeveloperError('lower and upper must be one less than the length of diagonal.'); } var c = [], d = [], x = []; diff --git a/Source/Core/Visibility.js b/Source/Core/Visibility.js index 83d81367a16..278717d5efb 100644 --- a/Source/Core/Visibility.js +++ b/Source/Core/Visibility.js @@ -17,21 +17,21 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NONE : new Enumeration(-1, "NONE"), + NONE : new Enumeration(-1, 'NONE'), /** * Represents that part, but not all, of an object is visible * * @constant * @type {Enumeration} */ - PARTIAL : new Enumeration(0, "PARTIAL"), + PARTIAL : new Enumeration(0, 'PARTIAL'), /** * Represents that an object is visible in its entirety. * * @constant * @type {Enumeration} */ - FULL : new Enumeration(1, "FULL") + FULL : new Enumeration(1, 'FULL') }; return Visibility; diff --git a/Source/Core/WindingOrder.js b/Source/Core/WindingOrder.js index d2c21cfc074..ff13c594563 100644 --- a/Source/Core/WindingOrder.js +++ b/Source/Core/WindingOrder.js @@ -14,14 +14,14 @@ define(['./Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CLOCKWISE : new Enumeration(0x0900, "CLOCKWISE"), // WebGL: CW + CLOCKWISE : new Enumeration(0x0900, 'CLOCKWISE'), // WebGL: CW /** * DOC_TBA * * @constant * @type {Enumeration} */ - COUNTER_CLOCKWISE : new Enumeration(0x0901, "COUNTER_CLOCKWISE"), // WebGL CCW + COUNTER_CLOCKWISE : new Enumeration(0x0901, 'COUNTER_CLOCKWISE'), // WebGL CCW /** * DOC_TBA diff --git a/Source/Core/binarySearch.js b/Source/Core/binarySearch.js index 084a3ec52b4..ef12c60ba91 100644 --- a/Source/Core/binarySearch.js +++ b/Source/Core/binarySearch.js @@ -34,13 +34,13 @@ define(['./DeveloperError'], function(DeveloperError) { */ function binarySearch(array, itemToFind, comparator) { if (!array) { - throw new DeveloperError("array is required."); + throw new DeveloperError('array is required.'); } if (!itemToFind) { - throw new DeveloperError("itemToFind is required."); + throw new DeveloperError('itemToFind is required.'); } if (!comparator) { - throw new DeveloperError("comparator is required."); + throw new DeveloperError('comparator is required.'); } var low = 0; diff --git a/Source/Core/combine.js b/Source/Core/combine.js index 873c9fb1e86..c0662f872c0 100644 --- a/Source/Core/combine.js +++ b/Source/Core/combine.js @@ -17,7 +17,7 @@ define(['./DeveloperError'], function(DeveloperError) { for ( var key in object) { if (object.hasOwnProperty(key)) { if (composite[key]) { - throw new DeveloperError("Duplicate member: " + key); + throw new DeveloperError('Duplicate member: ' + key); } composite[key] = object[key]; diff --git a/Source/Core/createGuid.js b/Source/Core/createGuid.js index d4bb7ce2ba1..65005bfe817 100644 --- a/Source/Core/createGuid.js +++ b/Source/Core/createGuid.js @@ -5,7 +5,7 @@ define(function() { /** * Creates a Globally unique identifier (GUID) string. A GUID is 128 bits long, and can guarantee uniqueness across space and time. * - * @see RFC 4122 A Universally Unique IDentifier (UUID) URN Namespace + * @see RFC 4122 A Universally Unique IDentifier (UUID) URN Namespace * * @example * this.guid = createGuid(); diff --git a/Source/Core/destroyObject.js b/Source/Core/destroyObject.js index 163cf426efe..5e89e651203 100644 --- a/Source/Core/destroyObject.js +++ b/Source/Core/destroyObject.js @@ -24,14 +24,14 @@ define(['./DeveloperError'], function(DeveloperError) { * }; */ function destroyObject(object, message) { - message = message || "This object was destroyed, i.e., destroy() was called."; + message = message || 'This object was destroyed, i.e., destroy() was called.'; function throwOnDestroyed() { throw new DeveloperError(message); } for ( var key in object) { - if (typeof object[key] === "function") { + if (typeof object[key] === 'function') { object[key] = throwOnDestroyed; } else { delete object[key]; diff --git a/Source/Core/isLeapYear.js b/Source/Core/isLeapYear.js index 6822f64093d..8d5cd3a5041 100644 --- a/Source/Core/isLeapYear.js +++ b/Source/Core/isLeapYear.js @@ -16,7 +16,7 @@ define(['Core/DeveloperError'], function(DeveloperError) { */ function isLeapYear(year) { if (year === null || isNaN(year)) { - throw new DeveloperError("year is required and must be a number."); + throw new DeveloperError('year is required and must be a number.'); } return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); } diff --git a/Source/Core/jsonp.js b/Source/Core/jsonp.js index e13d0b1b3cf..d34ba8ad3c6 100755 --- a/Source/Core/jsonp.js +++ b/Source/Core/jsonp.js @@ -1,6 +1,6 @@ /*global define*/ define(['./DeveloperError'], function(DeveloperError) { - 'use strict'; + "use strict"; function pushQueryParameter(array, name, value) { array.push(encodeURIComponent(name) + '=' + encodeURIComponent(value)); diff --git a/Source/Core/pointInsideTriangle2D.js b/Source/Core/pointInsideTriangle2D.js index bfc433f7ee4..8347a4d31ca 100644 --- a/Source/Core/pointInsideTriangle2D.js +++ b/Source/Core/pointInsideTriangle2D.js @@ -16,7 +16,7 @@ define(['./DeveloperError'], function(DeveloperError) { */ function pointInsideTriangle2D(point, p0, p1, p2) { if (!point || !p0 || !p1 || !p2) { - throw new DeveloperError("point, p0, p1, and p2 are required."); + throw new DeveloperError('point, p0, p1, and p2 are required.'); } // Implementation based on http://www.blackpawn.com/texts/pointinpoly/default.html. diff --git a/Source/Renderer/BlendEquation.js b/Source/Renderer/BlendEquation.js index 4c083d3246d..a8423972a81 100644 --- a/Source/Renderer/BlendEquation.js +++ b/Source/Renderer/BlendEquation.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ADD : new Enumeration(0x8006, "ADD"), // WebGL: FUNC_ADD + ADD : new Enumeration(0x8006, 'ADD'), // WebGL: FUNC_ADD /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SUBTRACT : new Enumeration(0x800A, "SUBTRACT"), // WebGL: FUNC_SUBTRACT + SUBTRACT : new Enumeration(0x800A, 'SUBTRACT'), // WebGL: FUNC_SUBTRACT /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - REVERSE_SUBTRACT : new Enumeration(0x800B, "REVERSE_SUBTRACT"), // WebGL: FUNC_REVERSE_SUBTRACT + REVERSE_SUBTRACT : new Enumeration(0x800B, 'REVERSE_SUBTRACT'), // WebGL: FUNC_REVERSE_SUBTRACT // No min and max like in ColladaFX GLES2 profile diff --git a/Source/Renderer/BlendFunction.js b/Source/Renderer/BlendFunction.js index 06e3840ce98..e2b0de3c48d 100644 --- a/Source/Renderer/BlendFunction.js +++ b/Source/Renderer/BlendFunction.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ZERO : new Enumeration(0, "ZERO"), + ZERO : new Enumeration(0, 'ZERO'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE : new Enumeration(1, "ONE"), + ONE : new Enumeration(1, 'ONE'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SOURCE_COLOR : new Enumeration(0x0300, "SOURCE_COLOR"), // WebGL: SRC_COLOR + SOURCE_COLOR : new Enumeration(0x0300, 'SOURCE_COLOR'), // WebGL: SRC_COLOR /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE_MINUS_SOURCE_COLOR : new Enumeration(0x0301, "ONE_MINUS_SOURCE_COLOR"), // WebGL: ONE_MINUS_SRC_COLOR + ONE_MINUS_SOURCE_COLOR : new Enumeration(0x0301, 'ONE_MINUS_SOURCE_COLOR'), // WebGL: ONE_MINUS_SRC_COLOR /** * DOC_TBA @@ -46,7 +46,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DESTINATION_COLOR : new Enumeration(0x0306, "DESTINATION_COLOR"), // WebGL: DEST_COLOR + DESTINATION_COLOR : new Enumeration(0x0306, 'DESTINATION_COLOR'), // WebGL: DEST_COLOR /** * DOC_TBA @@ -54,7 +54,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE_MINUS_DESTINATION_COLOR : new Enumeration(0x0307, "ONE_MINUS_DESTINATION_COLOR"), // WebGL: ONE_MINUS_DEST_COLOR + ONE_MINUS_DESTINATION_COLOR : new Enumeration(0x0307, 'ONE_MINUS_DESTINATION_COLOR'), // WebGL: ONE_MINUS_DEST_COLOR /** * DOC_TBA @@ -62,7 +62,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SOURCE_ALPHA : new Enumeration(0x0302, "SOURCE_ALPHA"), // WebGL: SRC_ALPHA + SOURCE_ALPHA : new Enumeration(0x0302, 'SOURCE_ALPHA'), // WebGL: SRC_ALPHA /** * DOC_TBA @@ -70,7 +70,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE_MINUS_SOURCE_ALPHA : new Enumeration(0x0303, "ONE_MINUS_SOURCE_ALPHA"), // WebGL: ONE_MINUS_SRC_ALPHA + ONE_MINUS_SOURCE_ALPHA : new Enumeration(0x0303, 'ONE_MINUS_SOURCE_ALPHA'), // WebGL: ONE_MINUS_SRC_ALPHA /** * DOC_TBA @@ -78,7 +78,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DESTINATION_ALPHA : new Enumeration(0x0304, "DESTINATION_ALPHA"), // WebGL: DST_ALPHA + DESTINATION_ALPHA : new Enumeration(0x0304, 'DESTINATION_ALPHA'), // WebGL: DST_ALPHA /** * DOC_TBA @@ -86,7 +86,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE_MINUS_DESTINATION_ALPHA : new Enumeration(0x0305, "ONE_MINUS_DESTINATION_ALPHA"), // WebGL: ONE_MINUS_DST_ALPHA + ONE_MINUS_DESTINATION_ALPHA : new Enumeration(0x0305, 'ONE_MINUS_DESTINATION_ALPHA'), // WebGL: ONE_MINUS_DST_ALPHA /** * DOC_TBA @@ -94,7 +94,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CONSTANT_COLOR : new Enumeration(0x8001, "CONSTANT_COLOR"), + CONSTANT_COLOR : new Enumeration(0x8001, 'CONSTANT_COLOR'), /** * DOC_TBA @@ -102,7 +102,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE_MINUS_CONSTANT_COLOR : new Enumeration(0x8002, "ONE_MINUS_CONSTANT_COLOR"), + ONE_MINUS_CONSTANT_COLOR : new Enumeration(0x8002, 'ONE_MINUS_CONSTANT_COLOR'), /** * DOC_TBA @@ -110,7 +110,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CONSTANT_ALPHA : new Enumeration(0x8003, "CONSTANT_ALPHA"), + CONSTANT_ALPHA : new Enumeration(0x8003, 'CONSTANT_ALPHA'), /** * DOC_TBA @@ -118,7 +118,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ONE_MINUS_CONSTANT_ALPHA : new Enumeration(0x8004, "ONE_MINUS_CONSTANT_ALPHA"), + ONE_MINUS_CONSTANT_ALPHA : new Enumeration(0x8004, 'ONE_MINUS_CONSTANT_ALPHA'), /** * DOC_TBA @@ -126,7 +126,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SOURCE_ALPHA_SATURATE : new Enumeration(0x0308, "SOURCE_ALPHA_SATURATE"), // WebGL: SRC_ALPHA_SATURATE + SOURCE_ALPHA_SATURATE : new Enumeration(0x0308, 'SOURCE_ALPHA_SATURATE'), // WebGL: SRC_ALPHA_SATURATE /** * DOC_TBA diff --git a/Source/Renderer/Buffer.js b/Source/Renderer/Buffer.js index 8a5592b1947..4f9035faecc 100644 --- a/Source/Renderer/Buffer.js +++ b/Source/Renderer/Buffer.js @@ -38,13 +38,13 @@ define([ */ Buffer.prototype.copyFromArrayView = function(arrayView, offsetInBytes) { if (!arrayView) { - throw new DeveloperError("arrayView is required."); + throw new DeveloperError('arrayView is required.'); } offsetInBytes = offsetInBytes || 0; if (offsetInBytes + arrayView.byteLength > this._sizeInBytes) { - throw new DeveloperError("This buffer is not large enough."); + throw new DeveloperError('This buffer is not large enough.'); } var gl = this._gl; @@ -127,7 +127,7 @@ define([ * @exception {DeveloperError} This buffer was destroyed, i.e., destroy() was called. * * @see Buffer#isDestroyed - * @see glDeleteBuffers + * @see glDeleteBuffers * * @example * buffer = buffer && buffer.destroy(); diff --git a/Source/Renderer/BufferUsage.js b/Source/Renderer/BufferUsage.js index 06df88fb236..552bcf4dd55 100644 --- a/Source/Renderer/BufferUsage.js +++ b/Source/Renderer/BufferUsage.js @@ -14,21 +14,21 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - STREAM_DRAW : new Enumeration(0x88E0, "STREAM_DRAW"), + STREAM_DRAW : new Enumeration(0x88E0, 'STREAM_DRAW'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - STATIC_DRAW : new Enumeration(0x88E4, "STATIC_DRAW"), + STATIC_DRAW : new Enumeration(0x88E4, 'STATIC_DRAW'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - DYNAMIC_DRAW : new Enumeration(0x88E8, "DYNAMIC_DRAW"), + DYNAMIC_DRAW : new Enumeration(0x88E8, 'DYNAMIC_DRAW'), /** * DOC_TBA diff --git a/Source/Renderer/Context.js b/Source/Renderer/Context.js index 163caa01081..bfbd511217a 100644 --- a/Source/Renderer/Context.js +++ b/Source/Renderer/Context.js @@ -70,40 +70,40 @@ define([ "use strict"; function _errorToString(gl, error) { - var message = "OpenGL Error: "; + var message = 'OpenGL Error: '; switch (error) { case gl.INVALID_ENUM: - message += "Invalid enumeration"; + message += 'Invalid enumeration'; break; case gl.INVALID_VALUE: - message += "Invalid value"; + message += 'Invalid value'; break; case gl.INVALID_OPERATION: - message += "Invalid operation"; + message += 'Invalid operation'; break; case gl.OUT_OF_MEMORY: - message += "Out of memory"; + message += 'Out of memory'; break; case gl.CONTEXT_LOST_WEBGL: - message += "Context lost"; + message += 'Context lost'; break; default: - message += "Unknown"; + message += 'Unknown'; } return message; } function _createErrorMessage(gl, glFunc, glFuncArguments, error) { - var message = _errorToString(gl, error) + ": " + glFunc.name + "("; + var message = _errorToString(gl, error) + ': ' + glFunc.name + '('; for ( var i = 0; i < glFuncArguments.length; ++i) { if (i !== 0) { - message += ", "; + message += ', '; } message += glFuncArguments[i]; } - message += ");"; + message += ');'; return message; } @@ -139,7 +139,7 @@ define([ var property = gl[propertyName]; // wrap any functions we encounter, otherwise just copy the property to the wrapper. - if (typeof property === "function") { + if (typeof property === 'function') { glWrapper[propertyName] = wrapFunction(property); } else { glWrapper[propertyName] = property; @@ -161,11 +161,11 @@ define([ */ function Context(canvas, options) { if (!window.WebGLRenderingContext) { - throw new RuntimeError("The browser does not support WebGL. Visit http://get.webgl.org."); + throw new RuntimeError('The browser does not support WebGL. Visit http://get.webgl.org.'); } if (!canvas) { - throw new DeveloperError("canvas is required."); + throw new DeveloperError('canvas is required.'); } this._canvas = canvas; @@ -180,10 +180,10 @@ define([ options.alpha = false; } - this._originalGLContext = canvas.getContext("webgl", options) || canvas.getContext("experimental-webgl", options); + this._originalGLContext = canvas.getContext('webgl', options) || canvas.getContext('experimental-webgl', options); if (!this._originalGLContext) { - throw new RuntimeError("The browser supports WebGL, but initialization failed."); + throw new RuntimeError('The browser supports WebGL, but initialization failed.'); } // Validation and logging disabled by default for speed. @@ -224,9 +224,9 @@ define([ this._viewport = gl.getParameter(gl.VIEWPORT); // Query and initialize extensions - var textureFilterAnisotropic = gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || gl.getExtension("MOZ_EXT_texture_filter_anisotropic"); + var textureFilterAnisotropic = gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') || gl.getExtension('MOZ_EXT_texture_filter_anisotropic'); - this._standardDerivatives = gl.getExtension("OES_standard_derivatives"); + this._standardDerivatives = gl.getExtension('OES_standard_derivatives'); this._textureFilterAnisotropic = textureFilterAnisotropic; this._maximumTextureFilterAnisotropy = textureFilterAnisotropic ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1.0; @@ -511,12 +511,12 @@ define([ * }); */ Context.prototype.setViewport = function(viewport) { - if ((typeof viewport === "undefined") || - (typeof viewport.x === "undefined") || - (typeof viewport.y === "undefined") || - (typeof viewport.width === "undefined") || - (typeof viewport.height === "undefined")) { - throw new DeveloperError("A viewport with x, y, width, and height properties is required."); + if ((typeof viewport === 'undefined') || + (typeof viewport.x === 'undefined') || + (typeof viewport.y === 'undefined') || + (typeof viewport.width === 'undefined') || + (typeof viewport.height === 'undefined')) { + throw new DeveloperError('A viewport with x, y, width, and height properties is required.'); } var x = viewport.x; @@ -525,19 +525,19 @@ define([ var h = viewport.height; if (w < 0) { - throw new DeveloperError("viewport.width must be greater than or equal to zero."); + throw new DeveloperError('viewport.width must be greater than or equal to zero.'); } if (w > this.getMaximumViewportWidth()) { - throw new RuntimeError("viewport.width must be less than or equal to the maximum viewport width (" + this.getMaximumViewportWidth().toString() + "). Check getMaximumViewportWidth()."); + throw new RuntimeError('viewport.width must be less than or equal to the maximum viewport width (' + this.getMaximumViewportWidth().toString() + '). Check getMaximumViewportWidth().'); } if (h < 0) { - throw new DeveloperError("viewport.height must be greater than or equal to zero."); + throw new DeveloperError('viewport.height must be greater than or equal to zero.'); } if (h > this.getMaximumViewportHeight()) { - throw new RuntimeError("viewport.height must be less than or equal to the maximum viewport height (" + this.getMaximumViewportHeight().toString() + "). Check getMaximumViewportHeight()."); + throw new RuntimeError('viewport.height must be less than or equal to the maximum viewport height (' + this.getMaximumViewportHeight().toString() + '). Check getMaximumViewportHeight().'); } var v = this._viewport; @@ -556,7 +556,7 @@ define([ * @memberof Context * * @returns {String} The WebGL version or release number. - * @see glGetString with VERSION. + * @see glGetString with VERSION. */ Context.prototype.getVersion = function() { return this._version; @@ -568,7 +568,7 @@ define([ * @memberof Context * * @returns {String} The version or release number for the shading language. - * @see glGetString with SHADING_LANGUAGE_VERSION. + * @see glGetString with SHADING_LANGUAGE_VERSION. */ Context.prototype.getShadingLanguageVersion = function() { return this._shadingLanguageVersion; @@ -580,7 +580,7 @@ define([ * @memberof Context * * @returns {String} The company responsible for the WebGL implementation. - * @see glGetString with VENDOR. + * @see glGetString with VENDOR. */ Context.prototype.getVendor = function() { return this._vendor; @@ -588,15 +588,15 @@ define([ /** * Returns the name of the renderer/configuration/hardware platform. For example, this may be the model of the - * video card, e.g., "GeForce 8800 GTS/PCI/SSE2", or the browser-dependent name of the GL implementation, e.g. - * "Mozilla" or "ANGLE." + * video card, e.g., 'GeForce 8800 GTS/PCI/SSE2', or the browser-dependent name of the GL implementation, e.g. + * 'Mozilla' or 'ANGLE.' * * @memberof Context * * @returns {String} The name of the renderer. * - * @see glGetString with RENDERER. - * @see ANGLE + * @see glGetString with RENDERER. + * @see ANGLE */ Context.prototype.getRenderer = function() { return this._renderer; @@ -608,7 +608,7 @@ define([ * @memberof Context * * @returns {Number} The number of red bits per component in the color buffer. - * @see glGet with RED_BITS. + * @see glGet with RED_BITS. */ Context.prototype.getRedBits = function() { return this._redBits; @@ -620,7 +620,7 @@ define([ * @memberof Context * * @returns {Number} The number of green bits per component in the color buffer. - * @see glGet with GREEN_BITS. + * @see glGet with GREEN_BITS. */ Context.prototype.getGreenBits = function() { return this._greenBits; @@ -632,7 +632,7 @@ define([ * @memberof Context * * @returns {Number} The number of blue bits per component in the color buffer. - * @see glGet with BLUE_BITS. + * @see glGet with BLUE_BITS. */ Context.prototype.getBlueBits = function() { return this._blueBits; @@ -647,7 +647,7 @@ define([ * @memberof Context * * @returns {Number} The number of alpha bits per component in the color buffer. - * @see glGet with ALPHA_BITS. + * @see glGet with ALPHA_BITS. */ Context.prototype.getAlphaBits = function() { return this._alphaBits; @@ -660,7 +660,7 @@ define([ * @memberof Context * * @returns {Number} The number of depth bits per pixel in the default bound framebuffer. - * @see glGet with DEPTH_BITS. + * @see glGet with DEPTH_BITS. */ Context.prototype.getDepthBits = function() { return this._depthBits; @@ -672,7 +672,7 @@ define([ * @memberof Context * * @returns {Number} The number of stencil bits per pixel in the default bound framebuffer. - * @see glGet with STENCIL_BITS. + * @see glGet with STENCIL_BITS. */ Context.prototype.getStencilBits = function() { return this._stencilBits; @@ -689,7 +689,7 @@ define([ * * @see Context#getMaximumTextureImageUnits * @see Context#getMaximumVertexTextureImageUnits - * @see glGet with MAX_COMBINED_TEXTURE_IMAGE_UNITS. + * @see glGet with MAX_COMBINED_TEXTURE_IMAGE_UNITS. */ Context.prototype.getMaximumCombinedTextureImageUnits = function() { return this._maximumCombinedTextureImageUnits; @@ -705,7 +705,7 @@ define([ * * @see Context#createCubeMap * @see Context#getMaximumTextureSize - * @see glGet with MAX_CUBE_MAP_TEXTURE_SIZE. + * @see glGet with MAX_CUBE_MAP_TEXTURE_SIZE. */ Context.prototype.getMaximumCubeMapSize = function() { return this._maximumCubeMapSize; @@ -720,7 +720,7 @@ define([ * @returns {Number} The maximum number of vec4, ivec4, and bvec4 uniforms that can be used by a fragment shader. * * @see Context#getMaximumVertexUniformVectors - * @see glGet with MAX_FRAGMENT_UNIFORM_VECTORS. + * @see glGet with MAX_FRAGMENT_UNIFORM_VECTORS. */ Context.prototype.getMaximumFragmentUniformVectors = function() { return this._maximumFragmentUniformVectors; @@ -735,7 +735,7 @@ define([ * * @see Context#getMaximumCombinedTextureImageUnits * @see Context#getMaximumVertexTextureImageUnits - * @see glGet with MAX_TEXTURE_IMAGE_UNITS. + * @see glGet with MAX_TEXTURE_IMAGE_UNITS. */ Context.prototype.getMaximumTextureImageUnits = function() { return this._maximumTextureImageUnits; @@ -750,7 +750,7 @@ define([ * @returns {Number} The maximum renderbuffer width and height. * * @see Context#createRenderbuffer - * @see glGet with MAX_RENDERBUFFER_SIZE. + * @see glGet with MAX_RENDERBUFFER_SIZE. */ Context.prototype.getMaximumRenderbufferSize = function() { return this._maximumRenderbufferSize; @@ -766,7 +766,7 @@ define([ * * @see Context#createTexture2D * @see Context#getMaximumCubeMapSize - * @see glGet with MAX_TEXTURE_SIZE. + * @see glGet with MAX_TEXTURE_SIZE. */ Context.prototype.getMaximumTextureSize = function() { return this._maximumTextureSize; @@ -780,7 +780,7 @@ define([ * * @returns {Number} Returns the maximum number of vec4 varying variables. * - * @see glGet with MAX_VARYING_VECTORS. + * @see glGet with MAX_VARYING_VECTORS. */ Context.prototype.getMaximumVaryingVectors = function() { return this._maximumVaryingVectors; @@ -794,7 +794,7 @@ define([ * @returns {Number} The maximum number of vec4 vertex attributes. * * @see Context#createVertexArray - * @see glGet with MAX_VERTEX_ATTRIBS. + * @see glGet with MAX_VERTEX_ATTRIBS. */ Context.prototype.getMaximumVertexAttributes = function() { return this._maximumVertexAttributes; @@ -810,7 +810,7 @@ define([ * * @see Context#getMaximumCombinedTextureImageUnits * @see Context#getMaximumTextureImageUnits - * @see glGet with MAX_VERTEX_TEXTURE_IMAGE_UNITS. + * @see glGet with MAX_VERTEX_TEXTURE_IMAGE_UNITS. */ Context.prototype.getMaximumVertexTextureImageUnits = function() { return this._maximumVertexTextureImageUnits; @@ -825,7 +825,7 @@ define([ * @returns {Number} The maximum number of vec4, ivec4, and bvec4 uniforms that can be used by a vertex shader. * * @see Context#getMaximumFragmentUniformVectors - * @see glGet with MAX_VERTEX_UNIFORM_VECTORS. + * @see glGet with MAX_VERTEX_UNIFORM_VECTORS. */ Context.prototype.getMaximumVertexUniformVectors = function() { return this._maximumVertexUniformVectors; @@ -839,7 +839,7 @@ define([ * @returns {Number} The minimum aliased line in pixels. * * @see Context#getMaximumAliasedLineWidth - * @see glGet with ALIASED_LINE_WIDTH_RANGE. + * @see glGet with ALIASED_LINE_WIDTH_RANGE. */ Context.prototype.getMinimumAliasedLineWidth = function() { return this._aliasedLineWidthRange[0]; @@ -853,7 +853,7 @@ define([ * @returns {Number} The maximum aliased line in pixels. * * @see Context#getMinimumAliasedLineWidth - * @see glGet with ALIASED_LINE_WIDTH_RANGE. + * @see glGet with ALIASED_LINE_WIDTH_RANGE. */ Context.prototype.getMaximumAliasedLineWidth = function() { return this._aliasedLineWidthRange[1]; @@ -867,7 +867,7 @@ define([ * @returns {Number} The minimum aliased point size in pixels. * * @see Context#getMaximumAliasedPointSize - * @see glGet with ALIASED_POINT_SIZE_RANGE. + * @see glGet with ALIASED_POINT_SIZE_RANGE. */ Context.prototype.getMinimumAliasedPointSize = function() { return this._aliasedPointSizeRange[0]; @@ -881,7 +881,7 @@ define([ * @returns {Number} The maximum aliased point size in pixels. * * @see Context#getMinimumAliasedPointSize - * @see glGet with ALIASED_POINT_SIZE_RANGE. + * @see glGet with ALIASED_POINT_SIZE_RANGE. */ Context.prototype.getMaximumAliasedPointSize = function() { return this._aliasedPointSizeRange[1]; @@ -895,7 +895,7 @@ define([ * @returns {Number} The maximum supported width of the viewport. * * @see Context#getMaximumViewportHeight - * @see glGet with MAX_VIEWPORT_DIMS. + * @see glGet with MAX_VIEWPORT_DIMS. */ Context.prototype.getMaximumViewportWidth = function() { return this._maximumViewportDimensions[0]; @@ -909,7 +909,7 @@ define([ * @returns {Number} The maximum supported height of the viewport. * * @see Context#getMaximumViewportHeight - * @see glGet with MAX_VIEWPORT_DIMS. + * @see glGet with MAX_VIEWPORT_DIMS. */ Context.prototype.getMaximumViewportHeight = function() { return this._maximumViewportDimensions[1]; @@ -925,7 +925,7 @@ define([ * * @returns {Boolean} true if OES_standard_derivatives is supported; otherwise, false. * - * @see OES_standard_derivatives + * @see OES_standard_derivatives */ Context.prototype.getStandardDerivatives = function() { return !!this._standardDerivatives; @@ -938,7 +938,7 @@ define([ * * @returns {Boolean} true if EXT_texture_filter_anisotropic is supported; otherwise, false. * - * @see EXT_texture_filter_anisotropic + * @see EXT_texture_filter_anisotropic */ Context.prototype.getTextureFilterAnisotropic = function() { return !!this._textureFilterAnisotropic; @@ -1081,34 +1081,34 @@ define([ * @see Context#draw * @see Context#createVertexArray * @see Context#getShaderCache - * @see glCreateShader - * @see glShaderSource - * @see glCompileShader - * @see glCreateProgram - * @see glAttachShader - * @see glLinkProgram - * @see glGetShaderiv - * @see glGetActiveUniform - * @see glGetUniformLocation - * @see glGetUniform - * @see glBindAttribLocation - * @see glGetActiveAttrib - * @see glGetAttribLocation + * @see glCreateShader + * @see glShaderSource + * @see glCompileShader + * @see glCreateProgram + * @see glAttachShader + * @see glLinkProgram + * @see glGetShaderiv + * @see glGetActiveUniform + * @see glGetUniformLocation + * @see glGetUniform + * @see glBindAttribLocation + * @see glGetActiveAttrib + * @see glGetAttribLocation * * @example * // Example 1. Create a shader program allowing the GL to determine * // attribute indices. - * var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - * var fs = "void main() { gl_FragColor = vec4(1.0); }"; + * var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + * var fs = 'void main() { gl_FragColor = vec4(1.0); }'; * var sp = context.createShaderProgram(vs, fs); * * //////////////////////////////////////////////////////////////////////////////// * * // Example 2. Create a shader program with explicit attribute indices. - * var vs = "attribute vec4 position;" + - * "attribute vec3 normal;" + - * "void main() { ... }"; - * var fs = "void main() { gl_FragColor = vec4(1.0); }"; + * var vs = 'attribute vec4 position;' + + * 'attribute vec3 normal;' + + * 'void main() { ... }'; + * var fs = 'void main() { gl_FragColor = vec4(1.0); }'; * var attributes = { * position : 0, * normal : 1 @@ -1122,18 +1122,18 @@ define([ Context.prototype._createBuffer = function(gl, bufferTarget, arrayViewOrSizeInBytes, usage) { var sizeInBytes; - if (typeof arrayViewOrSizeInBytes === "object") { + if (typeof arrayViewOrSizeInBytes === 'object') { sizeInBytes = arrayViewOrSizeInBytes.byteLength; } else { sizeInBytes = arrayViewOrSizeInBytes; } if (sizeInBytes <= 0) { - throw new DeveloperError("arrayViewOrSizeInBytes must be greater than zero."); + throw new DeveloperError('arrayViewOrSizeInBytes must be greater than zero.'); } if (!BufferUsage.validate(usage)) { - throw new DeveloperError("usage is invalid"); + throw new DeveloperError('usage is invalid'); } var buffer = gl.createBuffer(); @@ -1162,9 +1162,9 @@ define([ * * @see Context#createVertexArray * @see Context#createIndexBuffer - * @see glGenBuffer - * @see glBindBuffer with ARRAY_BUFFER - * @see glBufferData with ARRAY_BUFFER + * @see glGenBuffer + * @see glBindBuffer with ARRAY_BUFFER + * @see glBufferData with ARRAY_BUFFER * * @example * // Example 1. Create a dynamic vertex buffer 16 bytes in size. @@ -1205,9 +1205,9 @@ define([ * @see Context#createVertexBuffer * @see Context#draw * @see VertexArray - * @see glGenBuffer - * @see glBindBuffer with ELEMENT_ARRAY_BUFFER - * @see glBufferData with ELEMENT_ARRAY_BUFFER + * @see glGenBuffer + * @see glBindBuffer with ELEMENT_ARRAY_BUFFER + * @see glBufferData with ELEMENT_ARRAY_BUFFER * * @example * // Example 1. Create a stream index buffer of unsigned shorts that is @@ -1230,7 +1230,7 @@ define([ } else if (indexDatatype === IndexDatatype.UNSIGNED_SHORT) { bytesPerIndex = Uint16Array.BYTES_PER_ELEMENT; } else { - throw new DeveloperError("Invalid indexDatatype."); + throw new DeveloperError('Invalid indexDatatype.'); } var buffer = this._createBuffer(gl, gl.ELEMENT_ARRAY_BUFFER, arrayViewOrSizeInBytes, usage); @@ -1365,41 +1365,41 @@ define([ */ Context.prototype.createTexture2D = function(description) { if (!description) { - throw new DeveloperError("description is required."); + throw new DeveloperError('description is required.'); } var source = description.source; var width = typeof source !== 'undefined' ? source.width : description.width; var height = typeof source !== 'undefined' ? source.height : description.height; - if (typeof width === "undefined" || typeof height === "undefined") { - throw new DeveloperError("description requires a source field to create an initialized texture or width and height fields to create a blank texture."); + if (typeof width === 'undefined' || typeof height === 'undefined') { + throw new DeveloperError('description requires a source field to create an initialized texture or width and height fields to create a blank texture.'); } if (width <= 0) { - throw new DeveloperError("Width must be greater than zero."); + throw new DeveloperError('Width must be greater than zero.'); } if (width > this._maximumTextureSize) { - throw new DeveloperError("Width must be less than or equal to the maximum texture size (" + this._maximumTextureSize + "). Check getMaximumTextureSize()."); + throw new DeveloperError('Width must be less than or equal to the maximum texture size (' + this._maximumTextureSize + '). Check getMaximumTextureSize().'); } if (height <= 0) { - throw new DeveloperError("Height must be greater than zero."); + throw new DeveloperError('Height must be greater than zero.'); } if (height > this._maximumTextureSize) { - throw new DeveloperError("Height must be less than or equal to the maximum texture size (" + this._maximumTextureSize + "). Check getMaximumTextureSize()."); + throw new DeveloperError('Height must be less than or equal to the maximum texture size (' + this._maximumTextureSize + '). Check getMaximumTextureSize().'); } var pixelFormat = description.pixelFormat || PixelFormat.RGBA; if (!PixelFormat.validate(pixelFormat)) { - throw new DeveloperError("Invalid description.pixelFormat."); + throw new DeveloperError('Invalid description.pixelFormat.'); } var pixelDatatype = description.pixelDatatype || PixelDatatype.UNSIGNED_BYTE; if (!PixelDatatype.validate(pixelDatatype)) { - throw new DeveloperError("Invalid description.pixelDatatype."); + throw new DeveloperError('Invalid description.pixelDatatype.'); } // Use premultiplied alpha for opaque textures should perform better on Chrome: @@ -1458,23 +1458,23 @@ define([ Context.prototype.createTexture2DFromFramebuffer = function(pixelFormat, framebufferXOffset, framebufferYOffset, width, height) { pixelFormat = pixelFormat || PixelFormat.RGB; if (!PixelFormat.validate(pixelFormat)) { - throw new DeveloperError("Invalid pixelFormat."); + throw new DeveloperError('Invalid pixelFormat.'); } if (framebufferXOffset < 0) { - throw new DeveloperError("framebufferXOffset must be greater than or equal to zero."); + throw new DeveloperError('framebufferXOffset must be greater than or equal to zero.'); } if (framebufferYOffset < 0) { - throw new DeveloperError("framebufferYOffset must be greater than or equal to zero."); + throw new DeveloperError('framebufferYOffset must be greater than or equal to zero.'); } if (framebufferXOffset + width > this._canvas.clientWidth) { - throw new DeveloperError("framebufferXOffset + width must be less than or equal to getCanvas().clientWidth"); + throw new DeveloperError('framebufferXOffset + width must be less than or equal to getCanvas().clientWidth'); } if (framebufferYOffset + height > this._canvas.clientHeight) { - throw new DeveloperError("framebufferYOffset + height must be less than or equal to getCanvas().clientHeight."); + throw new DeveloperError('framebufferYOffset + height must be less than or equal to getCanvas().clientHeight.'); } framebufferXOffset = framebufferXOffset || 0; @@ -1526,7 +1526,7 @@ define([ */ Context.prototype.createCubeMap = function(description) { if (!description) { - throw new DeveloperError("description is required."); + throw new DeveloperError('description is required.'); } var source = description.source; @@ -1537,7 +1537,7 @@ define([ var faces = [source.positiveX, source.negativeX, source.positiveY, source.negativeY, source.positiveZ, source.negativeZ]; if (!faces[0] || !faces[1] || !faces[2] || !faces[3] || !faces[4] || !faces[5]) { - throw new DeveloperError("description.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces."); + throw new DeveloperError('description.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.'); } width = faces[0].width; @@ -1545,7 +1545,7 @@ define([ for ( var i = 1; i < 6; ++i) { if ((Number(faces[i].width) !== width) || (Number(faces[i].height) !== height)) { - throw new DeveloperError("Each face in description.source must have the same width and height."); + throw new DeveloperError('Each face in description.source must have the same width and height.'); } } } else { @@ -1553,32 +1553,32 @@ define([ height = description.height; } - if (typeof width === "undefined" || typeof height === "undefined") { - throw new DeveloperError("description requires a source field to create an initialized cube map or width and height fields to create a blank cube map."); + if (typeof width === 'undefined' || typeof height === 'undefined') { + throw new DeveloperError('description requires a source field to create an initialized cube map or width and height fields to create a blank cube map.'); } if (width !== height) { - throw new DeveloperError("Width must equal height."); + throw new DeveloperError('Width must equal height.'); } var size = width; if (size <= 0) { - throw new DeveloperError("Width and height must be greater than zero."); + throw new DeveloperError('Width and height must be greater than zero.'); } if (size > this._maximumCubeMapSize) { - throw new DeveloperError("Width and height must be less than or equal to the maximum cube map size (" + this._maximumCubeMapSize + "). Check getMaximumCubeMapSize()."); + throw new DeveloperError('Width and height must be less than or equal to the maximum cube map size (' + this._maximumCubeMapSize + '). Check getMaximumCubeMapSize().'); } var pixelFormat = description.pixelFormat || PixelFormat.RGBA; if (!PixelFormat.validate(pixelFormat)) { - throw new DeveloperError("Invalid description.pixelFormat."); + throw new DeveloperError('Invalid description.pixelFormat.'); } var pixelDatatype = description.pixelDatatype || PixelDatatype.UNSIGNED_BYTE; if (!PixelDatatype.validate(pixelDatatype)) { - throw new DeveloperError("Invalid description.pixelDatatype."); + throw new DeveloperError('Invalid description.pixelDatatype.'); } // Use premultiplied alpha for opaque textures should perform better on Chrome: @@ -1643,15 +1643,15 @@ define([ Context.prototype.createFramebuffer = function(description) { if (description) { if (description.depthRenderbuffer && description.depthStencilRenderbuffer) { - throw new DeveloperError("Cannot have both a depth and depth-stencil attachment."); + throw new DeveloperError('Cannot have both a depth and depth-stencil attachment.'); } if (description.stencilRenderbuffer && description.depthStencilRenderbuffer) { - throw new DeveloperError("Cannot have both a stencil and depth-stencil attachment."); + throw new DeveloperError('Cannot have both a stencil and depth-stencil attachment.'); } if (description.depthRenderbuffer && description.stencilRenderbuffer) { - throw new DeveloperError("Cannot have both a depth and stencil attachment."); + throw new DeveloperError('Cannot have both a depth and stencil attachment.'); } } return new Framebuffer(this._gl, description); @@ -1677,29 +1677,29 @@ define([ Context.prototype.createRenderbuffer = function(description) { description = description || {}; var format = description.format || RenderbufferFormat.RGBA4; - var width = (typeof description.width === "undefined") ? this._canvas.clientWidth : description.width; - var height = (typeof description.height === "undefined") ? this._canvas.clientHeight : description.height; + var width = (typeof description.width === 'undefined') ? this._canvas.clientWidth : description.width; + var height = (typeof description.height === 'undefined') ? this._canvas.clientHeight : description.height; var gl = this._gl; if (!RenderbufferFormat.validate(format)) { - throw new DeveloperError("Invalid format."); + throw new DeveloperError('Invalid format.'); } if (width <= 0) { - throw new DeveloperError("Width must be greater than zero."); + throw new DeveloperError('Width must be greater than zero.'); } if (width > this.getMaximumRenderbufferSize()) { - throw new DeveloperError("Width must be less than or equal to the maximum renderbuffer size (" + this.getMaximumRenderbufferSize() + "). Check getMaximumRenderbufferSize()."); + throw new DeveloperError('Width must be less than or equal to the maximum renderbuffer size (' + this.getMaximumRenderbufferSize() + '). Check getMaximumRenderbufferSize().'); } if (height <= 0) { - throw new DeveloperError("Height must be greater than zero."); + throw new DeveloperError('Height must be greater than zero.'); } if (height > this.getMaximumRenderbufferSize()) { - throw new DeveloperError("Height must be less than or equal to the maximum renderbuffer size (" + this.getMaximumRenderbufferSize() + "). Check getMaximumRenderbufferSize()."); + throw new DeveloperError('Height must be less than or equal to the maximum renderbuffer size (' + this.getMaximumRenderbufferSize() + '). Check getMaximumRenderbufferSize().'); } return new Renderbuffer(gl, format, width, height); @@ -1753,122 +1753,122 @@ define([ var sampleCoverage = rs.sampleCoverage || {}; var r = { - frontFace : (typeof rs.frontFace === "undefined") ? WindingOrder.COUNTER_CLOCKWISE : rs.frontFace, + frontFace : (typeof rs.frontFace === 'undefined') ? WindingOrder.COUNTER_CLOCKWISE : rs.frontFace, cull : { - enabled : (typeof cull.enabled === "undefined") ? false : cull.enabled, - face : (typeof cull.face === "undefined") ? CullFace.BACK : cull.face + enabled : (typeof cull.enabled === 'undefined') ? false : cull.enabled, + face : (typeof cull.face === 'undefined') ? CullFace.BACK : cull.face }, - lineWidth : (typeof rs.lineWidth === "undefined") ? 1 : rs.lineWidth, + lineWidth : (typeof rs.lineWidth === 'undefined') ? 1 : rs.lineWidth, polygonOffset : { - enabled : (typeof polygonOffset.enabled === "undefined") ? false : polygonOffset.enabled, - factor : (typeof polygonOffset.factor === "undefined") ? 0 : polygonOffset.factor, - units : (typeof polygonOffset.units === "undefined") ? 0 : polygonOffset.units + enabled : (typeof polygonOffset.enabled === 'undefined') ? false : polygonOffset.enabled, + factor : (typeof polygonOffset.factor === 'undefined') ? 0 : polygonOffset.factor, + units : (typeof polygonOffset.units === 'undefined') ? 0 : polygonOffset.units }, scissorTest : { - enabled : (typeof scissorTest.enabled === "undefined") ? false : scissorTest.enabled, + enabled : (typeof scissorTest.enabled === 'undefined') ? false : scissorTest.enabled, rectangle : { - x : (typeof scissorTestRectangle.x === "undefined") ? 0 : scissorTestRectangle.x, - y : (typeof scissorTestRectangle.y === "undefined") ? 0 : scissorTestRectangle.y, - width : (typeof scissorTestRectangle.width === "undefined") ? 0 : scissorTestRectangle.width, - height : (typeof scissorTestRectangle.height === "undefined") ? 0 : scissorTestRectangle.height + x : (typeof scissorTestRectangle.x === 'undefined') ? 0 : scissorTestRectangle.x, + y : (typeof scissorTestRectangle.y === 'undefined') ? 0 : scissorTestRectangle.y, + width : (typeof scissorTestRectangle.width === 'undefined') ? 0 : scissorTestRectangle.width, + height : (typeof scissorTestRectangle.height === 'undefined') ? 0 : scissorTestRectangle.height } }, depthRange : { - near : (typeof depthRange.near === "undefined") ? 0 : depthRange.near, - far : (typeof depthRange.far === "undefined") ? 1 : depthRange.far + near : (typeof depthRange.near === 'undefined') ? 0 : depthRange.near, + far : (typeof depthRange.far === 'undefined') ? 1 : depthRange.far }, depthTest : { - enabled : (typeof depthTest.enabled === "undefined") ? false : depthTest.enabled, - func : (typeof depthTest.func === "undefined") ? DepthFunction.LESS : depthTest.func // func, because function is a JavaScript keyword + enabled : (typeof depthTest.enabled === 'undefined') ? false : depthTest.enabled, + func : (typeof depthTest.func === 'undefined') ? DepthFunction.LESS : depthTest.func // func, because function is a JavaScript keyword }, colorMask : { - red : (typeof colorMask.red === "undefined") ? true : colorMask.red, - green : (typeof colorMask.green === "undefined") ? true : colorMask.green, - blue : (typeof colorMask.blue === "undefined") ? true : colorMask.blue, - alpha : (typeof colorMask.alpha === "undefined") ? true : colorMask.alpha + red : (typeof colorMask.red === 'undefined') ? true : colorMask.red, + green : (typeof colorMask.green === 'undefined') ? true : colorMask.green, + blue : (typeof colorMask.blue === 'undefined') ? true : colorMask.blue, + alpha : (typeof colorMask.alpha === 'undefined') ? true : colorMask.alpha }, - depthMask : (typeof rs.depthMask === "undefined") ? true : rs.depthMask, - stencilMask : (typeof rs.stencilMask === "undefined") ? ~0 : rs.stencilMask, + depthMask : (typeof rs.depthMask === 'undefined') ? true : rs.depthMask, + stencilMask : (typeof rs.stencilMask === 'undefined') ? ~0 : rs.stencilMask, blending : { - enabled : (typeof blending.enabled === "undefined") ? false : blending.enabled, + enabled : (typeof blending.enabled === 'undefined') ? false : blending.enabled, color : { - red : (typeof blendingColor.red === "undefined") ? 0 : blendingColor.red, - green : (typeof blendingColor.green === "undefined") ? 0 : blendingColor.green, - blue : (typeof blendingColor.blue === "undefined") ? 0 : blendingColor.blue, - alpha : (typeof blendingColor.alpha === "undefined") ? 0 : blendingColor.alpha + red : (typeof blendingColor.red === 'undefined') ? 0 : blendingColor.red, + green : (typeof blendingColor.green === 'undefined') ? 0 : blendingColor.green, + blue : (typeof blendingColor.blue === 'undefined') ? 0 : blendingColor.blue, + alpha : (typeof blendingColor.alpha === 'undefined') ? 0 : blendingColor.alpha }, - equationRgb : (typeof blending.equationRgb === "undefined") ? BlendEquation.ADD : blending.equationRgb, - equationAlpha : (typeof blending.equationAlpha === "undefined") ? BlendEquation.ADD : blending.equationAlpha, - functionSourceRgb : (typeof blending.functionSourceRgb === "undefined") ? BlendFunction.ONE : blending.functionSourceRgb, - functionSourceAlpha : (typeof blending.functionSourceAlpha === "undefined") ? BlendFunction.ONE : blending.functionSourceAlpha, - functionDestinationRgb : (typeof blending.functionDestinationRgb === "undefined") ? BlendFunction.ZERO : blending.functionDestinationRgb, - functionDestinationAlpha : (typeof blending.functionDestinationAlpha === "undefined") ? BlendFunction.ZERO : blending.functionDestinationAlpha + equationRgb : (typeof blending.equationRgb === 'undefined') ? BlendEquation.ADD : blending.equationRgb, + equationAlpha : (typeof blending.equationAlpha === 'undefined') ? BlendEquation.ADD : blending.equationAlpha, + functionSourceRgb : (typeof blending.functionSourceRgb === 'undefined') ? BlendFunction.ONE : blending.functionSourceRgb, + functionSourceAlpha : (typeof blending.functionSourceAlpha === 'undefined') ? BlendFunction.ONE : blending.functionSourceAlpha, + functionDestinationRgb : (typeof blending.functionDestinationRgb === 'undefined') ? BlendFunction.ZERO : blending.functionDestinationRgb, + functionDestinationAlpha : (typeof blending.functionDestinationAlpha === 'undefined') ? BlendFunction.ZERO : blending.functionDestinationAlpha }, stencilTest : { - enabled : (typeof stencilTest.enabled === "undefined") ? false : stencilTest.enabled, - frontFunction : (typeof stencilTest.frontFunction === "undefined") ? StencilFunction.ALWAYS : stencilTest.frontFunction, - backFunction : (typeof stencilTest.backFunction === "undefined") ? StencilFunction.ALWAYS : stencilTest.backFunction, - reference : (typeof stencilTest.reference === "undefined") ? 0 : stencilTest.reference, - mask : (typeof stencilTest.mask === "undefined") ? ~0 : stencilTest.mask, + enabled : (typeof stencilTest.enabled === 'undefined') ? false : stencilTest.enabled, + frontFunction : (typeof stencilTest.frontFunction === 'undefined') ? StencilFunction.ALWAYS : stencilTest.frontFunction, + backFunction : (typeof stencilTest.backFunction === 'undefined') ? StencilFunction.ALWAYS : stencilTest.backFunction, + reference : (typeof stencilTest.reference === 'undefined') ? 0 : stencilTest.reference, + mask : (typeof stencilTest.mask === 'undefined') ? ~0 : stencilTest.mask, frontOperation : { - fail : (typeof stencilTestFrontOperation.fail === "undefined") ? StencilOperation.KEEP : stencilTestFrontOperation.fail, - zFail : (typeof stencilTestFrontOperation.zFail === "undefined") ? StencilOperation.KEEP : stencilTestFrontOperation.zFail, - zPass : (typeof stencilTestFrontOperation.zPass === "undefined") ? StencilOperation.KEEP : stencilTestFrontOperation.zPass + fail : (typeof stencilTestFrontOperation.fail === 'undefined') ? StencilOperation.KEEP : stencilTestFrontOperation.fail, + zFail : (typeof stencilTestFrontOperation.zFail === 'undefined') ? StencilOperation.KEEP : stencilTestFrontOperation.zFail, + zPass : (typeof stencilTestFrontOperation.zPass === 'undefined') ? StencilOperation.KEEP : stencilTestFrontOperation.zPass }, backOperation : { - fail : (typeof stencilTestBackOperation.fail === "undefined") ? StencilOperation.KEEP : stencilTestBackOperation.fail, - zFail : (typeof stencilTestBackOperation.zFail === "undefined") ? StencilOperation.KEEP : stencilTestBackOperation.zFail, - zPass : (typeof stencilTestBackOperation.zPass === "undefined") ? StencilOperation.KEEP : stencilTestBackOperation.zPass + fail : (typeof stencilTestBackOperation.fail === 'undefined') ? StencilOperation.KEEP : stencilTestBackOperation.fail, + zFail : (typeof stencilTestBackOperation.zFail === 'undefined') ? StencilOperation.KEEP : stencilTestBackOperation.zFail, + zPass : (typeof stencilTestBackOperation.zPass === 'undefined') ? StencilOperation.KEEP : stencilTestBackOperation.zPass } }, // TODO: Also need point_size and point_size_enable for ColladaFX // TODO: Also need sample_alpha_to_coverage_enable for ColladaFX sampleCoverage : { - enabled : (typeof sampleCoverage.enabled === "undefined") ? false : sampleCoverage.enabled, - value : (typeof sampleCoverage.value === "undefined") ? 1.0 : sampleCoverage.value, - invert : (typeof sampleCoverage.invert === "undefined") ? false : sampleCoverage.invert + enabled : (typeof sampleCoverage.enabled === 'undefined') ? false : sampleCoverage.enabled, + value : (typeof sampleCoverage.value === 'undefined') ? 1.0 : sampleCoverage.value, + invert : (typeof sampleCoverage.invert === 'undefined') ? false : sampleCoverage.invert }, - dither : (typeof rs.dither === "undefined") ? true : rs.dither + dither : (typeof rs.dither === 'undefined') ? true : rs.dither }; // Validate if (!WindingOrder.validate(r.frontFace)) { - throw new DeveloperError("Invalid renderState.frontFace."); + throw new DeveloperError('Invalid renderState.frontFace.'); } if (!CullFace.validate(r.cull.face)) { - throw new DeveloperError("Invalid renderState.cull.face."); + throw new DeveloperError('Invalid renderState.cull.face.'); } if ((r.lineWidth < this._aliasedLineWidthRange[0]) || (r.lineWidth > this._aliasedLineWidthRange[1])) { - throw new RuntimeError("renderState.lineWidth is out of range. Check getMinimumAliasedLineWidth() and getMaximumAliasedLineWidth()."); + throw new RuntimeError('renderState.lineWidth is out of range. Check getMinimumAliasedLineWidth() and getMaximumAliasedLineWidth().'); } if ((r.scissorTest.rectangle.width < 0) || (r.scissorTest.rectangle.height < 0)) { - throw new DeveloperError("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero."); + throw new DeveloperError('renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.'); } if (r.depthRange.near > r.depthRange.far) { // WebGL specific - not an error in GL ES - throw new DeveloperError("renderState.depthRange.near can't be greater than renderState.depthRange.far."); + throw new DeveloperError('renderState.depthRange.near can not be greater than renderState.depthRange.far.'); } if (r.depthRange.near < 0) { // Would be clamped by GL - throw new DeveloperError("renderState.depthRange.near must be greater than or equal to zero."); + throw new DeveloperError('renderState.depthRange.near must be greater than or equal to zero.'); } if (r.depthRange.far > 1) { // Would be clamped by GL - throw new DeveloperError("renderState.depthRange.far must be less than or equal to one."); + throw new DeveloperError('renderState.depthRange.far must be less than or equal to one.'); } if (!DepthFunction.validate(r.depthTest.func)) { - throw new DeveloperError("Invalid renderState.depthTest.func."); + throw new DeveloperError('Invalid renderState.depthTest.func.'); } if ((r.blending.color.red < 0.0) || (r.blending.color.red > 1.0) || @@ -1876,63 +1876,63 @@ define([ (r.blending.color.blue < 0.0) || (r.blending.color.blue > 1.0) || (r.blending.color.alpha < 0.0) || (r.blending.color.alpha > 1.0)) { // Would be clamped by GL - throw new DeveloperError("renderState.blending.color components must be greater than or equal to zero and less than or equal to one."); + throw new DeveloperError('renderState.blending.color components must be greater than or equal to zero and less than or equal to one.'); } if (!BlendEquation.validate(r.blending.equationRgb)) { - throw new DeveloperError("Invalid renderState.blending.equationRgb."); + throw new DeveloperError('Invalid renderState.blending.equationRgb.'); } if (!BlendEquation.validate(r.blending.equationAlpha)) { - throw new DeveloperError("Invalid renderState.blending.equationAlpha."); + throw new DeveloperError('Invalid renderState.blending.equationAlpha.'); } if (!BlendFunction.validate(r.blending.functionSourceRgb)) { - throw new DeveloperError("Invalid renderState.blending.functionSourceRgb."); + throw new DeveloperError('Invalid renderState.blending.functionSourceRgb.'); } if (!BlendFunction.validate(r.blending.functionSourceAlpha)) { - throw new DeveloperError("Invalid renderState.blending.functionSourceAlpha."); + throw new DeveloperError('Invalid renderState.blending.functionSourceAlpha.'); } if (!BlendFunction.validate(r.blending.functionDestinationRgb)) { - throw new DeveloperError("Invalid renderState.blending.functionDestinationRgb."); + throw new DeveloperError('Invalid renderState.blending.functionDestinationRgb.'); } if (!BlendFunction.validate(r.blending.functionDestinationAlpha)) { - throw new DeveloperError("Invalid renderState.blending.functionDestinationAlpha."); + throw new DeveloperError('Invalid renderState.blending.functionDestinationAlpha.'); } if (!StencilFunction.validate(r.stencilTest.frontFunction)) { - throw new DeveloperError("Invalid renderState.stencilTest.frontFunction."); + throw new DeveloperError('Invalid renderState.stencilTest.frontFunction.'); } if (!StencilFunction.validate(r.stencilTest.backFunction)) { - throw new DeveloperError("Invalid renderState.stencilTest.backFunction."); + throw new DeveloperError('Invalid renderState.stencilTest.backFunction.'); } if (!StencilOperation.validate(r.stencilTest.frontOperation.fail)) { - throw new DeveloperError("Invalid renderState.stencilTest.frontOperation.fail."); + throw new DeveloperError('Invalid renderState.stencilTest.frontOperation.fail.'); } if (!StencilOperation.validate(r.stencilTest.frontOperation.zFail)) { - throw new DeveloperError("Invalid renderState.stencilTest.frontOperation.zFail."); + throw new DeveloperError('Invalid renderState.stencilTest.frontOperation.zFail.'); } if (!StencilOperation.validate(r.stencilTest.frontOperation.zPass)) { - throw new DeveloperError("Invalid renderState.stencilTest.frontOperation.zPass."); + throw new DeveloperError('Invalid renderState.stencilTest.frontOperation.zPass.'); } if (!StencilOperation.validate(r.stencilTest.backOperation.fail)) { - throw new DeveloperError("Invalid renderState.stencilTest.backOperation.fail."); + throw new DeveloperError('Invalid renderState.stencilTest.backOperation.fail.'); } if (!StencilOperation.validate(r.stencilTest.backOperation.zFail)) { - throw new DeveloperError("Invalid renderState.stencilTest.backOperation.zFail."); + throw new DeveloperError('Invalid renderState.stencilTest.backOperation.zFail.'); } if (!StencilOperation.validate(r.stencilTest.backOperation.zPass)) { - throw new DeveloperError("Invalid renderState.stencilTest.backOperation.zPass."); + throw new DeveloperError('Invalid renderState.stencilTest.backOperation.zPass.'); } return r; @@ -1957,27 +1957,27 @@ define([ wrapT : sampler.wrapT || TextureWrap.CLAMP, minificationFilter : sampler.minificationFilter || TextureMinificationFilter.LINEAR, magnificationFilter : sampler.magnificationFilter || TextureMagnificationFilter.LINEAR, - maximumAnisotropy : (typeof sampler.maximumAnisotropy !== "undefined") ? sampler.maximumAnisotropy : 1.0 + maximumAnisotropy : (typeof sampler.maximumAnisotropy !== 'undefined') ? sampler.maximumAnisotropy : 1.0 }; if (!TextureWrap.validate(s.wrapS)) { - throw new DeveloperError("Invalid sampler.wrapS."); + throw new DeveloperError('Invalid sampler.wrapS.'); } if (!TextureWrap.validate(s.wrapT)) { - throw new DeveloperError("Invalid sampler.wrapT."); + throw new DeveloperError('Invalid sampler.wrapT.'); } if (!TextureMinificationFilter.validate(s.minificationFilter)) { - throw new DeveloperError("Invalid sampler.minificationFilter."); + throw new DeveloperError('Invalid sampler.minificationFilter.'); } if (!TextureMagnificationFilter.validate(s.magnificationFilter)) { - throw new DeveloperError("Invalid sampler.magnificationFilter."); + throw new DeveloperError('Invalid sampler.magnificationFilter.'); } if (s.maximumAnisotropy < 1.0) { - throw new DeveloperError("sampler.maximumAnisotropy must be greater than or equal to one."); + throw new DeveloperError('sampler.maximumAnisotropy must be greater than or equal to one.'); } return s; @@ -2005,7 +2005,7 @@ define([ var stencil = cs.stencil; // Clear everything if nothing is specified - if ((typeof color === "undefined") && (typeof depth === "undefined") && (typeof stencil === "undefined")) { + if ((typeof color === 'undefined') && (typeof depth === 'undefined') && (typeof stencil === 'undefined')) { color = this._defaultClearColor; depth = this._defaultClearDepth; stencil = this._defaultClearStencil; @@ -2013,23 +2013,23 @@ define([ var c = { scissorTest : { - enabled : (typeof scissorTest.enabled === "undefined") ? false : scissorTest.enabled, + enabled : (typeof scissorTest.enabled === 'undefined') ? false : scissorTest.enabled, rectangle : { - x : (typeof scissorTestRectangle.x === "undefined") ? 0 : scissorTestRectangle.x, - y : (typeof scissorTestRectangle.y === "undefined") ? 0 : scissorTestRectangle.y, - width : (typeof scissorTestRectangle.width === "undefined") ? 0 : scissorTestRectangle.width, - height : (typeof scissorTestRectangle.height === "undefined") ? 0 : scissorTestRectangle.height + x : (typeof scissorTestRectangle.x === 'undefined') ? 0 : scissorTestRectangle.x, + y : (typeof scissorTestRectangle.y === 'undefined') ? 0 : scissorTestRectangle.y, + width : (typeof scissorTestRectangle.width === 'undefined') ? 0 : scissorTestRectangle.width, + height : (typeof scissorTestRectangle.height === 'undefined') ? 0 : scissorTestRectangle.height } }, colorMask : { - red : (typeof colorMask.red === "undefined") ? true : colorMask.red, - green : (typeof colorMask.green === "undefined") ? true : colorMask.green, - blue : (typeof colorMask.blue === "undefined") ? true : colorMask.blue, - alpha : (typeof colorMask.alpha === "undefined") ? true : colorMask.alpha + red : (typeof colorMask.red === 'undefined') ? true : colorMask.red, + green : (typeof colorMask.green === 'undefined') ? true : colorMask.green, + blue : (typeof colorMask.blue === 'undefined') ? true : colorMask.blue, + alpha : (typeof colorMask.alpha === 'undefined') ? true : colorMask.alpha }, - depthMask : (typeof cs.depthMask === "undefined") ? true : cs.depthMask, - stencilMask : (typeof cs.stencilMask === "undefined") ? ~0 : cs.stencilMask, - dither : (typeof cs.dither === "undefined") ? true : cs.dither, + depthMask : (typeof cs.depthMask === 'undefined') ? true : cs.depthMask, + stencilMask : (typeof cs.stencilMask === 'undefined') ? ~0 : cs.stencilMask, + dither : (typeof cs.dither === 'undefined') ? true : cs.dither, framebuffer : cs.framebuffer, @@ -2044,7 +2044,7 @@ define([ }; if ((c.scissorTest.rectangle.width < 0) || (c.scissorTest.rectangle.height < 0)) { - throw new DeveloperError("clearState.scissorTest.rectangle.width and clearState.scissorTest.rectangle.height must be greater than or equal to zero."); + throw new DeveloperError('clearState.scissorTest.rectangle.width and clearState.scissorTest.rectangle.height must be greater than or equal to zero.'); } return c; @@ -2060,16 +2060,16 @@ define([ switch (status) { case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT: - message = "Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format."; + message = 'Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.'; break; case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS: - message = "Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height."; + message = 'Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.'; break; case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: - message = "Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer."; + message = 'Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.'; break; case gl.FRAMEBUFFER_UNSUPPORTED: - message = "Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions."; + message = 'Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.'; break; } @@ -2096,7 +2096,7 @@ define([ var d = clearState.depth; var s = clearState.stencil; - if (typeof c !== "undefined") { + if (typeof c !== 'undefined') { if (c.red !== this._clearColor.red || c.green !== this._clearColor.green || c.blue !== this._clearColor.blue || @@ -2111,7 +2111,7 @@ define([ bitmask |= gl.COLOR_BUFFER_BIT; } - if (typeof d !== "undefined") { + if (typeof d !== 'undefined') { if (d !== this._clearDepth) { this._clearDepth = d; gl.clearDepth(d); @@ -2119,7 +2119,7 @@ define([ bitmask |= gl.DEPTH_BUFFER_BIT; } - if (typeof s !== "undefined") { + if (typeof s !== 'undefined') { if (s !== this._clearStencil) { this._clearStencil = s; gl.clearStencil(s); @@ -2154,7 +2154,7 @@ define([ gl.validateProgram(program); if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) { - throw new DeveloperError("Program validation failed. Link log: " + gl.getProgramInfoLog(program)); + throw new DeveloperError('Program validation failed. Link log: ' + gl.getProgramInfoLog(program)); } } }; @@ -2210,12 +2210,12 @@ define([ * @memberof Context */ Context.prototype.beginDraw = function(drawArguments) { - if (typeof drawArguments === "undefined") { - throw new DeveloperError("drawArguments is required."); + if (typeof drawArguments === 'undefined') { + throw new DeveloperError('drawArguments is required.'); } if (!drawArguments.shaderProgram) { - throw new DeveloperError("drawArguments.shaderProgram is required."); + throw new DeveloperError('drawArguments.shaderProgram is required.'); } var framebuffer = drawArguments.framebuffer; @@ -2226,7 +2226,7 @@ define([ if (rs.depthTest.enabled && !framebuffer.getDepthRenderbuffer() && !framebuffer.getDepthStencilRenderbuffer()) { - throw new DeveloperError("The depth test can't be enabled (drawArguments.renderState.depthTest.enabled) because the framebuffer (drawArguments.framebuffer) doesn't have a depth or depth-stencil renderbuffer."); + throw new DeveloperError('The depth test can not be enabled (drawArguments.renderState.depthTest.enabled) because the framebuffer (drawArguments.framebuffer) does not have a depth or depth-stencil renderbuffer.'); } } @@ -2250,21 +2250,21 @@ define([ */ Context.prototype.continueDraw = function(drawArguments) { var sp = this._currentSp; - if (typeof sp === "undefined") { - throw new DeveloperError("beginDraw must be called before continueDraw."); + if (typeof sp === 'undefined') { + throw new DeveloperError('beginDraw must be called before continueDraw.'); } - if (typeof drawArguments === "undefined") { - throw new DeveloperError("drawArguments is required."); + if (typeof drawArguments === 'undefined') { + throw new DeveloperError('drawArguments is required.'); } var primitiveType = drawArguments.primitiveType; if (!PrimitiveType.validate(primitiveType)) { - throw new DeveloperError("drawArguments.primitiveType is required and must be valid."); + throw new DeveloperError('drawArguments.primitiveType is required and must be valid.'); } if (!drawArguments.vertexArray) { - throw new DeveloperError("drawArguments.vertexArray is required."); + throw new DeveloperError('drawArguments.vertexArray is required.'); } var va = drawArguments.vertexArray; @@ -2282,7 +2282,7 @@ define([ } if (offset < 0) { - throw new DeveloperError("drawArguments.offset must be omitted or greater than or equal to zero."); + throw new DeveloperError('drawArguments.offset must be omitted or greater than or equal to zero.'); } if (count > 0) { @@ -2332,11 +2332,11 @@ define([ var framebuffer = readState.framebuffer || null; if (width <= 0) { - throw new DeveloperError("readState.width must be greater than zero."); + throw new DeveloperError('readState.width must be greater than zero.'); } if (height <= 0) { - throw new DeveloperError("readState.height must be greater than zero."); + throw new DeveloperError('readState.height must be greater than zero.'); } var pixels = new Uint8Array(4 * width * height); @@ -2392,11 +2392,11 @@ define([ if (currentNumberOfVertices !== numberOfVertices) { throw new RuntimeError( - "Each attribute list must have the same number of vertices. " + - "Attribute '" + names[j] + "' has a different number of vertices " + - "(" + currentNumberOfVertices.toString() + ")" + - " than attribute '" + names[0] + - "' (" + numberOfVertices.toString() + ")."); + 'Each attribute list must have the same number of vertices. ' + + 'Attribute ' + names[j] + ' has a different number of vertices ' + + '(' + currentNumberOfVertices.toString() + ')' + + ' than attribute ' + names[0] + + ' (' + numberOfVertices.toString() + ').'); } } } @@ -2610,7 +2610,7 @@ define([ if (mesh.indexLists) { indexLists = mesh.indexLists; if (indexLists.length !== 1) { - throw new DeveloperError("The mesh must have zero or one index lists. This mesh has " + indexLists.length.toString() + " index lists."); + throw new DeveloperError('The mesh must have zero or one index lists. This mesh has ' + indexLists.length.toString() + ' index lists.'); } } @@ -2662,7 +2662,7 @@ define([ function rgbToObjectIndex(unnormalizedRgb) { // TODO: Use alpha? - var index = "r" + unnormalizedRgb.red + "g" + unnormalizedRgb.green + "b" + unnormalizedRgb.blue; + var index = 'r' + unnormalizedRgb.red + 'g' + unnormalizedRgb.green + 'b' + unnormalizedRgb.blue; return index; } @@ -2675,7 +2675,7 @@ define([ nextRgb.green = 0; if (++nextRgb.red === 256) { - throw new RuntimeError("Out of unique Rgb colors."); + throw new RuntimeError('Out of unique Rgb colors.'); } } } diff --git a/Source/Renderer/CubeMap.js b/Source/Renderer/CubeMap.js index 58256018672..2de573ec081 100644 --- a/Source/Renderer/CubeMap.js +++ b/Source/Renderer/CubeMap.js @@ -55,7 +55,7 @@ define([ */ CubeMap.prototype._copyFrom = function(targetFace, source, xOffset, yOffset) { if (!source) { - throw new DeveloperError("source is required."); + throw new DeveloperError('source is required.'); } xOffset = xOffset || 0; @@ -65,19 +65,19 @@ define([ var height = source.height; if (xOffset < 0) { - throw new DeveloperError("xOffset must be greater than or equal to zero."); + throw new DeveloperError('xOffset must be greater than or equal to zero.'); } if (yOffset < 0) { - throw new DeveloperError("yOffset must be greater than or equal to zero."); + throw new DeveloperError('yOffset must be greater than or equal to zero.'); } if (xOffset + width > this._size) { - throw new DeveloperError("xOffset + source.width must be less than or equal to getWidth()."); + throw new DeveloperError('xOffset + source.width must be less than or equal to getWidth().'); } if (yOffset + height > this._size) { - throw new DeveloperError("yOffset + source.height must be less than or equal to getHeight()."); + throw new DeveloperError('yOffset + source.height must be less than or equal to getHeight().'); } var gl = this._gl; @@ -128,27 +128,27 @@ define([ height = height || this._size; if (xOffset < 0) { - throw new DeveloperError("xOffset must be greater than or equal to zero."); + throw new DeveloperError('xOffset must be greater than or equal to zero.'); } if (yOffset < 0) { - throw new DeveloperError("yOffset must be greater than or equal to zero."); + throw new DeveloperError('yOffset must be greater than or equal to zero.'); } if (framebufferXOffset < 0) { - throw new DeveloperError("framebufferXOffset must be greater than or equal to zero."); + throw new DeveloperError('framebufferXOffset must be greater than or equal to zero.'); } if (framebufferYOffset < 0) { - throw new DeveloperError("framebufferYOffset must be greater than or equal to zero."); + throw new DeveloperError('framebufferYOffset must be greater than or equal to zero.'); } if (xOffset + width > this._size) { - throw new DeveloperError("xOffset + source.width must be less than or equal to getWidth()."); + throw new DeveloperError('xOffset + source.width must be less than or equal to getWidth().'); } if (yOffset + height > this._size) { - throw new DeveloperError("yOffset + source.height must be less than or equal to getHeight()."); + throw new DeveloperError('yOffset + source.height must be less than or equal to getHeight().'); } var gl = this._gl; @@ -324,12 +324,12 @@ define([ */ CubeMap.prototype.generateMipmap = function(hint) { if ((this._size > 1) && (this._size % 2 !== 0)) { - throw new DeveloperError("This CubeMap's width and height must be a power of two to call generateMipmap()."); + throw new DeveloperError('width and height must be a power of two to call generateMipmap().'); } hint = hint || MipmapHint.DONT_CARE; if (!MipmapHint.validate(hint)) { - throw new DeveloperError("hint is invalid."); + throw new DeveloperError('hint is invalid.'); } var gl = this._gl; @@ -488,7 +488,7 @@ define([ * @exception {DeveloperError} This cube map was destroyed, i.e., destroy() was called. * * @see CubeMap.isDestroyed - * @see glDeleteTextures + * @see glDeleteTextures * * @example * cubeMap = cubeMap && cubeMap.destroy(); diff --git a/Source/Renderer/CullFace.js b/Source/Renderer/CullFace.js index 66e804dc53e..98f2a4e9cc0 100644 --- a/Source/Renderer/CullFace.js +++ b/Source/Renderer/CullFace.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FRONT : new Enumeration(0x0404, "FRONT"), + FRONT : new Enumeration(0x0404, 'FRONT'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - BACK : new Enumeration(0x0405, "BACK"), + BACK : new Enumeration(0x0405, 'BACK'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FRONT_AND_BACK : new Enumeration(0x0408, "FRONT_AND_BACK"), + FRONT_AND_BACK : new Enumeration(0x0408, 'FRONT_AND_BACK'), /** * DOC_TBA diff --git a/Source/Renderer/DepthFunction.js b/Source/Renderer/DepthFunction.js index 52a7a771567..6746b44a834 100644 --- a/Source/Renderer/DepthFunction.js +++ b/Source/Renderer/DepthFunction.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NEVER : new Enumeration(0x0200, "NEVER"), + NEVER : new Enumeration(0x0200, 'NEVER'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LESS : new Enumeration(0x0201, "LESS"), + LESS : new Enumeration(0x0201, 'LESS'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - EQUAL : new Enumeration(0x0202, "EQUAL"), + EQUAL : new Enumeration(0x0202, 'EQUAL'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LESS_OR_EQUAL : new Enumeration(0x0203, "LEQUAL"), + LESS_OR_EQUAL : new Enumeration(0x0203, 'LEQUAL'), /** * DOC_TBA @@ -46,7 +46,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - GREATER : new Enumeration(0x0204, "GREATER"), + GREATER : new Enumeration(0x0204, 'GREATER'), /** * DOC_TBA @@ -54,7 +54,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NOT_EQUAL : new Enumeration(0x0205, "NOTEQUAL"), + NOT_EQUAL : new Enumeration(0x0205, 'NOTEQUAL'), /** * DOC_TBA @@ -62,7 +62,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - GREATER_OR_EQUAL : new Enumeration(0x0206, "GEQUAL"), + GREATER_OR_EQUAL : new Enumeration(0x0206, 'GEQUAL'), /** * DOC_TBA @@ -70,7 +70,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ALWAYS : new Enumeration(0x0207, "ALWAYS"), + ALWAYS : new Enumeration(0x0207, 'ALWAYS'), /** * DOC_TBA diff --git a/Source/Renderer/Framebuffer.js b/Source/Renderer/Framebuffer.js index c49c857bf60..51c2f346413 100644 --- a/Source/Renderer/Framebuffer.js +++ b/Source/Renderer/Framebuffer.js @@ -199,9 +199,9 @@ define([ * @exception {DeveloperError} This framebuffer was destroyed, i.e., destroy() was called. * * @see Framebuffer.isDestroyed - * @see glDeleteFramebuffers - * @see glDeleteTextures - * @see glDeleteRenderbuffers + * @see glDeleteFramebuffers + * @see glDeleteTextures + * @see glDeleteRenderbuffers * * @example * // Destroying the framebuffer implicitly calls destroy for each of its attachments. diff --git a/Source/Renderer/MipmapHint.js b/Source/Renderer/MipmapHint.js index 65143d108d8..3ea4e4dd09f 100644 --- a/Source/Renderer/MipmapHint.js +++ b/Source/Renderer/MipmapHint.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DONT_CARE : new Enumeration(0x1100, "DONT_CARE"), + DONT_CARE : new Enumeration(0x1100, 'DONT_CARE'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FASTEST : new Enumeration(0x1101, "FASTEST"), + FASTEST : new Enumeration(0x1101, 'FASTEST'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NICEST : new Enumeration(0x1102, "NICEST"), + NICEST : new Enumeration(0x1102, 'NICEST'), /** * DOC_TBA diff --git a/Source/Renderer/PixelDatatype.js b/Source/Renderer/PixelDatatype.js index a060ed0ef3d..caa62b82ddb 100644 --- a/Source/Renderer/PixelDatatype.js +++ b/Source/Renderer/PixelDatatype.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - UNSIGNED_BYTE : new Enumeration(0x1401, "UNSIGNED_BYTE"), + UNSIGNED_BYTE : new Enumeration(0x1401, 'UNSIGNED_BYTE'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - UNSIGNED_SHORT_4_4_4_4 : new Enumeration(0x8033, "UNSIGNED_SHORT_4_4_4_4"), + UNSIGNED_SHORT_4_4_4_4 : new Enumeration(0x8033, 'UNSIGNED_SHORT_4_4_4_4'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - UNSIGNED_SHORT_5_5_5_1 : new Enumeration(0x8034, "UNSIGNED_SHORT_5_5_5_1"), + UNSIGNED_SHORT_5_5_5_1 : new Enumeration(0x8034, 'UNSIGNED_SHORT_5_5_5_1'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - UNSIGNED_SHORT_5_6_5 : new Enumeration(0x8363, "UNSIGNED_SHORT_5_6_5"), + UNSIGNED_SHORT_5_6_5 : new Enumeration(0x8363, 'UNSIGNED_SHORT_5_6_5'), /** * DOC_TBA diff --git a/Source/Renderer/PixelFormat.js b/Source/Renderer/PixelFormat.js index f4d876b1abc..fb9fe9133c7 100644 --- a/Source/Renderer/PixelFormat.js +++ b/Source/Renderer/PixelFormat.js @@ -14,42 +14,42 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DEPTH_COMPONENT : new Enumeration(0x1902, "DEPTH_COMPONENT"), + DEPTH_COMPONENT : new Enumeration(0x1902, 'DEPTH_COMPONENT'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - ALPHA : new Enumeration(0x1906, "ALPHA"), + ALPHA : new Enumeration(0x1906, 'ALPHA'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - RGB : new Enumeration(0x1907, "RGB"), + RGB : new Enumeration(0x1907, 'RGB'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - RGBA : new Enumeration(0x1908, "RGBA"), + RGBA : new Enumeration(0x1908, 'RGBA'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - LUMINANCE : new Enumeration(0x1909, "LUMINANCE"), + LUMINANCE : new Enumeration(0x1909, 'LUMINANCE'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - LUMINANCE_ALPHA : new Enumeration(0x190A, "LUMINANCE_ALPHA"), + LUMINANCE_ALPHA : new Enumeration(0x190A, 'LUMINANCE_ALPHA'), /** * DOC_TBA diff --git a/Source/Renderer/Renderbuffer.js b/Source/Renderer/Renderbuffer.js index a9f7c2d8ed8..e503e105d01 100644 --- a/Source/Renderer/Renderbuffer.js +++ b/Source/Renderer/Renderbuffer.js @@ -87,7 +87,7 @@ define([ * @exception {DeveloperError} This shader renderbuffer destroyed, i.e., destroy() was called. * * @see Renderbuffer.isDestroyed - * @see glDeleteRenderbuffers + * @see glDeleteRenderbuffers * * @example * renderbuffer = renderbuffer && renderbuffer.destroy(); diff --git a/Source/Renderer/RenderbufferFormat.js b/Source/Renderer/RenderbufferFormat.js index 5b0d4e58e4f..8543b90a6f2 100644 --- a/Source/Renderer/RenderbufferFormat.js +++ b/Source/Renderer/RenderbufferFormat.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RGBA4 : new Enumeration(0x8056, "RGBA4"), + RGBA4 : new Enumeration(0x8056, 'RGBA4'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RGB5_A1 : new Enumeration(0x8057, "RGB5_A1"), + RGB5_A1 : new Enumeration(0x8057, 'RGB5_A1'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RGB565 : new Enumeration(0x8D62, "RGB565"), + RGB565 : new Enumeration(0x8D62, 'RGB565'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DEPTH_COMPONENT16 : new Enumeration(0x81A5, "DEPTH_COMPONENT16"), + DEPTH_COMPONENT16 : new Enumeration(0x81A5, 'DEPTH_COMPONENT16'), /** * DOC_TBA @@ -46,7 +46,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - STENCIL_INDEX8 : new Enumeration(0x8D48, "STENCIL_INDEX8"), + STENCIL_INDEX8 : new Enumeration(0x8D48, 'STENCIL_INDEX8'), /** * DOC_TBA @@ -54,7 +54,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DEPTH_STENCIL : new Enumeration(0x84F9, "DEPTH_STENCIL"), + DEPTH_STENCIL : new Enumeration(0x84F9, 'DEPTH_STENCIL'), /** * DOC_TBA diff --git a/Source/Renderer/ShaderProgram.js b/Source/Renderer/ShaderProgram.js index e34dedd6ec6..2fbf09ef08c 100644 --- a/Source/Renderer/ShaderProgram.js +++ b/Source/Renderer/ShaderProgram.js @@ -87,7 +87,7 @@ define([ return UniformDatatype.SAMPLER_CUBE; }; default: - throw new RuntimeError("Unrecognized uniform type: " + activeUniformType); + throw new RuntimeError('Unrecognized uniform type: ' + activeUniformType); } } @@ -105,7 +105,7 @@ define([ * The datatype of the value property depends on the datatype * used in the GLSL declaration as shown in the examples in the table below. *

- * + *
* * * @@ -202,15 +202,15 @@ define([ * // Example 1. Create a shader program and set its * // one uniform, a 4x4 matrix, to the identity matrix * var vs = - * "attribute vec4 position; " + - * "uniform mat4 u_mvp; " + - * "void main() { gl_Position = u_mvp * position; }"; + * 'attribute vec4 position; ' + + * 'uniform mat4 u_mvp; ' + + * 'void main() { gl_Position = u_mvp * position; }'; * var fs = // ... * var sp = context.createShaderProgram(vs, fs); * * var mvp = sp.getAllUniforms().u_mvp; - * console.log(mvp.getName()); // "u_mvp" - * console.log(mvp.getDatatype().name); // "FLOAT_MATRIX4" + * console.log(mvp.getName()); // 'u_mvp' + * console.log(mvp.getDatatype().name); // 'FLOAT_MATRIX4' * mvp.value = Matrix4.IDENTITY; * * ////////////////////////////////////////////////////////////////////// @@ -229,8 +229,8 @@ define([ * * // Example 3. Setting values for members of a GLSL struct * // GLSL: uniform struct { float f; vec4 v; } u_struct; - * sp.getAllUniforms()["u_struct.f"].value = 1.0; - * sp.getAllUniforms()["u_struct.v"].value = new Cartesian4(1.0, 2.0, 3.0, 4.0); + * sp.getAllUniforms()['u_struct.f'].value = 1.0; + * sp.getAllUniforms()['u_struct.v'].value = new Cartesian4(1.0, 2.0, 3.0, 4.0); */ function Uniform(_gl, activeUniform, _uniformName, _location, uniformValue) { /** @@ -266,8 +266,8 @@ define([ * ]; * * // GLSL: uniform struct { float f; vec4 v; } u_struct; - * sp.getAllUniforms()["u_struct.f"].value = 1.0; - * sp.getAllUniforms()["u_struct.v"].value = new Cartesian4(1.0, 2.0, 3.0, 4.0); + * sp.getAllUniforms()['u_struct.f'].value = 1.0; + * sp.getAllUniforms()['u_struct.v'].value = new Cartesian4(1.0, 2.0, 3.0, 4.0); */ this.value = uniformValue; @@ -280,7 +280,7 @@ define([ * * @example * // GLSL: uniform mat4 u_mvp; - * console.log(sp.getAllUniforms().u_mvp.getName()); // "u_mvp" + * console.log(sp.getAllUniforms().u_mvp.getName()); // 'u_mvp' */ this.getName = function() { return _uniformName; @@ -298,7 +298,7 @@ define([ * * @example * // GLSL: uniform mat4 u_mvp; - * console.log(sp.getAllUniforms().u_mvp.getDatatype().name); // "FLOAT_MATRIX4" + * console.log(sp.getAllUniforms().u_mvp.getDatatype().name); // 'FLOAT_MATRIX4' */ this.getDatatype = getUniformDatatype(_gl, activeUniform.type); @@ -326,12 +326,12 @@ define([ return function() { var v = this.value; - if (typeof v.red !== "undefined") { + if (typeof v.red !== 'undefined') { _gl.uniform4f(_location, v.red, v.green, v.blue, v.alpha); - } else if (typeof v.x !== "undefined") { + } else if (typeof v.x !== 'undefined') { _gl.uniform4f(_location, v.x, v.y, v.z, v.w); } else { - throw new DeveloperError("Invalid vec4 value."); + throw new DeveloperError('Invalid vec4 value.'); } }; case _gl.SAMPLER_2D: @@ -374,7 +374,7 @@ define([ _gl.uniformMatrix4fv(_location, false, this.value.values); }; default: - throw new RuntimeError("Unrecognized uniform type: " + activeUniform.type); + throw new RuntimeError('Unrecognized uniform type: ' + activeUniform.type); } }(); @@ -447,12 +447,12 @@ define([ for ( var i = 0; i < _locations.length; ++i) { var v = this.value[i]; - if (typeof v.red !== "undefined") { + if (typeof v.red !== 'undefined') { _gl.uniform4f(_locations[i], v.red, v.green, v.blue, v.alpha); - } else if (typeof v.x !== "undefined") { + } else if (typeof v.x !== 'undefined') { _gl.uniform4f(_locations[i], v.x, v.y, v.z, v.w); } else { - throw new DeveloperError("Invalid vec4 value."); + throw new DeveloperError('Invalid vec4 value.'); } } }; @@ -510,7 +510,7 @@ define([ } }; default: - throw new RuntimeError("Unrecognized uniform type: " + activeUniform.type); + throw new RuntimeError('Unrecognized uniform type: ' + activeUniform.type); } }(); @@ -1414,9 +1414,9 @@ define([ function extractShaderVersion(source) { // This will fail if the first #version is actually in a comment. - var index = source.indexOf("#version"); + var index = source.indexOf('#version'); if (index !== -1) { - var newLineIndex = source.indexOf("\n", index); + var newLineIndex = source.indexOf('\n', index); // We could throw an exception if there is not a new line after // #version, but the GLSL compiler will catch it. @@ -1428,7 +1428,7 @@ define([ // are not off by one. There can be only one #version directive // and it must appear at the top of the source, only preceded by // whitespace and comments. - var modified = source.substring(0, index) + "//" + source.substring(index); + var modified = source.substring(0, index) + '//' + source.substring(index); return { versionDirective : version, @@ -1438,20 +1438,20 @@ define([ } return { - versionDirective : "", // defaults to #version 100 + versionDirective : '', // defaults to #version 100 modifiedSource : source // no modifications required }; } function getAutomaticUniformDeclaration(uniforms, uniform) { var factory = uniforms[uniform]; - var declaration = "uniform " + factory.getDatatype().getGLSL() + " " + uniform; + var declaration = 'uniform ' + factory.getDatatype().getGLSL() + ' ' + uniform; var size = factory.getSize(); if (size === 1) { - declaration += ";"; + declaration += ';'; } else { - declaration += "[" + size.toString() + "];"; + declaration += '[' + size.toString() + '];'; } return declaration; @@ -1474,9 +1474,9 @@ define([ if (index !== -1) { modifiedSource = modifiedSource.substring(0, index) + - "/*" + + '/*' + modifiedSource.substring(index, declaration.length) + - "*/" + + '*/' + modifiedSource.substring(index + declaration.length); } } @@ -1487,11 +1487,11 @@ define([ function getFragmentShaderPrecision() { // TODO: Performance? - return "#ifdef GL_FRAGMENT_PRECISION_HIGH \n" + - " precision highp float; \n" + - "#else \n" + - " precision mediump float; \n" + - "#endif \n\n"; + return '#ifdef GL_FRAGMENT_PRECISION_HIGH \n' + + ' precision highp float; \n' + + '#else \n' + + ' precision mediump float; \n' + + '#endif \n\n'; } function getBuiltinConstants() { @@ -1684,27 +1684,27 @@ define([ agi_degreesPerRadian : CesiumMath.DEGREES_PER_RADIAN.toString() }; - var glslConstants = ""; + var glslConstants = ''; for ( var name in constants) { if (constants.hasOwnProperty(name)) { - glslConstants += "const float " + name + " = " + constants[name] + "; \n"; + glslConstants += 'const float ' + name + ' = ' + constants[name] + '; \n'; } } - glslConstants += " \n"; + glslConstants += ' \n'; return glslConstants; } function getAutomaticUniforms() { - var automatics = ""; + var automatics = ''; var uniforms = getAllAutomaticUniforms(); for ( var uniform in uniforms) { if (uniforms.hasOwnProperty(uniform)) { - automatics += getAutomaticUniformDeclaration(uniforms, uniform) + " \n"; + automatics += getAutomaticUniformDeclaration(uniforms, uniform) + ' \n'; } } - automatics += "\n"; + automatics += '\n'; return automatics; } @@ -1720,8 +1720,8 @@ define([ // Functions after constants and uniforms because functions depend on them. var definitions = getBuiltinConstants() + getAutomaticUniforms() + - builtInGlslFunctions + "\n\n" + - "#line 0 \n"; + builtInGlslFunctions + '\n\n' + + '#line 0 \n'; getShaderDefinitions = function() { return definitions; @@ -1748,13 +1748,13 @@ define([ var vsLog = gl.getShaderInfoLog(vertexShader); if (logShaderCompilation && vsLog && vsLog.length) { - console.log("[GL] Vertex shader compile log: " + vsLog); + console.log('[GL] Vertex shader compile log: ' + vsLog); } if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) { gl.deleteShader(vertexShader); - console.error("[GL] Vertex shader compile log: " + vsLog); - throw new RuntimeError("Vertex shader failed to compile. Compile log: " + vsLog); + console.error('[GL] Vertex shader compile log: ' + vsLog); + throw new RuntimeError('Vertex shader failed to compile. Compile log: ' + vsLog); } var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); @@ -1763,14 +1763,14 @@ define([ var fsLog = gl.getShaderInfoLog(fragmentShader); if (logShaderCompilation && fsLog && fsLog.length) { - console.log("[GL] Fragment shader compile log: " + fsLog); + console.log('[GL] Fragment shader compile log: ' + fsLog); } if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) { gl.deleteShader(vertexShader); gl.deleteShader(fragmentShader); - console.error("[GL] Fragment shader compile log: " + fsLog); - throw new RuntimeError("Fragment shader failed to compile. Compile log: " + fsLog); + console.error('[GL] Fragment shader compile log: ' + fsLog); + throw new RuntimeError('Fragment shader failed to compile. Compile log: ' + fsLog); } var program = gl.createProgram(); @@ -1792,13 +1792,13 @@ define([ var linkLog = gl.getProgramInfoLog(program); if (logShaderCompilation && linkLog && linkLog.length) { - console.log("[GL] Shader program link log: " + linkLog); + console.log('[GL] Shader program link log: ' + linkLog); } if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { gl.deleteProgram(program); - console.error("[GL] Shader program link log: " + linkLog); - throw new RuntimeError("Program failed to link. Link log: " + linkLog); + console.error('[GL] Shader program link log: ' + linkLog); + throw new RuntimeError('Program failed to link. Link log: ' + linkLog); } return program; @@ -1829,12 +1829,12 @@ define([ for ( var i = 0; i < numberOfUniforms; ++i) { var activeUniform = gl.getActiveUniform(program, i); - var suffix = "[0]"; + var suffix = '[0]'; var uniformName = activeUniform.name.indexOf(suffix, activeUniform.name.length - suffix.length) !== -1 ? activeUniform.name.slice(0, activeUniform.name.length - 3) : activeUniform.name; // Ignore GLSL built-in uniforms returned in Firefox. - if (uniformName.indexOf("gl_") !== 0) { + if (uniformName.indexOf('gl_') !== 0) { if (activeUniform.size === 1) { // Single uniform var location = gl.getUniformLocation(program, uniformName); @@ -1853,7 +1853,7 @@ define([ var locations = []; var value = []; for ( var j = 0; j < activeUniform.size; ++j) { - var loc = gl.getUniformLocation(program, uniformName + "[" + j + "]"); + var loc = gl.getUniformLocation(program, uniformName + '[' + j + ']'); locations.push(loc); value.push(gl.getUniform(program, loc)); } @@ -2035,8 +2035,8 @@ define([ * @exception {DeveloperError} This shader program was destroyed, i.e., destroy() was called. * * @see ShaderProgram.isDestroyed - * @see glDeleteShader - * @see glDeleteProgram + * @see glDeleteShader + * @see glDeleteProgram * * @example * shaderProgram = shaderProgram && shaderProgram.destroy(); diff --git a/Source/Renderer/StencilFunction.js b/Source/Renderer/StencilFunction.js index 872d05af53e..83797d79e07 100644 --- a/Source/Renderer/StencilFunction.js +++ b/Source/Renderer/StencilFunction.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NEVER : new Enumeration(0x0200, "NEVER"), + NEVER : new Enumeration(0x0200, 'NEVER'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LESS : new Enumeration(0x0201, "LESS"), + LESS : new Enumeration(0x0201, 'LESS'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - EQUAL : new Enumeration(0x0202, "EQUAL"), + EQUAL : new Enumeration(0x0202, 'EQUAL'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LESS_OR_EQUAL : new Enumeration(0x0203, "LESS_OR_EQUAL"), // WebGL: LEQUAL + LESS_OR_EQUAL : new Enumeration(0x0203, 'LESS_OR_EQUAL'), // WebGL: LEQUAL /** * DOC_TBA @@ -46,7 +46,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - GREATER : new Enumeration(0x0204, "GREATER"), + GREATER : new Enumeration(0x0204, 'GREATER'), /** * DOC_TBA @@ -54,7 +54,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NOT_EQUAL : new Enumeration(0x0205, "NOT_EQUAL"), // WebGL: NOTEQUAL + NOT_EQUAL : new Enumeration(0x0205, 'NOT_EQUAL'), // WebGL: NOTEQUAL /** * DOC_TBA @@ -62,7 +62,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - GREATER_OR_EQUAL : new Enumeration(0x0206, "GREATER_OR_EQUAL"), // WebGL: GEQUAL + GREATER_OR_EQUAL : new Enumeration(0x0206, 'GREATER_OR_EQUAL'), // WebGL: GEQUAL /** * DOC_TBA @@ -70,7 +70,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ALWAYS : new Enumeration(0x0207, "ALWAYS"), + ALWAYS : new Enumeration(0x0207, 'ALWAYS'), /** * DOC_TBA diff --git a/Source/Renderer/StencilOperation.js b/Source/Renderer/StencilOperation.js index 9f8f6a949c3..f75ad4ab212 100644 --- a/Source/Renderer/StencilOperation.js +++ b/Source/Renderer/StencilOperation.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ZERO : new Enumeration(0, "ZERO"), + ZERO : new Enumeration(0, 'ZERO'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - KEEP : new Enumeration(0x1E00, "KEEP"), + KEEP : new Enumeration(0x1E00, 'KEEP'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - REPLACE : new Enumeration(0x1E01, "REPLACE"), + REPLACE : new Enumeration(0x1E01, 'REPLACE'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INCREMENT : new Enumeration(0x1E02, "INCREMENT"), // WebGL: INCR + INCREMENT : new Enumeration(0x1E02, 'INCREMENT'), // WebGL: INCR /** * DOC_TBA @@ -46,7 +46,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DECREMENT : new Enumeration(0x1E03, "DECREMENT"), // WebGL: DECR + DECREMENT : new Enumeration(0x1E03, 'DECREMENT'), // WebGL: DECR /** * DOC_TBA @@ -54,7 +54,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INVERT : new Enumeration(0x150A, "INVERT"), + INVERT : new Enumeration(0x150A, 'INVERT'), /** * DOC_TBA @@ -62,7 +62,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INCREMENT_WRAP : new Enumeration(0x8507, "INCREMENT_WRAP"), // WebGL: INCR_WRAP + INCREMENT_WRAP : new Enumeration(0x8507, 'INCREMENT_WRAP'), // WebGL: INCR_WRAP /** * DOC_TBA @@ -70,7 +70,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - DECREMENT_WRAP : new Enumeration(0x8508, "DECREMENT_WRAP"), // WebGL: DECR_WRAP + DECREMENT_WRAP : new Enumeration(0x8508, 'DECREMENT_WRAP'), // WebGL: DECR_WRAP /** * DOC_TBA diff --git a/Source/Renderer/Texture.js b/Source/Renderer/Texture.js index 8c4d339d9ad..90c4a162c1c 100644 --- a/Source/Renderer/Texture.js +++ b/Source/Renderer/Texture.js @@ -60,7 +60,7 @@ define([ */ Texture.prototype.copyFrom = function(source, xOffset, yOffset) { if (!source) { - throw new DeveloperError("source is required."); + throw new DeveloperError('source is required.'); } xOffset = xOffset || 0; @@ -70,19 +70,19 @@ define([ var height = source.height; if (xOffset < 0) { - throw new DeveloperError("xOffset must be greater than or equal to zero."); + throw new DeveloperError('xOffset must be greater than or equal to zero.'); } if (yOffset < 0) { - throw new DeveloperError("yOffset must be greater than or equal to zero."); + throw new DeveloperError('yOffset must be greater than or equal to zero.'); } if (xOffset + width > this._width) { - throw new DeveloperError("xOffset + source.width must be less than or equal to getWidth()."); + throw new DeveloperError('xOffset + source.width must be less than or equal to getWidth().'); } if (yOffset + height > this._height) { - throw new DeveloperError("yOffset + source.height must be less than or equal to getHeight()."); + throw new DeveloperError('yOffset + source.height must be less than or equal to getHeight().'); } var gl = this._gl; @@ -133,27 +133,27 @@ define([ height = height || this._height; if (xOffset < 0) { - throw new DeveloperError("xOffset must be greater than or equal to zero."); + throw new DeveloperError('xOffset must be greater than or equal to zero.'); } if (yOffset < 0) { - throw new DeveloperError("yOffset must be greater than or equal to zero."); + throw new DeveloperError('yOffset must be greater than or equal to zero.'); } if (framebufferXOffset < 0) { - throw new DeveloperError("framebufferXOffset must be greater than or equal to zero."); + throw new DeveloperError('framebufferXOffset must be greater than or equal to zero.'); } if (framebufferYOffset < 0) { - throw new DeveloperError("framebufferYOffset must be greater than or equal to zero."); + throw new DeveloperError('framebufferYOffset must be greater than or equal to zero.'); } if (xOffset + width > this._width) { - throw new DeveloperError("xOffset + source.width must be less than or equal to getWidth()."); + throw new DeveloperError('xOffset + source.width must be less than or equal to getWidth().'); } if (yOffset + height > this._height) { - throw new DeveloperError("yOffset + source.height must be less than or equal to getHeight()."); + throw new DeveloperError('yOffset + source.height must be less than or equal to getHeight().'); } var gl = this._gl; @@ -179,14 +179,14 @@ define([ */ Texture.prototype.generateMipmap = function(hint) { if ((this._width > 1) && (this._width % 2 !== 0)) { - throw new DeveloperError("This texture's width must be a power of two to call generateMipmap()."); + throw new DeveloperError('width must be a power of two to call generateMipmap().'); } else if ((this._height > 1) && (this._height % 2 !== 0)) { - throw new DeveloperError("This texture's height must be a power of two to call generateMipmap()."); + throw new DeveloperError('height must be a power of two to call generateMipmap().'); } hint = hint || MipmapHint.DONT_CARE; if (!MipmapHint.validate(hint)) { - throw new DeveloperError("hint is invalid."); + throw new DeveloperError('hint is invalid.'); } var gl = this._gl; @@ -342,7 +342,7 @@ define([ * @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called. * * @see Texture.isDestroyed - * @see glDeleteTextures + * @see glDeleteTextures * * @example * texture = texture && texture.destroy(); diff --git a/Source/Renderer/TextureAtlas.js b/Source/Renderer/TextureAtlas.js index a9415980e94..59b5c358eb6 100644 --- a/Source/Renderer/TextureAtlas.js +++ b/Source/Renderer/TextureAtlas.js @@ -29,18 +29,18 @@ define([ */ function TextureAtlas(context, images, pixelFormat, borderWidthInPixels) { if (!context) { - throw new DeveloperError("context is required."); + throw new DeveloperError('context is required.'); } if (!images || (images.length < 1)) { - throw new DeveloperError("images is required and must have length greater than zero."); + throw new DeveloperError('images is required and must have length greater than zero.'); } - pixelFormat = (typeof pixelFormat === "undefined") ? PixelFormat.RGBA : pixelFormat; - borderWidthInPixels = (typeof borderWidthInPixels === "undefined") ? 1 : borderWidthInPixels; + pixelFormat = (typeof pixelFormat === 'undefined') ? PixelFormat.RGBA : pixelFormat; + borderWidthInPixels = (typeof borderWidthInPixels === 'undefined') ? 1 : borderWidthInPixels; if (borderWidthInPixels < 0) { - throw new DeveloperError("borderWidthInPixels must be greater than or equal to zero."); + throw new DeveloperError('borderWidthInPixels must be greater than or equal to zero.'); } var annotatedImages = []; @@ -152,7 +152,7 @@ define([ var numSubRegions = subRegions.length; if ((index < 0) || (index >= numTextureCoordinates)) { - throw new DeveloperError("invalid image index."); + throw new DeveloperError('invalid image index.'); } var baseRegion = this._textureCoordinates[index]; diff --git a/Source/Renderer/TextureMagnificationFilter.js b/Source/Renderer/TextureMagnificationFilter.js index 57d317d570d..559dba51fbd 100644 --- a/Source/Renderer/TextureMagnificationFilter.js +++ b/Source/Renderer/TextureMagnificationFilter.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NEAREST : new Enumeration(0x2600, "NEAREST"), + NEAREST : new Enumeration(0x2600, 'NEAREST'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LINEAR : new Enumeration(0x2601, "LINEAR"), + LINEAR : new Enumeration(0x2601, 'LINEAR'), /** * DOC_TBA diff --git a/Source/Renderer/TextureMinificationFilter.js b/Source/Renderer/TextureMinificationFilter.js index feca2e00d70..b7491a6f6cd 100644 --- a/Source/Renderer/TextureMinificationFilter.js +++ b/Source/Renderer/TextureMinificationFilter.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NEAREST : new Enumeration(0x2600, "NEAREST"), + NEAREST : new Enumeration(0x2600, 'NEAREST'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LINEAR : new Enumeration(0x2601, "LINEAR"), + LINEAR : new Enumeration(0x2601, 'LINEAR'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NEAREST_MIPMAP_NEAREST : new Enumeration(0x2700, "NEAREST_MIPMAP_NEAREST"), + NEAREST_MIPMAP_NEAREST : new Enumeration(0x2700, 'NEAREST_MIPMAP_NEAREST'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LINEAR_MIPMAP_NEAREST : new Enumeration(0x2701, "LINEAR_MIPMAP_NEAREST"), + LINEAR_MIPMAP_NEAREST : new Enumeration(0x2701, 'LINEAR_MIPMAP_NEAREST'), /** * DOC_TBA @@ -46,7 +46,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - NEAREST_MIPMAP_LINEAR : new Enumeration(0x2702, "NEAREST_MIPMAP_LINEAR"), + NEAREST_MIPMAP_LINEAR : new Enumeration(0x2702, 'NEAREST_MIPMAP_LINEAR'), /** * DOC_TBA @@ -54,7 +54,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LINEAR_MIPMAP_LINEAR : new Enumeration(0x2703, "LINEAR_MIPMAP_LINEAR"), + LINEAR_MIPMAP_LINEAR : new Enumeration(0x2703, 'LINEAR_MIPMAP_LINEAR'), /** * DOC_TBA diff --git a/Source/Renderer/TextureWrap.js b/Source/Renderer/TextureWrap.js index 560644c20d6..796c1f0957f 100644 --- a/Source/Renderer/TextureWrap.js +++ b/Source/Renderer/TextureWrap.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CLAMP : new Enumeration(0x812F, "CLAMP"), + CLAMP : new Enumeration(0x812F, 'CLAMP'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - REPEAT : new Enumeration(0x2901, "REPEAT"), + REPEAT : new Enumeration(0x2901, 'REPEAT'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MIRRORED_REPEAT : new Enumeration(0x8370, "MIRRORED_REPEAT"), + MIRRORED_REPEAT : new Enumeration(0x8370, 'MIRRORED_REPEAT'), /** * DOC_TBA diff --git a/Source/Renderer/UniformDatatype.js b/Source/Renderer/UniformDatatype.js index 7a87e517d63..30bd7911383 100644 --- a/Source/Renderer/UniformDatatype.js +++ b/Source/Renderer/UniformDatatype.js @@ -15,9 +15,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT : new Enumeration(0x1406, "FLOAT", { + FLOAT : new Enumeration(0x1406, 'FLOAT', { getGLSL : function() { - return "float"; + return 'float'; } }), // FLOAT @@ -27,9 +27,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT_VECTOR2 : new Enumeration(0x8B50, "FLOAT_VECTOR2", { + FLOAT_VECTOR2 : new Enumeration(0x8B50, 'FLOAT_VECTOR2', { getGLSL : function() { - return "vec2"; + return 'vec2'; } }), // FLOAT_VEC2 @@ -39,9 +39,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT_VECTOR3 : new Enumeration(0x8B51, "FLOAT_VECTOR3", { + FLOAT_VECTOR3 : new Enumeration(0x8B51, 'FLOAT_VECTOR3', { getGLSL : function() { - return "vec3"; + return 'vec3'; } }), // FLOAT_VEC3 @@ -51,9 +51,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT_VECTOR4 : new Enumeration(0x8B52, "FLOAT_VECTOR4", { + FLOAT_VECTOR4 : new Enumeration(0x8B52, 'FLOAT_VECTOR4', { getGLSL : function() { - return "vec4"; + return 'vec4'; } }), // FLOAT_VEC4 @@ -63,9 +63,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INT : new Enumeration(0x1404, "INT", { + INT : new Enumeration(0x1404, 'INT', { getGLSL : function() { - return "int"; + return 'int'; } }), // INT @@ -75,9 +75,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INT_VECTOR2 : new Enumeration(0x8B53, "INT_VECTOR2", { + INT_VECTOR2 : new Enumeration(0x8B53, 'INT_VECTOR2', { getGLSL : function() { - return "ivec2"; + return 'ivec2'; } }), // INT_VEC2 @@ -87,9 +87,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INT_VECTOR3 : new Enumeration(0x8B54, "INT_VECTOR3", { + INT_VECTOR3 : new Enumeration(0x8B54, 'INT_VECTOR3', { getGLSL : function() { - return "ivec3"; + return 'ivec3'; } }), // INT_VEC3 @@ -99,9 +99,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INT_VECTOR4 : new Enumeration(0x8B55, "INT_VECTOR4", { + INT_VECTOR4 : new Enumeration(0x8B55, 'INT_VECTOR4', { getGLSL : function() { - return "ivec4"; + return 'ivec4'; } }), // INT_VEC4 @@ -111,9 +111,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - BOOL : new Enumeration(0x8B56, "BOOL", { + BOOL : new Enumeration(0x8B56, 'BOOL', { getGLSL : function() { - return "bool"; + return 'bool'; } }), // BOOL @@ -123,9 +123,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - BOOL_VECTOR2 : new Enumeration(0x8B57, "BOOL_VECTOR2", { + BOOL_VECTOR2 : new Enumeration(0x8B57, 'BOOL_VECTOR2', { getGLSL : function() { - return "bvec2"; + return 'bvec2'; } }), // BOOL_VEC2 @@ -135,9 +135,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - BOOL_VECTOR3 : new Enumeration(0x8B58, "BOOL_VECTOR3", { + BOOL_VECTOR3 : new Enumeration(0x8B58, 'BOOL_VECTOR3', { getGLSL : function() { - return "bvec3"; + return 'bvec3'; } }), // BOOL_VEC3 @@ -147,9 +147,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - BOOL_VECTOR4 : new Enumeration(0x8B59, "BOOL_VECTOR4", { + BOOL_VECTOR4 : new Enumeration(0x8B59, 'BOOL_VECTOR4', { getGLSL : function() { - return "bvec4"; + return 'bvec4'; } }), // BOOL_VEC4 @@ -159,9 +159,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT_MATRIX2 : new Enumeration(0x8B5A, "FLOAT_MATRIX2", { + FLOAT_MATRIX2 : new Enumeration(0x8B5A, 'FLOAT_MATRIX2', { getGLSL : function() { - return "mat2"; + return 'mat2'; } }), // FLOAT_MAT2 @@ -171,9 +171,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT_MATRIX3 : new Enumeration(0x8B5B, "FLOAT_MATRIX3", { + FLOAT_MATRIX3 : new Enumeration(0x8B5B, 'FLOAT_MATRIX3', { getGLSL : function() { - return "mat3"; + return 'mat3'; } }), // FLOAT_MAT3 @@ -183,9 +183,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FLOAT_MATRIX4 : new Enumeration(0x8B5C, "FLOAT_MATRIX4", { + FLOAT_MATRIX4 : new Enumeration(0x8B5C, 'FLOAT_MATRIX4', { getGLSL : function() { - return "mat4"; + return 'mat4'; } }), // FLOAT_MAT4 @@ -195,9 +195,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SAMPLER_2D : new Enumeration(0x8B5E, "SAMPLER_2D", { + SAMPLER_2D : new Enumeration(0x8B5E, 'SAMPLER_2D', { getGLSL : function() { - return "sampler2D"; + return 'sampler2D'; } }), // SAMPLER_2D @@ -207,9 +207,9 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SAMPLER_CUBE : new Enumeration(0x8B60, "SAMPLER_CUBE", { + SAMPLER_CUBE : new Enumeration(0x8B60, 'SAMPLER_CUBE', { getGLSL : function() { - return "samplerCube"; + return 'samplerCube'; } }) // SAMPLER_CUBE }; diff --git a/Source/Renderer/UniformState.js b/Source/Renderer/UniformState.js index f613baef8f6..33c498ad9f7 100644 --- a/Source/Renderer/UniformState.js +++ b/Source/Renderer/UniformState.js @@ -479,7 +479,7 @@ define([ */ UniformState.prototype.setSunPosition = function(sunPosition) { if (!sunPosition) { - throw new DeveloperError("sunPosition is required."); + throw new DeveloperError('sunPosition is required.'); } this._sunPosition = sunPosition; diff --git a/Source/Renderer/VertexArray.js b/Source/Renderer/VertexArray.js index b05f458e118..99d27a4a175 100644 --- a/Source/Renderer/VertexArray.js +++ b/Source/Renderer/VertexArray.js @@ -39,7 +39,7 @@ define([ for ( var j = 0; j < this._attributes.length; ++j) { var index = this._attributes[j].index; if (uniqueIndices[index]) { - throw new DeveloperError("Index " + index + " is used by more than one attribute."); + throw new DeveloperError('Index ' + index + ' is used by more than one attribute.'); } uniqueIndices[index] = true; @@ -48,11 +48,11 @@ define([ VertexArray.prototype._addAttribute = function(attribute, index) { if (!attribute.vertexBuffer && !attribute.value) { - throw new DeveloperError("attribute must have a vertexBuffer or a value."); + throw new DeveloperError('attribute must have a vertexBuffer or a value.'); } if (attribute.vertexBuffer && attribute.value) { - throw new DeveloperError("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices."); + throw new DeveloperError('attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.'); } var componentsPerAttribute = attribute.value ? attribute.value.length : attribute.componentsPerAttribute; @@ -62,28 +62,28 @@ define([ (componentsPerAttribute !== 3) && (componentsPerAttribute !== 4)) { if (attribute.value) { - throw new DeveloperError("attribute.value.length must be in the range [1, 4]."); + throw new DeveloperError('attribute.value.length must be in the range [1, 4].'); } - throw new DeveloperError("attribute.componentsPerAttribute must be in the range [1, 4]."); + throw new DeveloperError('attribute.componentsPerAttribute must be in the range [1, 4].'); } if (attribute.componentDatatype) { var datatype = attribute.componentDatatype; if (!ComponentDatatype.validate(datatype)) { - throw new DeveloperError("attribute must have a valid componentDatatype or not specify it."); + throw new DeveloperError('attribute must have a valid componentDatatype or not specify it.'); } } if (attribute.strideInBytes && (attribute.strideInBytes > 255)) { // WebGL limit. Not in GL ES. - throw new DeveloperError("attribute must have a strideInBytes less than or equal to 255 or not specify it."); + throw new DeveloperError('attribute must have a strideInBytes less than or equal to 255 or not specify it.'); } // Shallow copy the attribute; we do not want to copy the vertex buffer. var attr = { - index : (typeof attribute.index === "undefined") ? index : attribute.index, - enabled : (typeof attribute.enabled === "undefined") ? true : attribute.enabled, + index : (typeof attribute.index === 'undefined') ? index : attribute.index, + enabled : (typeof attribute.enabled === 'undefined') ? true : attribute.enabled, vertexBuffer : attribute.vertexBuffer, value : attribute.value ? attribute.value.slice() : undefined, componentsPerAttribute : componentsPerAttribute, @@ -147,8 +147,8 @@ define([ * @exception {DeveloperError} This vertex array was destroyed, i.e., destroy() was called. */ VertexArray.prototype.getAttribute = function(index) { - if (typeof index === "undefined") { - throw new DeveloperError("index is required."); + if (typeof index === 'undefined') { + throw new DeveloperError('index is required.'); } return this._attributes[index]; @@ -180,10 +180,10 @@ define([ VertexArray.prototype.addAttribute = function(attribute) { if (attribute) { var attributes = this._attributes; - var index = (typeof attribute.index === "undefined") ? attributes.length : attribute.index; + var index = (typeof attribute.index === 'undefined') ? attributes.length : attribute.index; for ( var i = 0; i < attributes.length; ++i) { if (index === attributes[i].index) { - throw new DeveloperError("Index " + index + " is already in use."); + throw new DeveloperError('Index ' + index + ' is already in use.'); } } @@ -207,8 +207,8 @@ define([ */ VertexArray.prototype.removeAttribute = function(attribute) { if (attribute) { - if (typeof attribute.index === "undefined") { - throw new DeveloperError("Attribute must have an index."); + if (typeof attribute.index === 'undefined') { + throw new DeveloperError('Attribute must have an index.'); } var attributes = this._attributes; @@ -331,7 +331,7 @@ define([ * * @see VertexArray#isDestroyed * @see Buffer#getVertexArrayDestroyable - * @see glDeleteBuffers + * @see glDeleteBuffers * * @example * // Destroying the vertex array implicitly calls destroy for each of its vertex diff --git a/Source/Renderer/VertexArrayFacade.js b/Source/Renderer/VertexArrayFacade.js index d4663d68974..61711b8ae7b 100644 --- a/Source/Renderer/VertexArrayFacade.js +++ b/Source/Renderer/VertexArrayFacade.js @@ -27,11 +27,11 @@ define([ */ function VertexArrayFacade(context, attributes, sizeInVertices) { if (!context) { - throw new DeveloperError("context is required."); + throw new DeveloperError('context is required.'); } if (!attributes || (attributes.length === 0)) { - throw new DeveloperError("At least one attribute is required."); + throw new DeveloperError('At least one attribute is required.'); } var attrs = VertexArrayFacade._verifyAttributes(attributes); @@ -137,8 +137,8 @@ define([ var attribute = attributes[i]; var attr = { - index : (typeof attribute.index === "undefined") ? i : attribute.index, - enabled : (typeof attribute.enabled === "undefined") ? true : attribute.enabled, + index : (typeof attribute.index === 'undefined') ? i : attribute.index, + enabled : (typeof attribute.enabled === 'undefined') ? true : attribute.enabled, componentsPerAttribute : attribute.componentsPerAttribute, componentDatatype : attribute.componentDatatype || ComponentDatatype.FLOAT, normalize : attribute.normalize || false, @@ -150,16 +150,16 @@ define([ attrs.push(attr); if ((attr.componentsPerAttribute !== 1) && (attr.componentsPerAttribute !== 2) && (attr.componentsPerAttribute !== 3) && (attr.componentsPerAttribute !== 4)) { - throw new DeveloperError("attribute.componentsPerAttribute must be in the range [1, 4]."); + throw new DeveloperError('attribute.componentsPerAttribute must be in the range [1, 4].'); } var datatype = attr.componentDatatype; if (!ComponentDatatype.validate(datatype)) { - throw new DeveloperError("Attribute must have a valid componentDatatype or not specify it."); + throw new DeveloperError('Attribute must have a valid componentDatatype or not specify it.'); } if (!BufferUsage.validate(attr.usage)) { - throw new DeveloperError("Attribute must have a valid usage or not specify it."); + throw new DeveloperError('Attribute must have a valid usage or not specify it.'); } } @@ -168,7 +168,7 @@ define([ for ( var j = 0; j < attrs.length; ++j) { var index = attrs[j].index; if (uniqueIndices[index]) { - throw new DeveloperError("Index " + index + " is used by more than one attribute."); + throw new DeveloperError('Index ' + index + ' is used by more than one attribute.'); } uniqueIndices[index] = true; } @@ -409,11 +409,11 @@ define([ */ VertexArrayFacade.prototype.subCommit = function(offsetInVertices, lengthInVertices) { if (offsetInVertices < 0 || offsetInVertices >= this._size) { - throw new DeveloperError("offsetInVertices must be greater than or equal to zero and less than the vertex array's size."); + throw new DeveloperError('offsetInVertices must be greater than or equal to zero and less than the vertex array size.'); } if (offsetInVertices + lengthInVertices > this._size) { - throw new DeveloperError("offsetInVertices + lengthInVertices cannot exceed the vertex array's size."); + throw new DeveloperError('offsetInVertices + lengthInVertices cannot exceed the vertex array size.'); } this._subCommit(this._static, offsetInVertices, lengthInVertices); diff --git a/Source/Renderer/VertexLayout.js b/Source/Renderer/VertexLayout.js index b573db24e28..853e68181f4 100644 --- a/Source/Renderer/VertexLayout.js +++ b/Source/Renderer/VertexLayout.js @@ -19,7 +19,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SEPARATE : new Enumeration(0, "SEPARATE"), + SEPARATE : new Enumeration(0, 'SEPARATE'), /** * Each attribute will be interleaved in a single vertex buffer. This can have a slight * performance advantage over using a separate vertex buffer per attribute, but it requires @@ -29,7 +29,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - INTERLEAVED : new Enumeration(1, "INTERLEAVED"), + INTERLEAVED : new Enumeration(1, 'INTERLEAVED'), /** * DOC_TBA diff --git a/Source/Scene/AnimationCollection.js b/Source/Scene/AnimationCollection.js index 09879a01544..bcd73049ba1 100644 --- a/Source/Scene/AnimationCollection.js +++ b/Source/Scene/AnimationCollection.js @@ -24,9 +24,9 @@ define([ */ AnimationCollection.prototype.add = function(template) { var t = template || {}; - t.duration = (typeof t.duration === "undefined") ? 3000 : t.duration; - t.delayDuration = (typeof t.delayDuration === "undefined") ? 0 : t.delayDuration; - t.easingFunction = (typeof t.easingFunction === "undefined") ? Tween.Easing.Linear.EaseNone : t.easingFunction; + t.duration = (typeof t.duration === 'undefined') ? 3000 : t.duration; + t.delayDuration = (typeof t.delayDuration === 'undefined') ? 0 : t.delayDuration; + t.easingFunction = (typeof t.easingFunction === 'undefined') ? Tween.Easing.Linear.EaseNone : t.easingFunction; var value = clone(t.startValue); var tween = new Tween.Tween(value); @@ -54,32 +54,32 @@ define([ * @exception {DeveloperError} material has no properties with alpha components. */ AnimationCollection.prototype.addAlpha = function(material, start, stop, template) { - if (typeof material === "undefined") { - throw new DeveloperError("material is required."); + if (typeof material === 'undefined') { + throw new DeveloperError('material is required.'); } var properties = []; for ( var property in material) { if (material.hasOwnProperty(property) && - typeof material[property] !== "undefined" && - typeof material[property].alpha !== "undefined") { + typeof material[property] !== 'undefined' && + typeof material[property].alpha !== 'undefined') { properties.push(property); } } if (properties.length === 0) { - throw new DeveloperError("material has no properties with alpha components."); + throw new DeveloperError('material has no properties with alpha components.'); } // Default to fade in - start = (typeof start === "undefined") ? 0.0 : start; - stop = (typeof stop === "undefined") ? 1.0 : stop; + start = (typeof start === 'undefined') ? 0.0 : start; + stop = (typeof stop === 'undefined') ? 1.0 : stop; var t = template || {}; - t.duration = (typeof t.duration === "undefined") ? 3000 : t.duration; - t.delayDuration = (typeof t.delayDuration === "undefined") ? 0 : t.delayDuration; - t.easingFunction = (typeof t.easingFunction === "undefined") ? Tween.Easing.Linear.EaseNone : t.easingFunction; + t.duration = (typeof t.duration === 'undefined') ? 3000 : t.duration; + t.delayDuration = (typeof t.delayDuration === 'undefined') ? 0 : t.delayDuration; + t.easingFunction = (typeof t.easingFunction === 'undefined') ? Tween.Easing.Linear.EaseNone : t.easingFunction; var value = { alpha : start @@ -109,22 +109,22 @@ define([ * @memberof AnimationCollection */ AnimationCollection.prototype.addProperty = function(object, property, start, stop, template) { - if (typeof object === "undefined") { - throw new DeveloperError("object is required."); + if (typeof object === 'undefined') { + throw new DeveloperError('object is required.'); } - if (typeof property === "undefined") { - throw new DeveloperError("property is required."); + if (typeof property === 'undefined') { + throw new DeveloperError('property is required.'); } - if (typeof object[property] === "undefined") { - throw new DeveloperError("object must have the specified property."); + if (typeof object[property] === 'undefined') { + throw new DeveloperError('object must have the specified property.'); } var t = template || {}; - t.duration = (typeof t.duration === "undefined") ? 3000 : t.duration; - t.delayDuration = (typeof t.delayDuration === "undefined") ? 0 : t.delayDuration; - t.easingFunction = (typeof t.easingFunction === "undefined") ? Tween.Easing.Linear.EaseNone : t.easingFunction; + t.duration = (typeof t.duration === 'undefined') ? 3000 : t.duration; + t.delayDuration = (typeof t.delayDuration === 'undefined') ? 0 : t.delayDuration; + t.easingFunction = (typeof t.easingFunction === 'undefined') ? Tween.Easing.Linear.EaseNone : t.easingFunction; var value = { value : start @@ -154,18 +154,18 @@ define([ * @exception {DeveloperError} material must have an offset property. */ AnimationCollection.prototype.addOffsetIncrement = function(material, template) { - if (typeof material === "undefined") { - throw new DeveloperError("material is required."); + if (typeof material === 'undefined') { + throw new DeveloperError('material is required.'); } - if (typeof material.offset === "undefined") { - throw new DeveloperError("material must have an offset property."); + if (typeof material.offset === 'undefined') { + throw new DeveloperError('material must have an offset property.'); } var t = template || {}; - t.duration = (typeof t.duration === "undefined") ? 3000 : t.duration; - t.delayDuration = (typeof t.delayDuration === "undefined") ? 0 : t.delayDuration; - t.easingFunction = (typeof t.easingFunction === "undefined") ? Tween.Easing.Linear.EaseNone : t.easingFunction; + t.duration = (typeof t.duration === 'undefined') ? 3000 : t.duration; + t.delayDuration = (typeof t.delayDuration === 'undefined') ? 0 : t.delayDuration; + t.easingFunction = (typeof t.easingFunction === 'undefined') ? Tween.Easing.Linear.EaseNone : t.easingFunction; var value = { offset : material.offset diff --git a/Source/Scene/ArcGISTileProvider.js b/Source/Scene/ArcGISTileProvider.js index 8702f9f962f..25a1e37ffec 100644 --- a/Source/Scene/ArcGISTileProvider.js +++ b/Source/Scene/ArcGISTileProvider.js @@ -33,8 +33,8 @@ define([ * @see OpenStreetMapTileProvider * @see CompositeTileProvider * - * @see ArcGIS Server REST API - * @see Cross-Origin Resource Sharing + * @see ArcGIS Server REST API + * @see Cross-Origin Resource Sharing * * @example * // ArcGIS World Street Maps tile provider @@ -48,11 +48,11 @@ define([ var instance = desc.instance || 'arcgis/rest'; if (!desc.host) { - throw new DeveloperError("description.host is required."); + throw new DeveloperError('description.host is required.'); } if (!desc.service) { - throw new DeveloperError("description.service is required."); + throw new DeveloperError('description.service is required.'); } this._url = 'http://' + desc.host + '/' + instance + '/services/'; @@ -70,7 +70,7 @@ define([ this.host = desc.host; /** - * The instance name. The default value is "/arcgis/rest". + * The instance name. The default value is '/arcgis/rest'. * @type {String} */ this.instance = instance; @@ -147,12 +147,12 @@ define([ jsonp(this._url, function(data) { var credit = data.copyrightText; - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = 800.0; canvas.height = 20.0; - var context = canvas.getContext("2d"); - context.fillStyle = "#fff"; + var context = canvas.getContext('2d'); + context.fillStyle = '#fff'; context.font = '12px sans-serif'; context.textBaseline = 'top'; context.fillText(credit, 0, 0); @@ -181,7 +181,7 @@ define([ */ ArcGISTileProvider.prototype.loadTileImage = function(tile, onload, onerror) { if (tile.zoom < this.zoomMin || tile.zoom > this.zoomMax) { - throw new DeveloperError("tile.zoom must be between in [zoomMin, zoomMax]."); + throw new DeveloperError('tile.zoom must be between in [zoomMin, zoomMax].'); } var image = new Image(); diff --git a/Source/Scene/Billboard.js b/Source/Scene/Billboard.js index ef3a9e4c41c..c80c162d47f 100644 --- a/Source/Scene/Billboard.js +++ b/Source/Scene/Billboard.js @@ -24,8 +24,8 @@ define([ * properties can be changed at any time by calling the billboard's corresponding * set function, e.g., {@link Billboard#setShow}. *

- *
- *
+ *
+ *
* Example billboards *
* @@ -55,14 +55,14 @@ define([ var position = b.position ? new Cartesian3(b.position.x, b.position.y, b.position.z) : Cartesian3.ZERO.clone(); - this._show = (typeof b.show === "undefined") ? true : b.show; + this._show = (typeof b.show === 'undefined') ? true : b.show; this._position = position; this._actualPosition = position.clone(); // For columbus view and 2D this._pixelOffset = b.pixelOffset ? new Cartesian2(b.pixelOffset.x, b.pixelOffset.y) : Cartesian2.ZERO.clone(); this._eyeOffset = b.eyeOffset ? new Cartesian3(b.eyeOffset.x, b.eyeOffset.y, b.eyeOffset.z) : Cartesian3.ZERO.clone(); this._horizontalOrigin = b.horizontalOrigin || HorizontalOrigin.CENTER; this._verticalOrigin = b.verticalOrigin || VerticalOrigin.CENTER; - this._scale = (typeof b.scale === "undefined") ? 1.0 : b.scale; + this._scale = (typeof b.scale === 'undefined') ? 1.0 : b.scale; this._imageIndex = b.imageIndex || 0; this._color = { red : color.red, @@ -138,7 +138,7 @@ define([ * @see Billboard#getShow */ Billboard.prototype.setShow = function(value) { - if ((typeof value !== "undefined") && (this._show !== value)) { + if ((typeof value !== 'undefined') && (this._show !== value)) { this._show = value; this._makeDirty(SHOW_INDEX); } @@ -186,7 +186,7 @@ define([ Billboard.prototype.setPosition = function(value) { var p = this._position; - if ((typeof value !== "undefined") && ((p.x !== value.x) || (p.y !== value.y) || (p.z !== value.z))) { + if ((typeof value !== 'undefined') && ((p.x !== value.x) || (p.y !== value.y) || (p.z !== value.z))) { p.x = value.x; p.y = value.y; p.z = value.z; @@ -237,10 +237,10 @@ define([ * changing it after calling setPixelOffset does not affect the billboard's pixel * offset; an explicit call to setPixelOffset is required. *

- *
- *
GLSLJavaScript
- * - * + *
+ *
default
b.setPixelOffset({ x : 50, y : -25 });
+ * + * *
default
b.setPixelOffset({ x : 50, y : -25 });
* The billboard's origin is indicated by the yellow point. * @@ -255,7 +255,7 @@ define([ Billboard.prototype.setPixelOffset = function(value) { var p = this._pixelOffset; - if ((typeof value !== "undefined") && ((p.x !== value.x) || (p.y !== value.y))) { + if ((typeof value !== 'undefined') && ((p.x !== value.x) || (p.y !== value.y))) { p.x = value.x; p.y = value.y; this._makeDirty(PIXEL_OFFSET_INDEX); @@ -292,10 +292,10 @@ define([ * Below, the billboard is positioned at the center of the Earth but an eye offset makes it always * appear on top of the Earth regardless of the viewer's or Earth's orientation. *

- *

- * - * - * + *
+ *
+ * + * *
* b.setEyeOffset({ x : 0.0, y : 8000000.0, z : 0.0 });

*
@@ -309,7 +309,7 @@ define([ Billboard.prototype.setEyeOffset = function(value) { var e = this._eyeOffset; - if ((typeof value !== "undefined") && ((e.x !== value.x) || (e.y !== value.y) || (e.z !== value.z))) { + if ((typeof value !== 'undefined') && ((e.x !== value.x) || (e.y !== value.y) || (e.z !== value.z))) { e.x = value.x; e.y = value.y; e.z = value.z; @@ -334,8 +334,8 @@ define([ * Sets the horizontal origin of this billboard, which determines if the billboard is * to the left, center, or right of its position. *

- *
- *
+ *
+ *
*
* * @memberof Billboard @@ -351,7 +351,7 @@ define([ * b.setVerticalOrigin(VerticalOrigin.BOTTOM); */ Billboard.prototype.setHorizontalOrigin = function(value) { - if ((typeof value !== "undefined") && (this._horizontalOrigin !== value)) { + if ((typeof value !== 'undefined') && (this._horizontalOrigin !== value)) { this._horizontalOrigin = value; this._makeDirty(HORIZONTAL_ORIGIN_INDEX); } @@ -374,8 +374,8 @@ define([ * Sets the vertical origin of this billboard, which determines if the billboard is * to the above, below, or at the center of its position. *

- *
- *
+ *
+ *
*
* * @memberof Billboard @@ -391,7 +391,7 @@ define([ * b.setVerticalOrigin(VerticalOrigin.BOTTOM); */ Billboard.prototype.setVerticalOrigin = function(value) { - if ((typeof value !== "undefined") && (this._verticalOrigin !== value)) { + if ((typeof value !== 'undefined') && (this._verticalOrigin !== value)) { this._verticalOrigin = value; this._makeDirty(VERTICAL_ORIGIN_INDEX); } @@ -416,8 +416,8 @@ define([ * 1.0 enlarges the billboard; a positive scale less than 1.0 shrinks * the billboard. *

- *
- *
+ *
+ *
* From left to right in the above image, the scales are 0.5, 1.0, * and 2.0. *
@@ -430,7 +430,7 @@ define([ * @see Billboard#setImageIndex */ Billboard.prototype.setScale = function(value) { - if ((typeof value !== "undefined") && (this._scale !== value)) { + if ((typeof value !== 'undefined') && (this._scale !== value)) { this._scale = value; this._makeDirty(SCALE_INDEX); } @@ -457,7 +457,7 @@ define([ * @see BillboardCollection#setTextureAtlas */ Billboard.prototype.setImageIndex = function(value) { - if ((typeof value !== "undefined") && (this._imageIndex !== value)) { + if ((typeof value !== 'undefined') && (this._imageIndex !== value)) { this._imageIndex = value; this._makeDirty(IMAGE_INDEX_INDEX); } @@ -484,10 +484,10 @@ define([ * colored billboards. Second, the color's alpha component can be used to make the billboard translucent as shown below. * An alpha of 0.0 makes the billboard transparent, and 1.0 makes the billboard opaque. *

- *
- * - * - * + *
+ *
default
alpha : 0.5
+ * + * *
default
alpha : 0.5
*
*
@@ -522,7 +522,7 @@ define([ Billboard.prototype.setColor = function(value) { var c = this._color; - if ((typeof value !== "undefined") && + if ((typeof value !== 'undefined') && ((c.red !== value.red) || (c.green !== value.green) || (c.blue !== value.blue) || (c.alpha !== value.alpha))) { c.red = value.red; @@ -584,11 +584,11 @@ define([ */ Billboard.prototype.computeScreenSpacePosition = function(uniformState) { if (!this._collection) { - throw new DeveloperError("Billboard must be in a collection. Was it removed?"); + throw new DeveloperError('Billboard must be in a collection. Was it removed?'); } if (!uniformState) { - throw new DeveloperError("uniformState is required."); + throw new DeveloperError('uniformState is required.'); } return Billboard._computeScreenSpacePosition(this._collection.modelMatrix, this._actualPosition, this._eyeOffset, this._pixelOffset, uniformState); diff --git a/Source/Scene/BillboardCollection.js b/Source/Scene/BillboardCollection.js index 26571d5f571..279e5874c62 100644 --- a/Source/Scene/BillboardCollection.js +++ b/Source/Scene/BillboardCollection.js @@ -65,8 +65,8 @@ define([ * A renderable collection of billboards. Billboards are viewport-aligned * images positioned in the 3D scene. *

- *
- *
+ *
+ *
* Example billboards *
*

@@ -379,8 +379,8 @@ define([ * } */ BillboardCollection.prototype.get = function(index) { - if (typeof index === "undefined") { - throw new DeveloperError("index is required."); + if (typeof index === 'undefined') { + throw new DeveloperError('index is required.'); } this._removeBillboards(); @@ -1028,7 +1028,7 @@ define([ this._spPick = context.getShaderCache().getShaderProgram( BillboardCollectionVS, - "#define RENDER_FOR_PICK 1\n" + BillboardCollectionFS, + '#define RENDER_FOR_PICK 1\n' + BillboardCollectionFS, attributeIndices); this.updateForPick = function(context) { diff --git a/Source/Scene/BingMapsStyle.js b/Source/Scene/BingMapsStyle.js index 1d2a43d50eb..2a15f9b85a9 100644 --- a/Source/Scene/BingMapsStyle.js +++ b/Source/Scene/BingMapsStyle.js @@ -16,7 +16,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - AERIAL : new Enumeration(0, "AERIAL", { imagerySetName : "Aerial" }), + AERIAL : new Enumeration(0, 'AERIAL', { imagerySetName : 'Aerial' }), /** * Aerial imagery with a road overlay. @@ -24,7 +24,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - AERIAL_WITH_LABELS : new Enumeration(1, "AERIAL_WITH_LABELS", { imagerySetName : "AerialWithLabels" }), + AERIAL_WITH_LABELS : new Enumeration(1, 'AERIAL_WITH_LABELS', { imagerySetName : 'AerialWithLabels' }), /** * Roads without additional imagery. @@ -32,7 +32,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ROAD : new Enumeration(2, "ROAD", { imagerySetName : "Road" }), + ROAD : new Enumeration(2, 'ROAD', { imagerySetName : 'Road' }), /** * Ordnance Survey imagery @@ -40,7 +40,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ORDNANCE_SURVEY : new Enumeration(3, "ORDNANCE_SURVEY", { imagerySetName : "OrdnanceSurvey" }), + ORDNANCE_SURVEY : new Enumeration(3, 'ORDNANCE_SURVEY', { imagerySetName : 'OrdnanceSurvey' }), /** * Collins Bart imagery. @@ -48,7 +48,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - COLLINS_BART : new Enumeration(4, "COLLINS_BART", { imagerySetName : "CollinsBart" }) + COLLINS_BART : new Enumeration(4, 'COLLINS_BART', { imagerySetName : 'CollinsBart' }) }; return BingMapsStyle; diff --git a/Source/Scene/BingMapsTileProvider.js b/Source/Scene/BingMapsTileProvider.js index 7aca7c9216d..1139e634ce8 100644 --- a/Source/Scene/BingMapsTileProvider.js +++ b/Source/Scene/BingMapsTileProvider.js @@ -6,22 +6,22 @@ MICROSOFT LIMITED PUBLIC LICENSE - This license governs use of code marked as "sample" or "example" available on + This license governs use of code marked as 'sample' or 'example' available on this web site without a license agreement, as provided under the section above - titled "NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE." If you use - such code (the "software"), you accept this license. If you do not accept the + titled 'NOTICE SPECIFIC TO SOFTWARE AVAILABLE ON THIS WEB SITE.' If you use + such code (the 'software'), you accept this license. If you do not accept the license, do not use the software. 1. Definitions - The terms "reproduce," "reproduction," "derivative works," and "distribution" + The terms 'reproduce,' 'reproduction,' 'derivative works,' and 'distribution' have the same meaning here as under U.S. copyright law. - A "contribution" is the original software, or any additions or changes to the software. + A 'contribution' is the original software, or any additions or changes to the software. - A "contributor" is any person that distributes its contribution under this license. + A 'contributor' is any person that distributes its contribution under this license. - "Licensed patents" are a contributor's patent claims that read directly on its contribution. + 'Licensed patents' are a contributor's patent claims that read directly on its contribution. 2. Grant of Rights @@ -57,7 +57,7 @@ compiled or object code form, you may only do so under a license that complies with this license. - (E) The software is licensed "as-is." You bear the risk of using it. The + (E) The software is licensed 'as-is.' You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors @@ -92,7 +92,7 @@ define([ * @constructor * * @param {String} description.server The name of the Bing Maps server hosting the imagery. - * @param {String} [description.key] An optional Bing Maps key, which can be created at https://www.bingmapsportal.com/. + * @param {String} [description.key] An optional Bing Maps key, which can be created at https://www.bingmapsportal.com/. * @param {Enumeration} [description.mapStyle=BingMapsStyle.AERIAL] The type of Bing Maps imagery to load. * @param {Object} [description.proxy=undefined] A proxy to use for requests. This object is expected to have a getURL function which returns the proxied URL, if needed. * @@ -103,23 +103,23 @@ define([ * @see OpenStreetMapTileProvider * @see CompositeTileProvider * - * @see Bing Maps REST Services - * @see Cross-Origin Resource Sharing + * @see Bing Maps REST Services + * @see Cross-Origin Resource Sharing * * @example * // Bing Maps tile provider * var bing = new BingMapsTileProvider({ - * server : "dev.virtualearth.net", + * server : 'dev.virtualearth.net', * mapStyle : BingMapsStyle.AERIAL * }); */ function BingMapsTileProvider(description) { var desc = description || {}; - var key = desc.key || "AquXz3981-1ND5jGs8qQn7R7YUP8qkWi77yZSVM7o3nIvzb-Mg0W2Ta57xuUyywX"; + var key = desc.key || 'AquXz3981-1ND5jGs8qQn7R7YUP8qkWi77yZSVM7o3nIvzb-Mg0W2Ta57xuUyywX'; var mapStyle = desc.mapStyle || BingMapsStyle.AERIAL; if (typeof desc.server === 'undefined') { - throw new DeveloperError("description.server is required."); + throw new DeveloperError('description.server is required.'); } /** @@ -224,13 +224,13 @@ define([ * @param {Number} y The tile's y coordinate. * @param {Number} zoom The tile's zoom level. * - * @see Bing Maps Tile System + * @see Bing Maps Tile System * @see BingMapsTileProvider#quadKeyToTileXY */ BingMapsTileProvider.tileXYToQuadKey = function(x, y, zoom) { - var quadkey = ""; + var quadkey = ''; for ( var i = zoom; i > 0; --i) { - var digit = "0".charCodeAt(0); + var digit = '0'.charCodeAt(0); var mask = 1 << (i - 1); if ((x & mask) !== 0) { digit++; @@ -251,7 +251,7 @@ define([ * * @param {String} quadkey The tile's quad key * - * @see Bing Maps Tile System + * @see Bing Maps Tile System * @see BingMapsTileProvider#tileXYToQuadKey */ BingMapsTileProvider.quadKeyToTileXY = function(quadkey) { @@ -288,7 +288,7 @@ define([ var url = resource.imageUrl; url = url.replace('{subdomain}', resource.imageUrlSubdomains[0]); - url = url.replace('{culture}', ""); + url = url.replace('{culture}', ''); that._url = url; that.tileWidth = resource.imageWidth; @@ -301,7 +301,7 @@ define([ }); that._deferredQueue = []; }, { - callbackParameterName : "jsonp", + callbackParameterName : 'jsonp', proxy: this._proxy }); }; @@ -330,7 +330,7 @@ define([ } if (tile.zoom < this.zoomMin || tile.zoom > this.zoomMax) { - throw new DeveloperError("tile.zoom must be between in [zoomMin, zoomMax]."); + throw new DeveloperError('tile.zoom must be between in [zoomMin, zoomMax].'); } var image = new Image(); @@ -408,7 +408,7 @@ define([ centerPoint : lat + ',' + lon, zoomLevel : tile.zoom }, - callbackParameterName : "jsonp", + callbackParameterName : 'jsonp', proxy : this._proxy }); diff --git a/Source/Scene/BlobMaterial.js b/Source/Scene/BlobMaterial.js index 7ee5a2ad01c..853903abc22 100644 --- a/Source/Scene/BlobMaterial.js +++ b/Source/Scene/BlobMaterial.js @@ -58,9 +58,9 @@ define([ } BlobMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + + return '#line 0\n' + ShadersNoise + - "#line 0\n" + + '#line 0\n' + ShadersBlobMaterial; }; diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index 04164213d25..65a019e2bb0 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -56,7 +56,7 @@ define([ */ function Camera(canvas) { if (!canvas) { - throw new DeveloperError("canvas is required."); + throw new DeveloperError('canvas is required.'); } /** diff --git a/Source/Scene/Camera2DController.js b/Source/Scene/Camera2DController.js index ee6aa6d02fc..22e4d370c5a 100644 --- a/Source/Scene/Camera2DController.js +++ b/Source/Scene/Camera2DController.js @@ -207,7 +207,7 @@ define([ if (frustum.left === null || frustum.right === null || frustum.top === null || frustum.bottom === null) { - throw new DeveloperError("The camera frustum is expected to be orthographic for 2D camera control."); + throw new DeveloperError('The camera frustum is expected to be orthographic for 2D camera control.'); } var newRight = frustum.right - moveRate; @@ -279,7 +279,7 @@ define([ if (frustum.left === null || frustum.right === null || frustum.top === null || frustum.bottom === null) { - throw new DeveloperError("The camera frustum is expected to be orthographic for 2D camera control."); + throw new DeveloperError('The camera frustum is expected to be orthographic for 2D camera control.'); } var width = this._canvas.clientWidth; diff --git a/Source/Scene/CameraControllerCollection.js b/Source/Scene/CameraControllerCollection.js index 5cda31af9c9..9f0abfa3cc8 100644 --- a/Source/Scene/CameraControllerCollection.js +++ b/Source/Scene/CameraControllerCollection.js @@ -179,8 +179,8 @@ define([ * @see CameraControllerCollection#getLength */ CameraControllerCollection.prototype.get = function(index) { - if (typeof index === "undefined") { - throw new DeveloperError("index is required."); + if (typeof index === 'undefined') { + throw new DeveloperError('index is required.'); } return this._controllers[index]; diff --git a/Source/Scene/CameraEventHandler.js b/Source/Scene/CameraEventHandler.js index df9dbaad877..8c89efb7ba1 100644 --- a/Source/Scene/CameraEventHandler.js +++ b/Source/Scene/CameraEventHandler.js @@ -37,11 +37,11 @@ define([ */ function CameraEventHandler(canvas, moveType, moveModifier) { if (!canvas) { - throw new DeveloperError("description.canvas is required."); + throw new DeveloperError('description.canvas is required.'); } if (!moveType) { - throw new DeveloperError("moveType is required."); + throw new DeveloperError('moveType is required.'); } this._eventHandler = new EventHandler(canvas); @@ -78,7 +78,7 @@ define([ this._eventReleaseTimeFunc = this._eventHandler.getRightReleaseTime; } else { this._eventHandler = this._eventHandler && this._eventHandler.destroy(); - throw new DeveloperError("moveType must be of type CameraEventType."); + throw new DeveloperError('moveType must be of type CameraEventType.'); } this._eventHandler.setMouseAction(function(movement) { diff --git a/Source/Scene/CameraEventType.js b/Source/Scene/CameraEventType.js index 6d90b13563a..f7ee3118de9 100644 --- a/Source/Scene/CameraEventType.js +++ b/Source/Scene/CameraEventType.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - LEFT_DRAG : new Enumeration(0, "LEFT_DRAG"), + LEFT_DRAG : new Enumeration(0, 'LEFT_DRAG'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - RIGHT_DRAG : new Enumeration(1, "RIGHT_DRAG"), + RIGHT_DRAG : new Enumeration(1, 'RIGHT_DRAG'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MIDDLE_DRAG : new Enumeration(2, "MIDDLE_DRAG"), + MIDDLE_DRAG : new Enumeration(2, 'MIDDLE_DRAG'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - WHEEL : new Enumeration(3, "WHEEL") + WHEEL : new Enumeration(3, 'WHEEL') }; return CameraEventType; diff --git a/Source/Scene/CameraSpindleControllerMode.js b/Source/Scene/CameraSpindleControllerMode.js index aa0d1004014..861b944ee89 100644 --- a/Source/Scene/CameraSpindleControllerMode.js +++ b/Source/Scene/CameraSpindleControllerMode.js @@ -17,7 +17,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - ROTATE : new Enumeration(0, "ROTATE"), + ROTATE : new Enumeration(0, 'ROTATE'), /** * This mode will cause the controller to rotate around an ellipsoid such that @@ -27,7 +27,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - PAN : new Enumeration(1, "PAN"), + PAN : new Enumeration(1, 'PAN'), /** * This mode will choose the best mode for the mouse input. @@ -35,7 +35,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - AUTO : new Enumeration(2, "AUTO") + AUTO : new Enumeration(2, 'AUTO') }; return CameraSpindleControllerMode; diff --git a/Source/Scene/CentralBody.js b/Source/Scene/CentralBody.js index 493f1013f6d..09c8918eab5 100644 --- a/Source/Scene/CentralBody.js +++ b/Source/Scene/CentralBody.js @@ -112,14 +112,14 @@ define([ function TileTextureCachePolicy(description) { var desc = description || {}; - if (!desc.fetchFunc || typeof desc.fetchFunc !== "function") { - throw new DeveloperError("description.fetchFunc is a required function."); + if (!desc.fetchFunc || typeof desc.fetchFunc !== 'function') { + throw new DeveloperError('description.fetchFunc is a required function.'); } this._limit = desc.limit || 128; this._count = 0; this._fetchFunc = desc.fetchFunc; - this._removeFunc = (typeof desc.removeFunc === "function") ? desc.removeFunc : undefined; + this._removeFunc = (typeof desc.removeFunc === 'function') ? desc.removeFunc : undefined; } TileTextureCachePolicy.prototype.hit = function(object) { @@ -347,9 +347,9 @@ define([ * is true. *

* Example day image: - *
- * - * NASA Visible Earth. + *
+ * + * NASA Visible Earth. * Data courtesy Marc Imhoff of NASA GSFC and Christopher Elvidge of * NOAA NGDC. Image by Craig Mayhew and Robert Simmon, NASA GSFC. *
@@ -369,9 +369,9 @@ define([ * image is loaded and {@link CentralBody#showSpecular} is true. *

* Example specular map: - *
- * - * Planet Texture Maps + * * * @type {String} @@ -389,9 +389,9 @@ define([ * image is loaded and {@link CentralBody#showClouds} is true. *

* Example cloud map: - *
- * - * Planet Texture Maps + * * * @type {String} @@ -409,9 +409,9 @@ define([ * image is loaded and {@link CentralBody#showBumps} is true. *

* Example bump map: - *
- * - * Planet Texture Maps + * * * @type {String} @@ -425,8 +425,8 @@ define([ /** * When true, textures from the dayTileProvider are shown on the central body. *

- *
- * + *
+ * *
* * @type {Boolean} @@ -441,8 +441,8 @@ define([ * When true, the night texture is shown on the side of the central body not illuminated by the sun. * The day and night textures are blended across the terminator using {@link CentralBody#dayNightBlendDelta}. * When false, the day textures are shown on the entire globe (if enabled). - *
- * + *
+ * *
* * @type {Boolean} @@ -453,7 +453,7 @@ define([ * * @example * cb.showNight = true; - * cb.nightImageSource = "night.jpg"; + * cb.nightImageSource = 'night.jpg'; */ this.showNight = true; this._showNight = false; @@ -461,8 +461,8 @@ define([ /** * When true, diffuse-lit clouds are shown on the central body. When {@link CentralBody#showNight} * is also true, clouds on the dark side of the globe will fully or partially occlude the night texture. - *
- * + *
+ * *
* * @type {Boolean} @@ -473,7 +473,7 @@ define([ * * @example * cb.showClouds = true; - * cb.cloudsMapSource = "clouds.jpg"; + * cb.cloudsMapSource = 'clouds.jpg'; */ this.showClouds = true; this._showClouds = false; @@ -482,10 +482,10 @@ define([ * When true, clouds on the daytime side of the globe cast approximate shadows. The * shadows can be shown with or without the clouds themselves, which are controlled with * {@link CentralBody#showClouds}. - *
- * - * - * + *
+ *
true
false
+ * + * *
true
false
*
* @@ -497,17 +497,17 @@ define([ * @example * cb.showClouds = true; * cb.showCloudShadows = true; - * cb.cloudsMapSource = "clouds.jpg"; + * cb.cloudsMapSource = 'clouds.jpg'; */ this.showCloudShadows = true; this._showCloudShadows = false; /** * When true, a specular map (also called a gloss map) is used so only the ocean receives specular light. - *
- * - * - * + *
+ *
true
false
+ * + * *
true
false
*
* @@ -517,7 +517,7 @@ define([ * * @example * cb.showSpecular = true; - * cb.specularMapSource = "specular.jpg"; + * cb.specularMapSource = 'specular.jpg'; */ this.showSpecular = true; this._showSpecular = false; @@ -526,10 +526,10 @@ define([ * When true, a bump map is used to add lighting detail to the mountainous areas of the central body. * This gives the appearance of extra geometric complexity even though the central body is still a smooth ellipsoid. * The apparent steepness of the mountains is controlled by {@link CentralBody#bumpMapNormalZ}. - *
- * - * - * + *
+ *
true
false
+ * + * *
true
false
*
* @@ -540,15 +540,15 @@ define([ * * @example * cb.showBumps = true; - * cb.bumpMapSource = "bump.jpg"; + * cb.bumpMapSource = 'bump.jpg'; */ this.showBumps = true; this._showBumps = false; /** * When true, shows a line on the central body where day meets night. - *
- * + *
+ * *
* * @type {Boolean} @@ -563,10 +563,10 @@ define([ * When {@link CentralBody#showBumps} is true, bumpMapNormalZ controls the * apparent steepness of the mountains. A value less than one over-exaggerates the steepness; a value greater * than one under-exaggerates, making mountains less noticeable. - *
- * - * - * + *
+ *
0.25
1.25
+ * + * *
0.25
1.25
*
* @@ -576,7 +576,7 @@ define([ * * @example * cb.showBumps = true; - * cb.bumpMapSource = "bump.jpg"; + * cb.bumpMapSource = 'bump.jpg'; * cb.bumpMapNormalZ = 1.0; */ this.bumpMapNormalZ = 0.5; @@ -586,10 +586,10 @@ define([ * dayNightBlendDelta determines the size of the blend region surrounding the terminator (where day * meets night). A value of zero indicates a sharp transition without blending; a larger value creates a linearly * blended region based on the diffuse lighting component: -dayNightBlendDelta < diffuse < dayNightBlendDelta. - *
- * - * - * + *
+ *
0.0
0.05
+ * + * *
0.0
0.05
*
* @@ -601,9 +601,9 @@ define([ * * @example * cb.showDay = true; - * cb.dayImageSource = "day.jpg"; + * cb.dayImageSource = 'day.jpg'; * cb.showNight = true; - * cb.nightImageSource = "night.jpg"; + * cb.nightImageSource = 'night.jpg'; * cb.dayNightBlendDelta = 0.0; // Sharp transition */ this.dayNightBlendDelta = 0.05; @@ -889,7 +889,7 @@ define([ CentralBody.prototype._createBaseTile = function() { // Some tile servers, like Bing, don't have a base image for the entire central body. // Create a 1x1 image that will never get rendered. - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = 1.0; canvas.height = 1.0; @@ -1155,7 +1155,7 @@ define([ CentralBody.prototype._refine3D = function(tile, context, sceneState) { var provider = this._dayTileProvider; - if (typeof provider === "undefined") { + if (typeof provider === 'undefined') { return false; } @@ -1167,7 +1167,7 @@ define([ var cameraPosition = sceneState.camera.getPositionWC(); var direction = sceneState.camera.getDirectionWC(); - var texturePixelError = (this.pixelError3D !== "undefined" && this.pixelError3D > 0.0) ? this.pixelError3D : 1.0; + var texturePixelError = (this.pixelError3D !== 'undefined' && this.pixelError3D > 0.0) ? this.pixelError3D : 1.0; var dmin = this._minTileDistance(tile.zoom, texturePixelError); var toCenter = boundingVolume.center.subtract(cameraPosition); @@ -1192,7 +1192,7 @@ define([ var viewportWidth = viewport.width; var viewportHeight = viewport.height; - if (typeof provider === "undefined") { + if (typeof provider === 'undefined') { return false; } @@ -1206,7 +1206,7 @@ define([ if (tile.texture && !tile.texture.isDestroyed()) { tileWidth = tile.texture.getWidth(); tileHeight = tile.texture.getHeight(); - } else if (tile.image && typeof tile.image.width !== "undefined") { + } else if (tile.image && typeof tile.image.width !== 'undefined') { tileWidth = tile.image.width; tileHeight = tile.image.height; } else { @@ -1279,7 +1279,7 @@ define([ var eUnit = Cartesian3.UNIT_Z.cross(q).normalize(); var nUnit = qUnit.cross(eUnit).normalize(); - // Determine the radius of the "limb" of the ellipsoid. + // Determine the radius of the 'limb' of the ellipsoid. var wMagnitude = Math.sqrt(q.magnitudeSquared() - 1.0); // Compute the center and offsets. @@ -1563,7 +1563,7 @@ define([ // create viewport quad for vertical gaussian blur pass this._quadV = new ViewportQuad(new Rectangle(0.0, 0.0, width, height)); - this._quadV.vertexShader = "#define VERTICAL 1\n" + CentralBodyVSFilter; + this._quadV.vertexShader = '#define VERTICAL 1\n' + CentralBodyVSFilter; this._quadV.fragmentShader = CentralBodyFSFilter; this._quadV.uniforms.u_height = function() { return height; @@ -1609,17 +1609,17 @@ define([ bufferUsage : BufferUsage.STATIC_DRAW }); - vs = "#define SKY_FROM_SPACE \n" + - "#line 0 \n" + + vs = '#define SKY_FROM_SPACE \n' + + '#line 0 \n' + SkyAtmosphereVS; - fs = "#line 0\n" + + fs = '#line 0\n' + SkyAtmosphereFS; this._spSkyFromSpace = context.getShaderCache().getShaderProgram(vs, fs); - vs = "#define SKY_FROM_ATMOSPHERE" + - "#line 0 \n" + + vs = '#define SKY_FROM_ATMOSPHERE' + + '#line 0 \n' + SkyAtmosphereVS; this._spSkyFromAtmosphere = context.getShaderCache().getShaderProgram(vs, fs); @@ -1722,7 +1722,7 @@ define([ if (!this._spDepth) { this._spDepth = context.getShaderCache().getShaderProgram( CentralBodyVSDepth, - "#line 0\n" + + '#line 0\n' + CentralBodyFSDepth, { position : 0 }); @@ -1753,7 +1753,7 @@ define([ }); }; nightImage.onerror = function() { - that._exception = "Could not load image: " + this.src + "."; + that._exception = 'Could not load image: ' + this.src + '.'; }; nightImage.src = this.nightImageSource; } @@ -1770,7 +1770,7 @@ define([ }); }; specularImage.onerror = function() { - that._exception = "Could not load image: " + this.src + "."; + that._exception = 'Could not load image: ' + this.src + '.'; }; specularImage.src = this.specularMapSource; } @@ -1787,7 +1787,7 @@ define([ }); }; cloudsImage.onerror = function() { - that._exception = "Could not load image: " + this.src + "."; + that._exception = 'Could not load image: ' + this.src + '.'; }; cloudsImage.src = this.cloudsMapSource; } @@ -1804,7 +1804,7 @@ define([ }); }; bumpImage.onerror = function() { - that._exception = "Could not load image: " + this.src + "."; + that._exception = 'Could not load image: ' + this.src + '.'; }; bumpImage.src = this.bumpMapSource; } @@ -1821,21 +1821,21 @@ define([ (dayChanged || nightChanged || cloudsChanged || cloudShadowsChanged || specularChanged || bumpsChanged) || (this._showTerminator !== this.showTerminator)) { - var fsPrepend = ((this.showDay && this._dayTileProvider) ? "#define SHOW_DAY 1\n" : "") + - ((this.showNight && this._nightTexture) ? "#define SHOW_NIGHT 1\n" : "") + - ((this.showClouds && this._cloudsTexture) ? "#define SHOW_CLOUDS 1\n" : "") + - ((this.showCloudShadows && this._cloudsTexture) ? "#define SHOW_CLOUD_SHADOWS 1\n" : "") + - ((this.showSpecular && this._specularTexture) ? "#define SHOW_SPECULAR 1\n" : "") + - ((this.showBumps && this._bumpTexture) ? "#define SHOW_BUMPS 1\n" : "") + - (this.showTerminator ? "#define SHOW_TERMINATOR 1\n" : "") + - "#line 0\n" + + var fsPrepend = ((this.showDay && this._dayTileProvider) ? '#define SHOW_DAY 1\n' : '') + + ((this.showNight && this._nightTexture) ? '#define SHOW_NIGHT 1\n' : '') + + ((this.showClouds && this._cloudsTexture) ? '#define SHOW_CLOUDS 1\n' : '') + + ((this.showCloudShadows && this._cloudsTexture) ? '#define SHOW_CLOUD_SHADOWS 1\n' : '') + + ((this.showSpecular && this._specularTexture) ? '#define SHOW_SPECULAR 1\n' : '') + + ((this.showBumps && this._bumpTexture) ? '#define SHOW_BUMPS 1\n' : '') + + (this.showTerminator ? '#define SHOW_TERMINATOR 1\n' : '') + + '#line 0\n' + CentralBodyFSCommon; - var groundFromSpacePrepend = "#define SHOW_GROUND_ATMOSPHERE 1\n" + - "#define SHOW_GROUND_ATMOSPHERE_FROM_SPACE 1\n"; - var groundFromAtmospherePrepend = "#define SHOW_GROUND_ATMOSPHERE 1\n" + - "#define SHOW_GROUND_ATMOSPHERE_FROM_ATMOSPHERE 1\n"; + var groundFromSpacePrepend = '#define SHOW_GROUND_ATMOSPHERE 1\n' + + '#define SHOW_GROUND_ATMOSPHERE_FROM_SPACE 1\n'; + var groundFromAtmospherePrepend = '#define SHOW_GROUND_ATMOSPHERE 1\n' + + '#define SHOW_GROUND_ATMOSPHERE_FROM_ATMOSPHERE 1\n'; - vs = "#line 0\n" + + vs = '#line 0\n' + GroundAtmosphere + CentralBodyVS; diff --git a/Source/Scene/CheckerboardMaterial.js b/Source/Scene/CheckerboardMaterial.js index 0977fd12b29..2cdae6f6fb3 100644 --- a/Source/Scene/CheckerboardMaterial.js +++ b/Source/Scene/CheckerboardMaterial.js @@ -63,7 +63,7 @@ define(['../Shaders/CheckerboardMaterial'], function(ShadersCheckerboardMaterial } CheckerboardMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + ShadersCheckerboardMaterial; + return '#line 0\n' + ShadersCheckerboardMaterial; }; return CheckerboardMaterial; diff --git a/Source/Scene/ColorMaterial.js b/Source/Scene/ColorMaterial.js index 4db08afc606..98d1c60a4ff 100644 --- a/Source/Scene/ColorMaterial.js +++ b/Source/Scene/ColorMaterial.js @@ -30,7 +30,7 @@ define(['../Shaders/ColorMaterial'], function(ShadersColorMaterial) { } ColorMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + ShadersColorMaterial; + return '#line 0\n' + ShadersColorMaterial; }; return ColorMaterial; diff --git a/Source/Scene/ComplexConicSensorVolume.js b/Source/Scene/ComplexConicSensorVolume.js index 7a05ab0e5a3..15bcca157d4 100644 --- a/Source/Scene/ComplexConicSensorVolume.js +++ b/Source/Scene/ComplexConicSensorVolume.js @@ -76,14 +76,14 @@ define([ * * @type Boolean */ - this.show = (typeof t.show === "undefined") ? true : t.show; + this.show = (typeof t.show === 'undefined') ? true : t.show; /** * DOC_TBA * * @type Boolean */ - this.showIntersection = (typeof t.showIntersection === "undefined") ? true : t.showIntersection; + this.showIntersection = (typeof t.showIntersection === 'undefined') ? true : t.showIntersection; /** * The 4x4 transformation matrix that transforms this sensor from model to world coordinates. In it's model @@ -91,8 +91,8 @@ define([ * angles are measured from the x-axis. This matrix is available to GLSL vertex and fragment shaders via * {@link agi_model} and derived uniforms. *

- *
- *
+ *
+ *
* Model coordinate system for a conic sensor *
* @@ -115,7 +115,7 @@ define([ * * @see ComplexConicSensorVolume#outerHalfAngle */ - this.innerHalfAngle = (typeof t.innerHalfAngle === "undefined") ? CesiumMath.PI_OVER_TWO : t.innerHalfAngle; + this.innerHalfAngle = (typeof t.innerHalfAngle === 'undefined') ? CesiumMath.PI_OVER_TWO : t.innerHalfAngle; /** * DOC_TBA @@ -124,7 +124,7 @@ define([ * * @see ComplexConicSensorVolume#innerHalfAngle */ - this.outerHalfAngle = (typeof t.outerHalfAngle === "undefined") ? CesiumMath.PI_OVER_TWO : t.outerHalfAngle; + this.outerHalfAngle = (typeof t.outerHalfAngle === 'undefined') ? CesiumMath.PI_OVER_TWO : t.outerHalfAngle; this._outerHalfAngle = undefined; /** @@ -134,7 +134,7 @@ define([ * * @see ComplexConicSensorVolume#innerHalfAngle */ - this.maximumClockAngle = (typeof t.maximumClockAngle === "undefined") ? Math.PI : t.maximumClockAngle; + this.maximumClockAngle = (typeof t.maximumClockAngle === 'undefined') ? Math.PI : t.maximumClockAngle; this._maximumClockAngle = undefined; /** @@ -144,7 +144,7 @@ define([ * * @see ComplexConicSensorVolume#innerHalfAngle */ - this.minimumClockAngle = (typeof t.minimumClockAngle === "undefined") ? -Math.PI : t.minimumClockAngle; + this.minimumClockAngle = (typeof t.minimumClockAngle === 'undefined') ? -Math.PI : t.minimumClockAngle; this._minimumClockAnglee = undefined; /** @@ -152,7 +152,7 @@ define([ * * @type Number */ - this.radius = (typeof t.radius === "undefined") ? Number.POSITIVE_INFINITY : t.radius; + this.radius = (typeof t.radius === 'undefined') ? Number.POSITIVE_INFINITY : t.radius; this._radius = undefined; // /** @@ -160,14 +160,14 @@ define([ // * // * @type Number // */ - // this.minimumClockAngle = (typeof t.minimumClockAngle === "undefined") ? (-Math.PI / 4.0) : t.minimumClockAngle; + // this.minimumClockAngle = (typeof t.minimumClockAngle === 'undefined') ? (-Math.PI / 4.0) : t.minimumClockAngle; // /** // * DOC_TBA // * // * @type Number // */ - // this.maximumClockAngle = (typeof t.maximumClockAngle === "undefined") ? (Math.PI / 4.0) : t.maximumClockAngle; + // this.maximumClockAngle = (typeof t.maximumClockAngle === 'undefined') ? (Math.PI / 4.0) : t.maximumClockAngle; /** * DOC_TBA @@ -208,7 +208,7 @@ define([ * * @type Number */ - this.erosion = (typeof t.erosion === "undefined") ? 1.0 : t.erosion; + this.erosion = (typeof t.erosion === 'undefined') ? 1.0 : t.erosion; var that = this; this._uniforms = { @@ -299,22 +299,22 @@ define([ return combineMaterials({ material : this.outerMaterial, sourceTransform : function(source) { - return source.replace(new RegExp("agi_getMaterialColor", "g"), "agi_getOuterMaterialColor"); + return source.replace(new RegExp('agi_getMaterialColor', 'g'), 'agi_getOuterMaterialColor'); } }, { material : this.innerMaterial, sourceTransform : function(source) { - return source.replace(new RegExp("agi_getMaterialColor", "g"), "agi_getInnerMaterialColor"); + return source.replace(new RegExp('agi_getMaterialColor', 'g'), 'agi_getInnerMaterialColor'); } }, { material : this.capMaterial, sourceTransform : function(source) { - return source.replace(new RegExp("agi_getMaterialColor", "g"), "agi_getCapMaterialColor"); + return source.replace(new RegExp('agi_getMaterialColor', 'g'), 'agi_getCapMaterialColor'); } }, { material : this.silhouetteMaterial, sourceTransform : function(source) { - return source.replace(new RegExp("agi_getMaterialColor", "g"), "agi_getSilhouetteMaterialColor"); + return source.replace(new RegExp('agi_getMaterialColor', 'g'), 'agi_getSilhouetteMaterialColor'); } }); }; @@ -334,11 +334,11 @@ define([ } if (this.innerHalfAngle > this.outerHalfAngle) { - throw new DeveloperError("this.innerHalfAngle cannot be greater than this.outerHalfAngle."); + throw new DeveloperError('this.innerHalfAngle cannot be greater than this.outerHalfAngle.'); } if (this.radius < 0.0) { - throw new DeveloperError("this.radius must be greater than or equal to zero."); + throw new DeveloperError('this.radius must be greater than or equal to zero.'); } if (this.show) { @@ -369,17 +369,17 @@ define([ this._drawUniforms = combine(this._uniforms, material._uniforms); var fsSource = - "#line 0\n" + + '#line 0\n' + ShadersNoise + - "#line 0\n" + + '#line 0\n' + ShadersRay + - "#line 0\n" + + '#line 0\n' + ShadersConstructiveSolidGeometry + - "#line 0\n" + + '#line 0\n' + ShadersSensorVolume + - "#line 0\n" + + '#line 0\n' + material._getShaderSource() + - "#line 0\n" + + '#line 0\n' + ComplexConicSensorVolumeFS; this._sp = this._sp && this._sp.release(); @@ -430,14 +430,14 @@ define([ if (this._mode === SceneMode.SCENE3D && this.show) { // Since this ignores all other materials, if a material does discard, the sensor will still be picked. var fsSource = - "#define RENDER_FOR_PICK 1\n" + - "#line 0\n" + + '#define RENDER_FOR_PICK 1\n' + + '#line 0\n' + ShadersRay + - "#line 0\n" + + '#line 0\n' + ShadersConstructiveSolidGeometry + - "#line 0\n" + + '#line 0\n' + ShadersSensorVolume + - "#line 0\n" + + '#line 0\n' + ComplexConicSensorVolumeFS; this._spPick = context.getShaderCache().getShaderProgram(ComplexConicSensorVolumeVS, fsSource, attributeIndices); diff --git a/Source/Scene/CompositePrimitive.js b/Source/Scene/CompositePrimitive.js index 55ed9da603d..0c77b017908 100644 --- a/Source/Scene/CompositePrimitive.js +++ b/Source/Scene/CompositePrimitive.js @@ -127,7 +127,7 @@ define([ */ CompositePrimitive.prototype.add = function(primitive) { if (!primitive) { - throw new DeveloperError("primitive is required."); + throw new DeveloperError('primitive is required.'); } var external = (primitive._external = primitive._external || {}); @@ -224,7 +224,7 @@ define([ CompositePrimitive.prototype._getPrimitiveIndex = function(primitive) { if (!this.contains(primitive)) { - throw new DeveloperError("primitive is not in this composite."); + throw new DeveloperError('primitive is not in this composite.'); } return this._primitives.indexOf(primitive); @@ -356,8 +356,8 @@ define([ * } */ CompositePrimitive.prototype.get = function(index) { - if (typeof index === "undefined") { - throw new DeveloperError("index is required."); + if (typeof index === 'undefined') { + throw new DeveloperError('index is required.'); } return this._primitives[index]; diff --git a/Source/Scene/CompositeTileProvider.js b/Source/Scene/CompositeTileProvider.js index 7206d0cbf10..491e3ceca42 100644 --- a/Source/Scene/CompositeTileProvider.js +++ b/Source/Scene/CompositeTileProvider.js @@ -30,10 +30,10 @@ define([ * // Create a CompositeTileProvider from a SingleTileProvider and BingMapsTileProvider * * // Single - * var single = new SingleTileProvider("Images/NE2_50M_SR_W_4096.jpg"); + * var single = new SingleTileProvider('Images/NE2_50M_SR_W_4096.jpg'); * // Bing Maps * var bing = new BingMapsTileProvider({ - * server : "dev.virtualearth.net", + * server : 'dev.virtualearth.net', * mapStyle : BingMapsStyle.AERIAL * }); * // Composite @@ -45,11 +45,11 @@ define([ */ function CompositeTileProvider(list, camera, ellipsoid) { if (!list) { - throw new DeveloperError("A non-empty list is required."); + throw new DeveloperError('A non-empty list is required.'); } if (!camera) { - throw new DeveloperError("camera is required."); + throw new DeveloperError('camera is required.'); } this._camera = camera; @@ -119,10 +119,10 @@ define([ CompositeTileProvider._compare = function(a, b) { // if height isn't provided, default to 0.0 - if (typeof a.height === "undefined") { + if (typeof a.height === 'undefined') { a.height = 0.0; } - if (typeof b.height === "undefined") { + if (typeof b.height === 'undefined') { b.height = 0.0; } return b.height - a.height; @@ -169,7 +169,7 @@ define([ */ CompositeTileProvider.prototype.loadTileImage = function(tile, onload, onerror, oninvalid) { if (tile.zoom < this.zoomMin || tile.zoom > this.zoomMax) { - throw new DeveloperError("tile.zoom must be between in [zoomMin, zoomMax]."); + throw new DeveloperError('tile.zoom must be between in [zoomMin, zoomMax].'); } var height = this._camera.position.magnitude() - this._radius; @@ -181,7 +181,7 @@ define([ image = provider.loadTileImage(tile, onload, onerror, oninvalid); tile.projection = provider.projection; } else { - if (oninvalid && typeof oninvalid === "function") { + if (oninvalid && typeof oninvalid === 'function') { oninvalid(); } } diff --git a/Source/Scene/CustomSensorVolume.js b/Source/Scene/CustomSensorVolume.js index 804bb963a6d..6d97adcc7b9 100644 --- a/Source/Scene/CustomSensorVolume.js +++ b/Source/Scene/CustomSensorVolume.js @@ -68,14 +68,14 @@ define([ * * @type Boolean */ - this.show = (typeof t.show === "undefined") ? true : t.show; + this.show = (typeof t.show === 'undefined') ? true : t.show; /** * DOC_TBA * * @type Boolean */ - this.showIntersection = (typeof t.showIntersection === "undefined") ? true : t.showIntersection; + this.showIntersection = (typeof t.showIntersection === 'undefined') ? true : t.showIntersection; /** *

@@ -88,7 +88,7 @@ define([ * * @type Boolean */ - this.showThroughEllipsoid = (typeof t.showThroughEllipsoid === "undefined") ? false : t.showThroughEllipsoid; + this.showThroughEllipsoid = (typeof t.showThroughEllipsoid === 'undefined') ? false : t.showThroughEllipsoid; /** * The 4x4 transformation matrix that transforms this sensor from model to world coordinates. In it's model @@ -98,8 +98,8 @@ define([ * This matrix is available to GLSL vertex and fragment shaders via * {@link agi_model} and derived uniforms. *

- *

- *
+ *
+ *
* Model coordinate system for a custom sensor *
* @@ -128,7 +128,7 @@ define([ * * @type Number */ - this.radius = (typeof t.radius === "undefined") ? Number.POSITIVE_INFINITY : t.radius; + this.radius = (typeof t.radius === 'undefined') ? Number.POSITIVE_INFINITY : t.radius; this._directions = undefined; this._directionsDirty = false; @@ -155,7 +155,7 @@ define([ * * @type Number */ - this.erosion = (typeof t.erosion === "undefined") ? 1.0 : t.erosion; + this.erosion = (typeof t.erosion === 'undefined') ? 1.0 : t.erosion; var that = this; this._uniforms = { @@ -309,7 +309,7 @@ define([ } if (this.radius < 0.0) { - throw new DeveloperError("this.radius must be greater than or equal to zero."); + throw new DeveloperError('this.radius must be greater than or equal to zero.'); } if (this.show) { @@ -341,13 +341,13 @@ define([ this._material = this.material || new ColorMaterial(); var fsSource = - "#line 0\n" + + '#line 0\n' + ShadersNoise + - "#line 0\n" + + '#line 0\n' + ShadersSensorVolume + - "#line 0\n" + + '#line 0\n' + this.material._getShaderSource() + - "#line 0\n" + + '#line 0\n' + CustomSensorVolumeFS; this._sp = this._sp && this._sp.release(); @@ -394,10 +394,10 @@ define([ if (this._mode === SceneMode.SCENE3D && this.show && this._va) { // Since this ignores all other materials, if a material does discard, the sensor will still be picked. var fsSource = - "#define RENDER_FOR_PICK 1\n" + - "#line 0\n" + + '#define RENDER_FOR_PICK 1\n' + + '#line 0\n' + ShadersSensorVolume + - "#line 0\n" + + '#line 0\n' + CustomSensorVolumeFS; this._spPick = context.getShaderCache().getShaderProgram(CustomSensorVolumeVS, fsSource, attributeIndices); diff --git a/Source/Scene/DiffuseMapMaterial.js b/Source/Scene/DiffuseMapMaterial.js index 05840ababb0..ec36789a06c 100644 --- a/Source/Scene/DiffuseMapMaterial.js +++ b/Source/Scene/DiffuseMapMaterial.js @@ -42,7 +42,7 @@ define(['../Shaders/DiffuseMapMaterial'], function(ShadersDiffuseMapMaterial) { } DiffuseMapMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + ShadersDiffuseMapMaterial; + return '#line 0\n' + ShadersDiffuseMapMaterial; }; return DiffuseMapMaterial; diff --git a/Source/Scene/DistanceIntervalMaterial.js b/Source/Scene/DistanceIntervalMaterial.js index d70a1890d5b..1014ba04fbd 100644 --- a/Source/Scene/DistanceIntervalMaterial.js +++ b/Source/Scene/DistanceIntervalMaterial.js @@ -36,8 +36,8 @@ define(['../Shaders/DistanceIntervalMaterial'], function(ShadersDistanceInterval } DistanceIntervalMaterial.prototype._getShaderSource = function() { - return "#define NUMBER_OF_DISTANCES " + this.intervals.length.toString() + "\n" + - "#line 0\n" + ShadersDistanceIntervalMaterial; + return '#define NUMBER_OF_DISTANCES ' + this.intervals.length.toString() + '\n' + + '#line 0\n' + ShadersDistanceIntervalMaterial; }; return DistanceIntervalMaterial; diff --git a/Source/Scene/DotMaterial.js b/Source/Scene/DotMaterial.js index 15c4732a43c..e7916df478c 100644 --- a/Source/Scene/DotMaterial.js +++ b/Source/Scene/DotMaterial.js @@ -63,7 +63,7 @@ define(['../Shaders/DotMaterial'], function(ShadersDotMaterial) { } DotMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + ShadersDotMaterial; + return '#line 0\n' + ShadersDotMaterial; }; return DotMaterial; diff --git a/Source/Scene/FacetMaterial.js b/Source/Scene/FacetMaterial.js index 5363da89bef..ffbb2265a70 100644 --- a/Source/Scene/FacetMaterial.js +++ b/Source/Scene/FacetMaterial.js @@ -58,9 +58,9 @@ define([ } FacetMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + + return '#line 0\n' + ShadersNoise + - "#line 0\n" + + '#line 0\n' + ShadersFacetMaterial; }; diff --git a/Source/Scene/HorizontalOrigin.js b/Source/Scene/HorizontalOrigin.js index d22ab4af7d5..f1f08b3ef50 100644 --- a/Source/Scene/HorizontalOrigin.js +++ b/Source/Scene/HorizontalOrigin.js @@ -18,21 +18,21 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CENTER : new Enumeration(0, "CENTER"), + CENTER : new Enumeration(0, 'CENTER'), /** * The origin is on the left side of the object. * * @constant * @type {Enumeration} */ - LEFT : new Enumeration(1, "LEFT"), + LEFT : new Enumeration(1, 'LEFT'), /** * The origin is on the right side of the object. * * @constant * @type {Enumeration} */ - RIGHT : new Enumeration(-1, "RIGHT") + RIGHT : new Enumeration(-1, 'RIGHT') }; return HorizontalOrigin; diff --git a/Source/Scene/HorizontalStripeMaterial.js b/Source/Scene/HorizontalStripeMaterial.js index e3d5f9a135d..5a53c9f937a 100644 --- a/Source/Scene/HorizontalStripeMaterial.js +++ b/Source/Scene/HorizontalStripeMaterial.js @@ -63,7 +63,7 @@ define(['../Shaders/HorizontalStripeMaterial'], function(ShadersHorizontalStripe } HorizontalStripeMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + ShadersHorizontalStripeMaterial; + return '#line 0\n' + ShadersHorizontalStripeMaterial; }; return HorizontalStripeMaterial; diff --git a/Source/Scene/Label.js b/Source/Scene/Label.js index 936c8d36df0..a3e0562fbb3 100644 --- a/Source/Scene/Label.js +++ b/Source/Scene/Label.js @@ -29,15 +29,15 @@ define([ * @see LabelCollection#add * @see Billboard * - * @see HTML canvas 2D context + * @see HTML canvas 2D context */ function Label(labelTemplate, labelCollection) { var l = labelTemplate || {}; - var show = (typeof l.show === "undefined") ? true : l.show; + var show = (typeof l.show === 'undefined') ? true : l.show; var billboardCollection = labelCollection._getCollection(); - this._text = l.text || ""; - this._font = l.font || "30px sans-serif"; + this._text = l.text || ''; + this._font = l.font || '30px sans-serif'; this._fillColor = l.fillColor || { red : 1.0, green : 1.0, @@ -57,7 +57,7 @@ define([ this._eyeOffset = l.eyeOffset ? new Cartesian3(l.eyeOffset.x, l.eyeOffset.y, l.eyeOffset.z) : Cartesian3.ZERO.clone(); this._position = l.position ? new Cartesian3(l.position.x, l.position.y, l.position.z) : Cartesian3.ZERO.clone(); - this._scale = (typeof l.scale === "undefined") ? 1.0 : l.scale; + this._scale = (typeof l.scale === 'undefined') ? 1.0 : l.scale; this._show = show; this._billboardCollection = billboardCollection; @@ -92,7 +92,7 @@ define([ * @see Label#getShow */ Label.prototype.setShow = function(value) { - if ((typeof value !== "undefined") && (value !== this._show)) { + if ((typeof value !== 'undefined') && (value !== this._show)) { this._show = value; var billboards = this._billboards; @@ -145,7 +145,7 @@ define([ Label.prototype.setPosition = function(value) { var p = this._position; - if ((typeof value !== "undefined") && + if ((typeof value !== 'undefined') && ((p.x !== value.x) || (p.y !== value.y) || (p.z !== value.z))) { p.x = value.x; @@ -179,7 +179,7 @@ define([ * @see Label#getText */ Label.prototype.setText = function(value) { - if ((typeof value !== "undefined") && (value !== this._text)) { + if ((typeof value !== 'undefined') && (value !== this._text)) { this._text = value; this._createBillboards(); } @@ -206,10 +206,10 @@ define([ * @see Label#getFont * @see Label#setFillColor * @see Label#setOutlineColor - * @see HTML canvas 2D context font + * @see HTML canvas 2D context font */ Label.prototype.setFont = function(value) { - if ((typeof value !== "undefined") && (this._font !== value)) { + if ((typeof value !== 'undefined') && (this._font !== value)) { this._font = value; this._createBillboards(); } @@ -239,7 +239,7 @@ define([ */ Label.prototype.setFillColor = function(value) { var c = this._fillColor; - if ((typeof value !== "undefined") && + if ((typeof value !== 'undefined') && (c.red !== value.red || c.green !== value.green || c.blue !== value.blue || c.alpha !== value.alpha)) { this._fillColor = value; this._createBillboards(); @@ -270,7 +270,7 @@ define([ */ Label.prototype.setOutlineColor = function(value) { var c = this._outlineColor; - if ((typeof value !== "undefined") && + if ((typeof value !== 'undefined') && (c.red !== value.red || c.green !== value.green || c.blue !== value.blue || c.alpha !== value.alpha)) { this._outlineColor = value; this._createBillboards(); @@ -300,7 +300,7 @@ define([ * @see Label#setFillColor */ Label.prototype.setStyle = function(value) { - if ((typeof value !== "undefined") && (this._style !== value)) { + if ((typeof value !== 'undefined') && (this._style !== value)) { this._style = value; this._createBillboards(); } @@ -330,10 +330,10 @@ define([ * changing it after calling setPixelOffset does not affect the label's pixel * offset; an explicit call to setPixelOffset is required. *

- *
- * - * - * + *
+ *
default
l.setPixelOffset({ x : 25, y : -75 });
+ * + * *
default
l.setPixelOffset({ x : 25, y : -75 });
* The label's origin is indicated by the yellow point. *
@@ -347,7 +347,7 @@ define([ */ Label.prototype.setPixelOffset = function(value) { var p = this._pixelOffset; - if ((typeof value !== "undefined") && ((p.x !== value.x) || (p.y !== value.y))) { + if ((typeof value !== 'undefined') && ((p.x !== value.x) || (p.y !== value.y))) { p.x = value.x; p.y = value.y; this._setPixelOffsets(); @@ -384,10 +384,10 @@ define([ * Below, the label is positioned at the center of the Earth but an eye offset makes it always * appear on top of the Earth regardless of the viewer's or Earth's orientation. *

- *
- * - * - * + *
+ *
+ * + * *
* l.setEyeOffset({ x : 0.0, y : 8000000.0, z : 0.0 });

*
@@ -401,7 +401,7 @@ define([ Label.prototype.setEyeOffset = function(value) { var e = this._eyeOffset; - if ((typeof value !== "undefined") && + if ((typeof value !== 'undefined') && ((e.x !== value.x) || (e.y !== value.y) || (e.z !== value.z))) { e.x = value.x; e.y = value.y; @@ -437,8 +437,8 @@ define([ * Sets the horizontal origin of this label, which determines if the label is * to the left, center, or right of its position. *

- *
- *
+ *
+ *
*
* * @memberof Label @@ -454,7 +454,7 @@ define([ * l.setVerticalOrigin(VerticalOrigin.TOP); */ Label.prototype.setHorizontalOrigin = function(value) { - if ((typeof value !== "undefined") && (this._horizontalOrigin !== value)) { + if ((typeof value !== 'undefined') && (this._horizontalOrigin !== value)) { this._horizontalOrigin = value; this._createBillboards(); } @@ -477,8 +477,8 @@ define([ * Sets the vertical origin of this label, which determines if the label is * to the above, below, or at the center of its position. *

- *
- *
+ *
+ *
*
* * @memberof Label @@ -494,7 +494,7 @@ define([ * l.setVerticalOrigin(VerticalOrigin.TOP); */ Label.prototype.setVerticalOrigin = function(value) { - if ((typeof value !== "undefined") && (this._verticalOrigin !== value)) { + if ((typeof value !== 'undefined') && (this._verticalOrigin !== value)) { this._verticalOrigin = value; this._createBillboards(); } @@ -522,8 +522,8 @@ define([ * Applying a large scale value may pixelate the label. To make text larger without pixelation, * use a larger font size when calling {@link Label#setFont} instead. *

- *
- *
+ *
+ *
* From left to right in the above image, the scales are 0.5, 1.0, * and 2.0. *
@@ -536,7 +536,7 @@ define([ * @see Label#setFont */ Label.prototype.setScale = function(value) { - if ((typeof value !== "undefined") && (this._scale !== value)) { + if ((typeof value !== 'undefined') && (this._scale !== value)) { this._scale = value; var billboards = this._billboards; var length = this._billboards ? this._billboards.length : 0; @@ -662,9 +662,9 @@ define([ Label.prototype._createId = function(charValue) { return JSON.stringify({ - fillColor : this._fillColor.red.toString() + "," + this._fillColor.green.toString() + "," + this._fillColor.blue.toString() + "," + this._fillColor.alpha.toString(), + fillColor : this._fillColor.red.toString() + ',' + this._fillColor.green.toString() + ',' + this._fillColor.blue.toString() + ',' + this._fillColor.alpha.toString(), font : this._font, - outlineColor : this._outlineColor.red.toString() + "," + this._outlineColor.green.toString() + "," + this._outlineColor.blue.toString() + "," + this._outlineColor.alpha.toString(), + outlineColor : this._outlineColor.red.toString() + ',' + this._outlineColor.green.toString() + ',' + this._outlineColor.blue.toString() + ',' + this._outlineColor.alpha.toString(), style : this._style, verticalOrigin : this._verticalOrigin, value : charValue @@ -674,12 +674,12 @@ define([ Label.prototype._createCanvas = function(charValue) { var font = this._font; - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = canvas.height = 1; canvas.style.font = font; canvas.style.display = 'hidden'; - var context2D = canvas.getContext("2d"); + var context2D = canvas.getContext('2d'); context2D.font = font; @@ -687,11 +687,11 @@ define([ //It's magic. var verticalOrigin = this._verticalOrigin; if (verticalOrigin === VerticalOrigin.BOTTOM) { - context2D.textBaseline = "bottom"; + context2D.textBaseline = 'bottom'; } else if (verticalOrigin === VerticalOrigin.TOP) { - context2D.textBaseline = "top"; + context2D.textBaseline = 'top'; } else {// VerticalOrigin.CENTER - context2D.textBaseline = "middle"; + context2D.textBaseline = 'middle'; } //in order for measureText to calculate style, the canvas has to be @@ -704,8 +704,8 @@ define([ canvas.height = dimensions.height; context2D.font = font; // font must be explicitly set again after changing width and height - context2D.fillStyle = "rgba(" + this._fillColor.red * 255 + ", " + this._fillColor.green * 255 + ", " + this._fillColor.blue * 255 + ", " + this._fillColor.alpha + ")"; - context2D.strokeStyle = "rgba(" + this._outlineColor.red * 255 + ", " + this._outlineColor.green * 255 + ", " + this._outlineColor.blue * 255 + ", " + this._outlineColor.alpha + ")"; + context2D.fillStyle = 'rgba(' + this._fillColor.red * 255 + ', ' + this._fillColor.green * 255 + ', ' + this._fillColor.blue * 255 + ', ' + this._fillColor.alpha + ')'; + context2D.strokeStyle = 'rgba(' + this._outlineColor.red * 255 + ', ' + this._outlineColor.green * 255 + ', ' + this._outlineColor.blue * 255 + ', ' + this._outlineColor.alpha + ')'; var y = canvas.height - baseline; var style = this._style; diff --git a/Source/Scene/LabelCollection.js b/Source/Scene/LabelCollection.js index 8b83a4ab49c..493bf17a2c7 100644 --- a/Source/Scene/LabelCollection.js +++ b/Source/Scene/LabelCollection.js @@ -31,7 +31,7 @@ define([ var canvas = label._createCanvas(charValue); this._sources[id] = canvas; canvas.index = this._sourcesArray.push(canvas) - 1; - if (typeof canvasCreated !== "undefined") { + if (typeof canvasCreated !== 'undefined') { canvasCreated(); } return canvas.index; @@ -46,7 +46,7 @@ define([ }; CanvasContainer.prototype._contains = function(id) { - return typeof this._sources[id] !== "undefined"; + return typeof this._sources[id] !== 'undefined'; }; CanvasContainer.prototype._getCanvas = function(id) { @@ -57,8 +57,8 @@ define([ * A renderable collection of labels. Labels are viewport-aligned text positioned in the 3D scene. * Each label can have a different font, color, scale, etc. *

- *
- *
+ *
+ *
* Example labels *
*

@@ -85,11 +85,11 @@ define([ * var labels = new LabelCollection(); * labels.add({ * position : { x : 1.0, y : 2.0, z : 3.0 }, - * text : "A label" + * text : 'A label' * }); * labels.add({ * position : { x : 4.0, y : 5.0, z : 6.0 }, - * text : "Another label" + * text : 'Another label' * }); */ function LabelCollection() { @@ -116,19 +116,19 @@ define([ * labels.modelMatrix = Transforms.eastNorthUpToFixedFrame(center); * labels.add({ * position : new Cartesian3(0.0, 0.0, 0.0), - * text : "Center" + * text : 'Center' * }); * labels.add({ * position : new Cartesian3(1000000.0, 0.0, 0.0), - * text : "East" + * text : 'East' * }); * labels.add({ * position : new Cartesian3(0.0, 1000000.0, 0.0), - * text : "North" + * text : 'North' * }); * labels.add({ * position : new Cartesian3(0.0, 0.0, 1000000.0), - * text : "Up" + * text : 'Up' * }); */ this.modelMatrix = Matrix4.IDENTITY; @@ -191,10 +191,10 @@ define([ * var l = labels.add({ * show : true, * position : Cartesian3.ZERO, - * text : "", - * font : "30px sans-serif", - * fillColor : "white", - * outlineColor : "white", + * text : '', + * font : '30px sans-serif', + * fillColor : 'white', + * outlineColor : 'white', * style : LabelStyle.FILL, * pixelOffset : Cartesian2.ZERO, * eyeOffset : Cartesian3.ZERO, @@ -209,8 +209,8 @@ define([ * position : ellipsoid.toCartesian( * CesiumMath.cartographic3ToRadians( * new Cartographic3(longitude, latitude, height))), - * text : "Hello World", - * font : "24px Helvetica", + * text : 'Hello World', + * font : '24px Helvetica', * }); */ LabelCollection.prototype.add = function(label) { @@ -359,8 +359,8 @@ define([ * } */ LabelCollection.prototype.get = function(index) { - if (typeof index === "undefined") { - throw new DeveloperError("index is required."); + if (typeof index === 'undefined') { + throw new DeveloperError('index is required.'); } this._removeLabels(); diff --git a/Source/Scene/LabelStyle.js b/Source/Scene/LabelStyle.js index c53be20f87d..cf19d17d31c 100644 --- a/Source/Scene/LabelStyle.js +++ b/Source/Scene/LabelStyle.js @@ -16,21 +16,21 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - FILL : new Enumeration(0, "FILL"), + FILL : new Enumeration(0, 'FILL'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - OUTLINE : new Enumeration(1, "OUTLINE"), + OUTLINE : new Enumeration(1, 'OUTLINE'), /** * DOC_TBA * * @constant * @type {Enumeration} */ - FILL_AND_OUTLINE : new Enumeration(2, "FILL_AND_OUTLINE") + FILL_AND_OUTLINE : new Enumeration(2, 'FILL_AND_OUTLINE') }; return LabelStyle; diff --git a/Source/Scene/OpenStreetMapTileProvider.js b/Source/Scene/OpenStreetMapTileProvider.js index 209a76f93a2..613eac654d4 100644 --- a/Source/Scene/OpenStreetMapTileProvider.js +++ b/Source/Scene/OpenStreetMapTileProvider.js @@ -27,8 +27,8 @@ define([ * @see ArcGISTileProvider * @see CompositeTileProvider * - * @see OpenStreetMap Wiki - * @see Cross-Origin Resource Sharing + * @see OpenStreetMap Wiki + * @see Cross-Origin Resource Sharing * * @example * // OpenStreetMap tile provider @@ -118,7 +118,7 @@ define([ */ OpenStreetMapTileProvider.prototype.loadTileImage = function(tile, onload, onerror) { if (tile.zoom < this.zoomMin || tile.zoom > this.zoomMax) { - throw new DeveloperError("tile.zoom must be between in [zoomMin, zoomMax]."); + throw new DeveloperError('tile.zoom must be between in [zoomMin, zoomMax].'); } var image = new Image(); @@ -142,12 +142,12 @@ define([ */ OpenStreetMapTileProvider.prototype.getLogo = function() { if (!this._logo) { - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = 800.0; canvas.height = 20.0; - var context = canvas.getContext("2d"); - context.fillStyle = "#fff"; + var context = canvas.getContext('2d'); + context.fillStyle = '#fff'; context.font = '12px sans-serif'; context.textBaseline = 'top'; context.fillText(this._credit, 0, 0); diff --git a/Source/Scene/OrthographicFrustum.js b/Source/Scene/OrthographicFrustum.js index 8ec8aa28bf7..7e3c588713d 100644 --- a/Source/Scene/OrthographicFrustum.js +++ b/Source/Scene/OrthographicFrustum.js @@ -101,20 +101,20 @@ define([ OrthographicFrustum.prototype._update = function() { if (this.left === null || this.right === null || this.top === null || this.bottom === null || this.near === null || this.far === null) { - throw new DeveloperError("left, right, top, bottom, near, or far frustum parameters are not set."); + throw new DeveloperError('left, right, top, bottom, near, or far frustum parameters are not set.'); } if (this.left !== this._left || this.right !== this._right || this.top !== this._top || this.bottom !== this._bottom || this.near !== this._near || this.far !== this._far) { if (this.left > this.right) { - throw new DeveloperError("right must be greater than left."); + throw new DeveloperError('right must be greater than left.'); } if (this.bottom > this.top) { - throw new DeveloperError("top must be greater than bottom."); + throw new DeveloperError('top must be greater than bottom.'); } if (this.near < 0 || this.near > this.far) { - throw new DeveloperError("near must be greater than zero and less than far."); + throw new DeveloperError('near must be greater than zero and less than far.'); } this._left = this.left; @@ -147,15 +147,15 @@ define([ */ OrthographicFrustum.prototype.getPlanes = function(position, direction, up) { if (!position) { - throw new DeveloperError("position is required."); + throw new DeveloperError('position is required.'); } if (!direction) { - throw new DeveloperError("direction is required."); + throw new DeveloperError('direction is required.'); } if (!up) { - throw new DeveloperError("up is required."); + throw new DeveloperError('up is required.'); } var pos = Cartesian3.clone(position); diff --git a/Source/Scene/Particle.js b/Source/Scene/Particle.js index 10ca9399fdb..b5953461bb5 100644 --- a/Source/Scene/Particle.js +++ b/Source/Scene/Particle.js @@ -16,10 +16,10 @@ define([ template = template || {}; template.position = template.position || Cartesian3.ZERO; template.velocity = template.velocity || Cartesian3.ZERO; // initial velocity - template.mass = (typeof template.mass === "undefined") ? 1.0 : template.mass; + template.mass = (typeof template.mass === 'undefined') ? 1.0 : template.mass; if (template.mass < 0) { - throw new DeveloperError("template.mass must be positive."); + throw new DeveloperError('template.mass must be positive.'); } this.position = new Cartesian3(template.position.x, template.position.y, template.position.z); diff --git a/Source/Scene/ParticleSystem.js b/Source/Scene/ParticleSystem.js index 35403cf97b8..a82c6a94712 100644 --- a/Source/Scene/ParticleSystem.js +++ b/Source/Scene/ParticleSystem.js @@ -113,7 +113,7 @@ define([ ParticleSystem.prototype.setState = function(state) { if (state) { if (state.length !== this.getDimension()) { - throw new DeveloperError("The dimensions of the state vector does not equal the dimensions of this particle system. Call getDimension()."); + throw new DeveloperError('The dimensions of the state vector does not equal the dimensions of this particle system. Call getDimension().'); } var particles = this.particles; diff --git a/Source/Scene/PerspectiveFrustum.js b/Source/Scene/PerspectiveFrustum.js index 7fa5c744cc7..4b58971d3f8 100644 --- a/Source/Scene/PerspectiveFrustum.js +++ b/Source/Scene/PerspectiveFrustum.js @@ -94,20 +94,20 @@ define([ PerspectiveFrustum.prototype._update = function() { if (this.fovy === null || this.aspectRatio === null || this.near === null || this.far === null) { - throw new DeveloperError("fovy, aspectRatio, near, or far parameters are not set."); + throw new DeveloperError('fovy, aspectRatio, near, or far parameters are not set.'); } if (this.fovy !== this._fovy || this.aspectRatio !== this._aspectRatio || this.near !== this._near || this.far !== this._far) { if (this.fovy < 0 || this.fovy >= Math.PI) { - throw new DeveloperError("fovy must be in the range [0, PI)."); + throw new DeveloperError('fovy must be in the range [0, PI).'); } if (this.aspectRatio < 0) { - throw new DeveloperError("aspectRatio must be positive."); + throw new DeveloperError('aspectRatio must be positive.'); } if (this.near < 0 || this.near > this.far) { - throw new DeveloperError("near must be greater than zero and less than far."); + throw new DeveloperError('near must be greater than zero and less than far.'); } this._fovy = this.fovy; @@ -146,15 +146,15 @@ define([ */ PerspectiveFrustum.prototype.getPlanes = function(position, direction, up) { if (!position) { - throw new DeveloperError("position is required."); + throw new DeveloperError('position is required.'); } if (!direction) { - throw new DeveloperError("direction is required."); + throw new DeveloperError('direction is required.'); } if (!up) { - throw new DeveloperError("up is required."); + throw new DeveloperError('up is required.'); } var pos = Cartesian3.clone(position); diff --git a/Source/Scene/Polygon.js b/Source/Scene/Polygon.js index 229d64ddb9c..3559e706028 100644 --- a/Source/Scene/Polygon.js +++ b/Source/Scene/Polygon.js @@ -293,7 +293,7 @@ define([ Polygon.prototype.setPositions = function(positions, height) { // positions can be undefined if (typeof positions !== 'undefined' && (positions.length < 3)) { - throw new DeveloperError("At least three positions are required."); + throw new DeveloperError('At least three positions are required.'); } this.height = height || 0.0; this._extent = undefined; @@ -431,14 +431,14 @@ define([ */ Polygon.prototype.update = function(context, sceneState) { if (!this.ellipsoid) { - throw new DeveloperError("this.ellipsoid must be defined."); + throw new DeveloperError('this.ellipsoid must be defined.'); } var mode = sceneState.mode; var granularity = this._getGranularity(mode); if (granularity < 0.0) { - throw new DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero."); + throw new DeveloperError('this.granularity and scene2D/scene3D overrides must be greater than zero.'); } if (this.show) { @@ -480,11 +480,11 @@ define([ this._material = this.material || new ColorMaterial(); var fsSource = - "#line 0\n" + + '#line 0\n' + Noise + - "#line 0\n" + + '#line 0\n' + this.material._getShaderSource() + - "#line 0\n" + + '#line 0\n' + PolygonFS; this._sp = this._sp && this._sp.release(); diff --git a/Source/Scene/Polyline.js b/Source/Scene/Polyline.js index 6cd64f6d2b1..06e018b77bb 100644 --- a/Source/Scene/Polyline.js +++ b/Source/Scene/Polyline.js @@ -296,7 +296,7 @@ define([ var drawUniformsOne = { u_color : function() { - return that.color; // Doesn't matter; doesn't write color + return that.color; // does not matter; does not write color }, u_morphTime : function() { return that.morphTime; @@ -749,8 +749,8 @@ define([ this._spGroundTrack = this._spGroundTrack || context.getShaderCache().getShaderProgram( - "#define GROUND_TRACK\n" + - "#line 0\n" + + '#define GROUND_TRACK\n' + + '#line 0\n' + PolylineVS, PolylineFS, attributeIndices); } else { this._spGroundTrack = this._spGroundTrack && this._spGroundTrack.release(); @@ -760,8 +760,8 @@ define([ this._spHeightTrack = this._spHeightTrack || context.getShaderCache().getShaderProgram( - "#define HEIGHT_TRACK\n" + - "#line 0\n" + + '#define HEIGHT_TRACK\n' + + '#line 0\n' + PolylineVS, PolylineFS, attributeIndices); } else { this._spHeightTrack = this._spHeightTrack && this._spHeightTrack.release(); diff --git a/Source/Scene/Projections.js b/Source/Scene/Projections.js index 573d290cfc2..e2b64617cc9 100644 --- a/Source/Scene/Projections.js +++ b/Source/Scene/Projections.js @@ -13,19 +13,19 @@ define([ * @exports Projections */ var Projections = { - WGS84 : new Enumeration(0, "WGS84", { + WGS84 : new Enumeration(0, 'WGS84', { toWgs84 : function(extent, image) { return image; } }), - MERCATOR : new Enumeration(1, "MERCATOR", { + MERCATOR : new Enumeration(1, 'MERCATOR', { toWgs84 : function(extent, image) { - if (!extent || typeof extent.north === "undefined" || typeof extent.south === "undefined") { - throw new DeveloperError("extent, extent.north and extent.south are required."); + if (!extent || typeof extent.north === 'undefined' || typeof extent.south === 'undefined') { + throw new DeveloperError('extent, extent.north and extent.south are required.'); } if (!image) { - throw new DeveloperError("image is required."); + throw new DeveloperError('image is required.'); } var width = parseInt(image.width, 10); @@ -33,10 +33,10 @@ define([ var wRowBytes = width * 4; // Always 4 bytes per pixel. // draw image to canvas and get the pixels - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; - var context = canvas.getContext("2d"); + var context = canvas.getContext('2d'); context.drawImage(image, 0, 0); var fromPixels = context.getImageData(0, 0, width, height).data; diff --git a/Source/Scene/RectangularPyramidSensorVolume.js b/Source/Scene/RectangularPyramidSensorVolume.js index 9a93ef79bf0..5fc12316efe 100644 --- a/Source/Scene/RectangularPyramidSensorVolume.js +++ b/Source/Scene/RectangularPyramidSensorVolume.js @@ -33,14 +33,14 @@ define([ * * @type Boolean */ - this.show = (typeof t.show === "undefined") ? true : t.show; + this.show = (typeof t.show === 'undefined') ? true : t.show; /** * DOC_TBA * * @type Boolean */ - this.showIntersection = (typeof t.showIntersection === "undefined") ? true : t.showIntersection; + this.showIntersection = (typeof t.showIntersection === 'undefined') ? true : t.showIntersection; /** *

@@ -53,7 +53,7 @@ define([ * * @type Boolean */ - this.showThroughEllipsoid = (typeof t.showThroughEllipsoid === "undefined") ? false : t.showThroughEllipsoid; + this.showThroughEllipsoid = (typeof t.showThroughEllipsoid === 'undefined') ? false : t.showThroughEllipsoid; /** * The 4x4 transformation matrix that transforms this sensor from model to world coordinates. In it's model @@ -62,8 +62,8 @@ define([ * cross section. This matrix is available to GLSL vertex and fragment shaders via * {@link agi_model} and derived uniforms. *

- *

- *
+ *
+ *
* Model coordinate system for a sensor *
* @@ -91,7 +91,7 @@ define([ * * @type Number */ - this.radius = (typeof t.radius === "undefined") ? Number.POSITIVE_INFINITY : t.radius; + this.radius = (typeof t.radius === 'undefined') ? Number.POSITIVE_INFINITY : t.radius; /** * DOC_TBA @@ -100,7 +100,7 @@ define([ * * @see RectangularPyramidSensorVolume#yHalfAngle */ - this.xHalfAngle = (typeof t.xHalfAngle === "undefined") ? CesiumMath.PI_OVER_TWO : t.xHalfAngle; + this.xHalfAngle = (typeof t.xHalfAngle === 'undefined') ? CesiumMath.PI_OVER_TWO : t.xHalfAngle; this._xHalfAngle = undefined; /** @@ -110,7 +110,7 @@ define([ * * @see RectangularPyramidSensorVolume#xHalfAngle */ - this.yHalfAngle = (typeof t.yHalfAngle === "undefined") ? CesiumMath.PI_OVER_TWO : t.yHalfAngle; + this.yHalfAngle = (typeof t.yHalfAngle === 'undefined') ? CesiumMath.PI_OVER_TWO : t.yHalfAngle; this._yHalfAngle = undefined; /** @@ -133,7 +133,7 @@ define([ * * @type Number */ - this.erosion = (typeof t.erosion === "undefined") ? 1.0 : t.erosion; + this.erosion = (typeof t.erosion === 'undefined') ? 1.0 : t.erosion; t._pickIdThis = t._pickIdThis || this; this._customSensor = new CustomSensorVolume(t); @@ -149,7 +149,7 @@ define([ */ RectangularPyramidSensorVolume.prototype.update = function(context, sceneState) { if ((this.xHalfAngle > CesiumMath.PI_OVER_TWO) || (this.yHalfAngle > CesiumMath.PI_OVER_TWO)) { - throw new DeveloperError("this.xHalfAngle and this.yHalfAngle must each be less than or equal to 90 degrees."); + throw new DeveloperError('this.xHalfAngle and this.yHalfAngle must each be less than or equal to 90 degrees.'); } var s = this._customSensor; diff --git a/Source/Scene/SceneMode.js b/Source/Scene/SceneMode.js index 583e123f05f..8afdb27d7d3 100644 --- a/Source/Scene/SceneMode.js +++ b/Source/Scene/SceneMode.js @@ -14,7 +14,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SCENE2D : new Enumeration(0, "SCENE2D"), + SCENE2D : new Enumeration(0, 'SCENE2D'), /** * DOC_TBA @@ -22,7 +22,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - COLUMBUS_VIEW : new Enumeration(1, "COLUMBUS_VIEW"), + COLUMBUS_VIEW : new Enumeration(1, 'COLUMBUS_VIEW'), /** * DOC_TBA @@ -30,7 +30,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - SCENE3D : new Enumeration(2, "SCENE3D"), + SCENE3D : new Enumeration(2, 'SCENE3D'), /** * DOC_TBA @@ -38,7 +38,7 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - MORPHING : new Enumeration(3, "MORPHING") + MORPHING : new Enumeration(3, 'MORPHING') }; return SceneMode; diff --git a/Source/Scene/SensorVolumeCollection.js b/Source/Scene/SensorVolumeCollection.js index aa0ad5576c7..aec5c2dae04 100644 --- a/Source/Scene/SensorVolumeCollection.js +++ b/Source/Scene/SensorVolumeCollection.js @@ -123,8 +123,8 @@ define([ * @see SensorVolumeCollection#getLength */ SensorVolumeCollection.prototype.get = function(index) { - if (typeof index === "undefined") { - throw new DeveloperError("index is required."); + if (typeof index === 'undefined') { + throw new DeveloperError('index is required.'); } return this._sensors[index]; diff --git a/Source/Scene/SingleTileProvider.js b/Source/Scene/SingleTileProvider.js index 8f54bab71af..dcdaf955ccf 100644 --- a/Source/Scene/SingleTileProvider.js +++ b/Source/Scene/SingleTileProvider.js @@ -29,7 +29,7 @@ define([ */ function SingleTileProvider(url, proxy) { if (typeof url === 'undefined') { - throw new DeveloperError("url is required."); + throw new DeveloperError('url is required.'); } this._url = url; @@ -88,7 +88,7 @@ define([ */ SingleTileProvider.prototype.loadTileImage = function(tile, onload, onerror) { if (tile.zoom < this.zoomMin || tile.zoom > this.zoomMax) { - throw new DeveloperError("tile.zoom must be between in [zoomMin, zoomMax]."); + throw new DeveloperError('tile.zoom must be between in [zoomMin, zoomMax].'); } var image = new Image(); diff --git a/Source/Scene/SolidColorTileProvider.js b/Source/Scene/SolidColorTileProvider.js index f80ea0e826e..98614017cfc 100644 --- a/Source/Scene/SolidColorTileProvider.js +++ b/Source/Scene/SolidColorTileProvider.js @@ -105,12 +105,12 @@ define([ } SolidColorTileProvider.prototype._createImage = function(color, width, height) { - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; - var context = canvas.getContext("2d"); - context.fillStyle = "rgba(" + color.r + ", " + color.g + ", " + color.b + ", 1.0)"; + var context = canvas.getContext('2d'); + context.fillStyle = 'rgba(' + color.r + ', ' + color.g + ', ' + color.b + ', 1.0)'; context.fillRect(0, 0, width, height); return canvas; @@ -129,10 +129,10 @@ define([ */ SolidColorTileProvider.prototype.loadTileImage = function(tile, onload, onerror) { if (tile.zoom < this.zoomMin || tile.zoom > this.zoomMax) { - throw new DeveloperError("tile.zoom must be in [zoomMin, zoomMax]."); + throw new DeveloperError('tile.zoom must be in [zoomMin, zoomMax].'); } - if (typeof onload === "function") { + if (typeof onload === 'function') { onload(); } diff --git a/Source/Scene/SphericalRepulsionForce.js b/Source/Scene/SphericalRepulsionForce.js index c4acfcf7ed8..b2ef4faea01 100644 --- a/Source/Scene/SphericalRepulsionForce.js +++ b/Source/Scene/SphericalRepulsionForce.js @@ -15,10 +15,10 @@ define([ function SphericalRepulsionForce(template) { template = template || {}; template.center = template.center || Cartesian3.ZERO; - template.radius = (typeof template.radius === "undefined") ? 1.0 : template.radius; + template.radius = (typeof template.radius === 'undefined') ? 1.0 : template.radius; if (template.radius < 0) { - throw new DeveloperError("template.radius must be nonnegative."); + throw new DeveloperError('template.radius must be nonnegative.'); } this.center = new Cartesian3(template.center.x, template.center.y, template.center.z); diff --git a/Source/Scene/SpringForce.js b/Source/Scene/SpringForce.js index e905c88ff26..018ae8d7786 100644 --- a/Source/Scene/SpringForce.js +++ b/Source/Scene/SpringForce.js @@ -11,7 +11,7 @@ define(['../Core/DeveloperError'], function(DeveloperError) { template = template || {}; if (!template.particleOne || !template.particleTwo) { - throw new DeveloperError("template.particleOne and template.particleTwo are required."); + throw new DeveloperError('template.particleOne and template.particleTwo are required.'); } this.particleOne = template.particleOne; @@ -19,9 +19,9 @@ define(['../Core/DeveloperError'], function(DeveloperError) { // TODO: Throw if these are negative - this.restLength = (typeof template.restLength === "undefined") ? 1.0 : template.restLength; - this.springConstant = (typeof template.springConstant === "undefined") ? 1.0 : template.springConstant; - this.dampingConstant = (typeof template.dampingConstant === "undefined") ? 1.0 : template.dampingConstant; + this.restLength = (typeof template.restLength === 'undefined') ? 1.0 : template.restLength; + this.springConstant = (typeof template.springConstant === 'undefined') ? 1.0 : template.springConstant; + this.dampingConstant = (typeof template.dampingConstant === 'undefined') ? 1.0 : template.dampingConstant; } /** diff --git a/Source/Scene/TieDyeMaterial.js b/Source/Scene/TieDyeMaterial.js index 0da1d51b189..640326479f9 100644 --- a/Source/Scene/TieDyeMaterial.js +++ b/Source/Scene/TieDyeMaterial.js @@ -58,9 +58,9 @@ define([ } TieDyeMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + + return '#line 0\n' + ShadersNoise + - "#line 0\n" + + '#line 0\n' + ShadersTieDyeMaterial; }; diff --git a/Source/Scene/Tile.js b/Source/Scene/Tile.js index 69df047243d..7f373f1aeb2 100644 --- a/Source/Scene/Tile.js +++ b/Source/Scene/Tile.js @@ -36,16 +36,16 @@ define([ */ function Tile(description) { if (!description) { - throw new DeveloperError("description is required."); + throw new DeveloperError('description is required.'); } - if (typeof description.extent === "undefined" && - (typeof description.x === "undefined" || typeof description.y === "undefined")) { - throw new DeveloperError("Either description.extent is required or description.x and description.y are required."); + if (typeof description.extent === 'undefined' && + (typeof description.x === 'undefined' || typeof description.y === 'undefined')) { + throw new DeveloperError('Either description.extent is required or description.x and description.y are required.'); } - if (typeof description.zoom === "undefined" || description.zoom < 0) { - throw new DeveloperError("description.zoom is required an must be greater than zero."); + if (typeof description.zoom === 'undefined' || description.zoom < 0) { + throw new DeveloperError('description.zoom is required an must be greater than zero.'); } /** @@ -109,7 +109,7 @@ define([ this.y = description.y; if (this.x < 0 || this.y < 0) { - throw new DeveloperError("description.x and description.y must be greater than zero."); + throw new DeveloperError('description.x and description.y must be greater than zero.'); } this.extent = Tile.tileXYToExtent(this.x, this.y, this.zoom); diff --git a/Source/Scene/TileState.js b/Source/Scene/TileState.js index ff2cba3e943..272d9e82c99 100644 --- a/Source/Scene/TileState.js +++ b/Source/Scene/TileState.js @@ -6,15 +6,15 @@ define(['../Core/Enumeration'], function(Enumeration) { * @private */ var TileState = { - READY : new Enumeration(0, "READY"), - IMAGE_LOADING : new Enumeration(1, "IMAGE_LOADING"), - IMAGE_LOADED : new Enumeration(2, "IMAGE_LOADED"), - IMAGE_FAILED : new Enumeration(3, "IMAGE_FAILED"), - IMAGE_INVALID : new Enumeration(4, "IMAGE_INVALID"), - REPROJECTING : new Enumeration(5, "REPROJECTING"), - REPROJECTED : new Enumeration(6, "REPROJECTED"), - TEXTURE_LOADING : new Enumeration(7, "TEXTURE_LOADING"), - TEXTURE_LOADED : new Enumeration(8, "TEXTURE_LOADED") + READY : new Enumeration(0, 'READY'), + IMAGE_LOADING : new Enumeration(1, 'IMAGE_LOADING'), + IMAGE_LOADED : new Enumeration(2, 'IMAGE_LOADED'), + IMAGE_FAILED : new Enumeration(3, 'IMAGE_FAILED'), + IMAGE_INVALID : new Enumeration(4, 'IMAGE_INVALID'), + REPROJECTING : new Enumeration(5, 'REPROJECTING'), + REPROJECTED : new Enumeration(6, 'REPROJECTED'), + TEXTURE_LOADING : new Enumeration(7, 'TEXTURE_LOADING'), + TEXTURE_LOADED : new Enumeration(8, 'TEXTURE_LOADED') }; return TileState; diff --git a/Source/Scene/VectorForce.js b/Source/Scene/VectorForce.js index 6949ed72bc9..02b945303ef 100644 --- a/Source/Scene/VectorForce.js +++ b/Source/Scene/VectorForce.js @@ -17,7 +17,7 @@ define([ template.vector = template.vector || Cartesian3.UNIT_Z.negate(); if (!template.particle) { - throw new DeveloperError("template.particle is required."); + throw new DeveloperError('template.particle is required.'); } this.vector = new Cartesian3(template.vector.x, template.vector.y, template.vector.z); diff --git a/Source/Scene/VerticalOrigin.js b/Source/Scene/VerticalOrigin.js index 0443c992376..d593b6550ab 100644 --- a/Source/Scene/VerticalOrigin.js +++ b/Source/Scene/VerticalOrigin.js @@ -18,21 +18,21 @@ define(['../Core/Enumeration'], function(Enumeration) { * @constant * @type {Enumeration} */ - CENTER : new Enumeration(0, "CENTER"), + CENTER : new Enumeration(0, 'CENTER'), /** * The origin is at the bottom of the object. * * @constant * @type {Enumeration} */ - BOTTOM : new Enumeration(1, "BOTTOM"), + BOTTOM : new Enumeration(1, 'BOTTOM'), /** * The origin is at the top of the object. * * @constant * @type {Enumeration} */ - TOP : new Enumeration(-1, "TOP") + TOP : new Enumeration(-1, 'TOP') }; return VerticalOrigin; diff --git a/Source/Scene/VerticalStripeMaterial.js b/Source/Scene/VerticalStripeMaterial.js index b70fd2030e6..2b4b9de0e96 100644 --- a/Source/Scene/VerticalStripeMaterial.js +++ b/Source/Scene/VerticalStripeMaterial.js @@ -63,7 +63,7 @@ define(['../Shaders/VerticalStripeMaterial'], function(ShadersVerticalStripeMate } VerticalStripeMaterial.prototype._getShaderSource = function() { - return "#line 0\n" + ShadersVerticalStripeMaterial; + return '#line 0\n' + ShadersVerticalStripeMaterial; }; return VerticalStripeMaterial; diff --git a/Source/Scene/combineMaterials.js b/Source/Scene/combineMaterials.js index b2216e290ca..6d580c33ea8 100644 --- a/Source/Scene/combineMaterials.js +++ b/Source/Scene/combineMaterials.js @@ -7,7 +7,7 @@ define(function() { */ function combineMaterials() { var unforms = {}; - var concatenatedSource = ""; + var concatenatedSource = ''; var duplicateUniforms = {}; var length = arguments.length; @@ -21,14 +21,14 @@ define(function() { if (unforms[name]) { // Rename uniform var count = duplicateUniforms[name] || 1; - var uniqueName = "_agi_" + name + count.toString(); + var uniqueName = '_agi_' + name + count.toString(); // PERFORMANCE_IDEA: We could cache the RegExp for duplicate uniforms // or see if a pure JavaScript search-and-replace is faster. // This could rename other things like GLSL comments and other identifiers // with the same name. - materialSource = materialSource.replace(new RegExp(name, "g"), uniqueName); + materialSource = materialSource.replace(new RegExp(name, 'g'), uniqueName); unforms[uniqueName] = materialUniforms[name]; duplicateUniforms[name] = count + 1; @@ -42,7 +42,7 @@ define(function() { materialSource = arguments[i].sourceTransform(materialSource); } - concatenatedSource += "#line 0\n" + materialSource; + concatenatedSource += '#line 0\n' + materialSource; } return { diff --git a/Source/ThirdParty/measureText.js b/Source/ThirdParty/measureText.js index 3ecb6cf49c9..d7d18ec4302 100644 --- a/Source/ThirdParty/measureText.js +++ b/Source/ThirdParty/measureText.js @@ -1,5 +1,5 @@ /*! - This library rewrites the Canvas2D "measureText" function + This library rewrites the Canvas2D 'measureText' function so that it returns a more complete metrics object. This library is licensed under the MIT (Expat) license, the text for which is included below. @@ -13,10 +13,10 @@ ----------------------------------------------------------------------------- - Copyright (C) 2011 by Mike "Pomax" Kamermans + Copyright (C) 2011 by Mike 'Pomax' Kamermans Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal + of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is @@ -25,7 +25,7 @@ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER @@ -36,12 +36,12 @@ /*global define*/ define(function() { "use strict"; -// var NAME = "FontMetrics Library"; -// var VERSION = "1-2012.0121.1300"; +// var NAME = 'FontMetrics Library'; +// var VERSION = '1-2012.0121.1300'; // if there is no getComputedStyle, this library won't work. // if(!document.defaultView.getComputedStyle) { -// throw("ERROR: 'document.defaultView.getComputedStyle' not found. This library only works in browsers that can report computed CSS values."); +// throw('ERROR: 'document.defaultView.getComputedStyle' not found. This library only works in browsers that can report computed CSS values.'); // } // store the old text metrics function on the Canvas2D prototype @@ -90,40 +90,40 @@ define(function() { */ return function(context2D, textstring) { var metrics = context2D.measureText(textstring), - fontFamily = getCSSValue(context2D.canvas,"font-family"), - fontSize = getCSSValue(context2D.canvas,"font-size").replace("px",""), + fontFamily = getCSSValue(context2D.canvas,'font-family'), + fontSize = getCSSValue(context2D.canvas,'font-size').replace('px',''), isSpace = !(/\S/.test(textstring)); metrics.fontsize = fontSize; // for text lead values, we meaure a multiline text container. - var leadDiv = document.createElement("div"); - leadDiv.style.position = "absolute"; + var leadDiv = document.createElement('div'); + leadDiv.style.position = 'absolute'; leadDiv.style.opacity = 0; - leadDiv.style.font = fontSize + "px " + fontFamily; - leadDiv.innerHTML = textstring + "
" + textstring; + leadDiv.style.font = fontSize + 'px ' + fontFamily; + leadDiv.innerHTML = textstring + '
' + textstring; document.body.appendChild(leadDiv); // make some initial guess at the text leading (using the standard TeX ratio) metrics.leading = 1.2 * fontSize; // then we try to get the real value from the browser - var leadDivHeight = getCSSValue(leadDiv,"height"); - leadDivHeight = leadDivHeight.replace("px",""); + var leadDivHeight = getCSSValue(leadDiv,'height'); + leadDivHeight = leadDivHeight.replace('px',''); if (leadDivHeight >= fontSize * 2) { metrics.leading = (leadDivHeight/2) | 0; } document.body.removeChild(leadDiv); // if we're not dealing with white space, we can compute metrics if (!isSpace) { // Have characters, so measure the text - var canvas = document.createElement("canvas"); + var canvas = document.createElement('canvas'); var padding = 100; canvas.width = metrics.width + padding; canvas.height = 3*fontSize; canvas.style.opacity = 1; canvas.style.fontFamily = fontFamily; canvas.style.fontSize = fontSize; - var ctx = canvas.getContext("2d"); - ctx.font = fontSize + "px " + fontFamily; + var ctx = canvas.getContext('2d'); + ctx.font = fontSize + 'px ' + fontFamily; var w = canvas.width, h = canvas.height, @@ -131,9 +131,9 @@ define(function() { // Set all canvas pixeldata values to 255, with all the content // data being 0. This lets us scan for data[i] != 255. - ctx.fillStyle = "white"; + ctx.fillStyle = 'white'; ctx.fillRect(-1, -1, w+2, h+2); - ctx.fillStyle = "black"; + ctx.fillStyle = 'black'; ctx.fillText(textstring, padding/2, baseline); var pixelData = ctx.getImageData(0, 0, w, h).data; diff --git a/Specs/Core/AxisAlignedBoundingBoxSpec.js b/Specs/Core/AxisAlignedBoundingBoxSpec.js index 00bdf88a4e5..8c1e47a871f 100644 --- a/Specs/Core/AxisAlignedBoundingBoxSpec.js +++ b/Specs/Core/AxisAlignedBoundingBoxSpec.js @@ -18,22 +18,22 @@ defineSuite([ new Cartesian3(-3, 3, 3) ]; - it("computes the minimum", function() { + it('computes the minimum', function() { var box = new AxisAlignedBoundingBox(positions); expect(box.minimum.equals(new Cartesian3(-3, -3, -3))).toEqual(true); }); - it("computes the maximum", function() { + it('computes the maximum', function() { var box = new AxisAlignedBoundingBox(positions); expect(box.maximum.equals(new Cartesian3(3, 3, 3))).toEqual(true); }); - it("computes a center", function() { + it('computes a center', function() { var box = new AxisAlignedBoundingBox(positions); expect(box.center.equalsEpsilon(Cartesian3.ZERO, Math.EPSILON14)).toEqual(true); }); - it("computes the bounding box for a single position", function() { + it('computes the bounding box for a single position', function() { var box = new AxisAlignedBoundingBox([{ x : 1, y : 2, @@ -45,14 +45,14 @@ defineSuite([ expect(box.center.equals(new Cartesian3(1, 2, 3))).toEqual(true); }); - it("has undefined properties with positions of length zero", function() { + it('has undefined properties with positions of length zero', function() { var box = new AxisAlignedBoundingBox([]); expect(box.minimum).not.toBeDefined(); expect(box.maximum).not.toBeDefined(); expect(box.center).not.toBeDefined(); }); - it("throws an exception when constructed without any positions", function() { + it('throws an exception when constructed without any positions', function() { expect(function() { return new AxisAlignedBoundingBox(undefined); }).toThrow(); diff --git a/Specs/Core/BoundingSphereSpec.js b/Specs/Core/BoundingSphereSpec.js index fcf4c875414..9e01e9b6d6b 100644 --- a/Specs/Core/BoundingSphereSpec.js +++ b/Specs/Core/BoundingSphereSpec.js @@ -22,31 +22,31 @@ defineSuite([ ]; } - it("throws an exception when constructed without any positions", function() { + it('throws an exception when constructed without any positions', function() { expect(function() { return new BoundingSphere(); }).toThrow(); }); - it("can be constructed using a point and a radius", function() { + it('can be constructed using a point and a radius', function() { var sphere = new BoundingSphere(new Cartesian3(0, 0, 0), 1); expect(sphere.center.equals(Cartesian3.ZERO)).toEqual(true); expect(sphere.radius).toEqual(1); }); - it("has a center", function() { + it('has a center', function() { var sphere = new BoundingSphere(getPositions()); var center = sphere.center; expect(center.equalsEpsilon(Cartesian3.ZERO, CesiumMath.EPSILON14)).toEqual(true); }); - it("has a radius", function() { + it('has a radius', function() { var sphere = new BoundingSphere(getPositions()); var radius = sphere.radius; expect(radius).toEqual(1); }); - it("contains all points (naive)", function() { + it('contains all points (naive)', function() { var sphere = new BoundingSphere(getPositions()); var radius = sphere.radius; var center = sphere.center; @@ -65,7 +65,7 @@ defineSuite([ } }); - it("contains all points (ritter)", function() { + it('contains all points (ritter)', function() { var positions = getPositions(); positions.push(new Cartesian3(1, 1, 1), new Cartesian3(2, 2, 2), new Cartesian3(3, 3, 3)); var sphere = new BoundingSphere(positions); diff --git a/Specs/Core/BoxTessellatorSpec.js b/Specs/Core/BoxTessellatorSpec.js index 02cfbe36f1d..daa1a0c7bdc 100644 --- a/Specs/Core/BoxTessellatorSpec.js +++ b/Specs/Core/BoxTessellatorSpec.js @@ -8,7 +8,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("compute0", function() { + it('compute0', function() { expect(function() { return BoxTessellator.compute({ dimensions : new Cartesian3(1, 2, -1) @@ -16,7 +16,7 @@ defineSuite([ }).toThrow(); }); - it("compute1", function() { + it('compute1', function() { var m = BoxTessellator.compute({ dimensions : new Cartesian3(1, 2, 3) }); @@ -25,7 +25,7 @@ defineSuite([ expect(m.indexLists[0].values.length).toEqual(12 * 3); }); - it("compute2", function() { + it('compute2', function() { expect(function() { return BoxTessellator.compute({ minimumCorner : new Cartesian3(0, 0, 0), diff --git a/Specs/Core/CachePoliciesSpec.js b/Specs/Core/CachePoliciesSpec.js index 9ce045397ba..3fceb7280e2 100644 --- a/Specs/Core/CachePoliciesSpec.js +++ b/Specs/Core/CachePoliciesSpec.js @@ -8,7 +8,7 @@ defineSuite([ "use strict"; /*global it,expect,describe,beforeEach*/ - describe("LRU", function() { + describe('LRU', function() { var LRU = CachePolicy.LRU; var Key = function(value) { @@ -38,19 +38,19 @@ defineSuite([ })); }); - it("constructor throws on invalid fetch function", function() { + it('constructor throws on invalid fetch function', function() { expect(function() { return new LRU(); }).toThrow(); expect(function() { return new LRU({ - fetchFunc : "not-a-function" + fetchFunc : 'not-a-function' }); }).toThrow(); }); - it("hit is in cache", function() { + it('hit is in cache', function() { var keys = []; var i = 0; for (; i < limit; ++i) { @@ -66,7 +66,7 @@ defineSuite([ expect(lastRemoved === null).toEqual(true); }); - it("miss replaces lru", function() { + it('miss replaces lru', function() { var keys = []; var i = 0; for (; i < limit + 1; ++i) { diff --git a/Specs/Core/CacheSpec.js b/Specs/Core/CacheSpec.js index cc75fcc98c7..a6c389812a9 100644 --- a/Specs/Core/CacheSpec.js +++ b/Specs/Core/CacheSpec.js @@ -46,55 +46,55 @@ defineSuite([ cache = new Cache(new AddAlways(fetch)); }); - it("constructor throws with no policy", function() { + it('constructor throws with no policy', function() { expect(function() { return new Cache(); }).toThrow(); }); - it("constructor throws when policy has no hit function", function() { + it('constructor throws when policy has no hit function', function() { expect(function() { return new Cache({ miss : function() { - return "nonsense"; + return 'nonsense'; } }); }).toThrow(); }); - it("constructor throws when policy has no miss function", function() { + it('constructor throws when policy has no miss function', function() { expect(function() { return new Cache({ hit : function() { - return "nonsense"; + return 'nonsense'; } }); }).toThrow(); }); - it("find throws with no key", function() { + it('find throws with no key', function() { expect(function() { cache.find(); }).toThrow(); expect(function() { cache.find({ - nonsense : "nonsense" + nonsense : 'nonsense' }); }).toThrow(); }); - it("find", function() { + it('find', function() { var tenth = { n : 10, - key : "10" + key : '10' }; var fn = cache.find(tenth); expect(fn.fibonacciNumber).toEqual(55); var eleventh = { n : 11, - key : "11" + key : '11' }; var fn2 = cache.find(eleventh); expect(fn2.fibonacciNumber).toEqual(89); @@ -106,10 +106,10 @@ defineSuite([ expect(fn2.timesHit).toEqual(timesHit); }); - it("remove", function() { + it('remove', function() { var thirteenth = { n : 13, - key : "13" + key : '13' }; expect(cache.remove(thirteenth)).toEqual(false); @@ -119,36 +119,36 @@ defineSuite([ expect(cache.find(thirteenth).timesHit).toBeFalsy(); expect(cache.remove({ n : 14, - key : "14" + key : '14' })).toEqual(false); }); - it("remove returns false with no key", function() { + it('remove returns false with no key', function() { var result = cache.remove(); expect(result).toEqual(false); }); - it("remove returns false with null key", function() { - var result = cache.remove({"key": null}); + it('remove returns false with null key', function() { + var result = cache.remove({'key': null}); expect(result).toEqual(false); }); - it("destroy", function() { + it('destroy', function() { cache = cache && cache.destroy(); expect(cache).toBeUndefined(); }); - it("destroys cache with keys", function() { + it('destroys cache with keys', function() { var tenth = { n : 10, - key : "10" + key : '10' }; cache.find(tenth); cache = cache && cache.destroy(); expect(cache).toBeUndefined(); }); - it("isDestroyed returns false", function() { + it('isDestroyed returns false', function() { expect(cache.isDestroyed()).toEqual(false); }); }); diff --git a/Specs/Core/Cartesian2Spec.js b/Specs/Core/Cartesian2Spec.js index 6ac39fecace..7d71e1a5948 100644 --- a/Specs/Core/Cartesian2Spec.js +++ b/Specs/Core/Cartesian2Spec.js @@ -3,113 +3,113 @@ defineSuite(['Core/Cartesian2'], function(Cartesian2) { "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var v = new Cartesian2(); expect(v.x).toEqual(0); expect(v.y).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var v = new Cartesian2(1); expect(v.x).toEqual(1); expect(v.y).toEqual(0); }); - it("construct2", function() { + it('construct2', function() { var v = new Cartesian2(1, 2); expect(v.x).toEqual(1); expect(v.y).toEqual(2); }); - it("clone", function() { + it('clone', function() { var v = new Cartesian2(1, 2); var w = v.clone(); expect(v.equals(w)).toEqual(true); }); - it("non-prototypal clone", function() { + it('non-prototypal clone', function() { var v = new Cartesian2(1, 2); var w = Cartesian2.clone(v); expect(v.equals(w)).toEqual(true); }); - it("ZERO", function() { + it('ZERO', function() { var v = Cartesian2.ZERO; expect(v.x).toEqual(0); expect(v.y).toEqual(0); }); - it("UNIT_X", function() { + it('UNIT_X', function() { var v = Cartesian2.UNIT_X; expect(v.x).toEqual(1); expect(v.y).toEqual(0); }); - it("UNIT_Y", function() { + it('UNIT_Y', function() { var v = Cartesian2.UNIT_Y; expect(v.x).toEqual(0); expect(v.y).toEqual(1); }); - it("magnitudeSquared", function() { + it('magnitudeSquared', function() { var v = new Cartesian2(2, 3); expect(v.magnitudeSquared()).toEqual(13); }); - it("magnitude", function() { + it('magnitude', function() { var v = new Cartesian2(2, 3); expect(v.magnitude()).toEqual(Math.sqrt(13)); }); - it("normalize", function() { + it('normalize', function() { var v = new Cartesian2(2, 0).normalize(); expect(v.x).toEqual(1); expect(v.y).toEqual(0); }); - it("dot", function() { + it('dot', function() { var s = new Cartesian2(2, 3).dot(new Cartesian2(4, 5)); expect(s).toEqual(2 * 4 + 3 * 5); }); - it("add", function() { + it('add', function() { var v = new Cartesian2(1, 2).add(new Cartesian2(3, 4)); expect(v.equals(new Cartesian2(4, 6))).toEqual(true); }); - it("multiplyWithScalar", function() { + it('multiplyWithScalar', function() { var v = new Cartesian2(1, 2).multiplyWithScalar(2); expect(v.equals(new Cartesian2(2, 4))).toEqual(true); }); - it("divideByScalar", function() { + it('divideByScalar', function() { var v = new Cartesian2(2, 4).divideByScalar(2); expect(v.equals(new Cartesian2(1, 2))).toEqual(true); }); - it("negate", function() { + it('negate', function() { var v = new Cartesian2(1, 2).negate(); expect(v.equals(new Cartesian2(-1, -2))).toEqual(true); }); - it("abs", function() { + it('abs', function() { var v = new Cartesian2(-1, -2).abs(); expect(v.equals(new Cartesian2(1, 2))).toEqual(true); }); - it("subtract", function() { + it('subtract', function() { var v = new Cartesian2(3, 4).subtract(new Cartesian2(2, 1)); expect(v.equals(new Cartesian2(1, 3))).toEqual(true); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Cartesian2(1, 2).equalsEpsilon(new Cartesian2(1, 2), 0)).toEqual(true); expect(new Cartesian2(1, 2).equalsEpsilon(new Cartesian2(2, 2), 1)).toEqual(true); expect(new Cartesian2(1, 2).equalsEpsilon(new Cartesian2(3, 2), 1)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var v = new Cartesian2(1, 2); - expect(v.toString()).toEqual("(1, 2)"); + expect(v.toString()).toEqual('(1, 2)'); }); }); diff --git a/Specs/Core/Cartesian3Spec.js b/Specs/Core/Cartesian3Spec.js index 95992161881..49d3faaeabf 100644 --- a/Specs/Core/Cartesian3Spec.js +++ b/Specs/Core/Cartesian3Spec.js @@ -10,179 +10,179 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var v = new Cartesian3(); expect(v.x).toEqual(0); expect(v.y).toEqual(0); expect(v.z).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var v = new Cartesian3(1); expect(v.x).toEqual(1); expect(v.y).toEqual(0); expect(v.z).toEqual(0); }); - it("construct2", function() { + it('construct2', function() { var v = new Cartesian3(1, 2); expect(v.x).toEqual(1); expect(v.y).toEqual(2); expect(v.z).toEqual(0); }); - it("construct3", function() { + it('construct3', function() { var v = new Cartesian3(1, 2, 3); expect(v.x).toEqual(1); expect(v.y).toEqual(2); expect(v.z).toEqual(3); }); - it("clone", function() { + it('clone', function() { var v = new Cartesian3(1, 2, 3); var w = v.clone(); expect(v.equals(w)).toEqual(true); }); - it("ZERO", function() { + it('ZERO', function() { var v = Cartesian3.ZERO; expect(v.x).toEqual(0); expect(v.y).toEqual(0); expect(v.z).toEqual(0); }); - it("UNIT_X", function() { + it('UNIT_X', function() { var v = Cartesian3.UNIT_X; expect(v.x).toEqual(1); expect(v.y).toEqual(0); expect(v.z).toEqual(0); }); - it("UNIT_Y", function() { + it('UNIT_Y', function() { var v = Cartesian3.UNIT_Y; expect(v.x).toEqual(0); expect(v.y).toEqual(1); expect(v.z).toEqual(0); }); - it("UNIT_Z", function() { + it('UNIT_Z', function() { var v = Cartesian3.UNIT_Z; expect(v.x).toEqual(0); expect(v.y).toEqual(0); expect(v.z).toEqual(1); }); - it("getXY", function() { + it('getXY', function() { var v = new Cartesian3(1, 2, 3); expect(v.getXY().equals(new Cartesian2(1, 2))).toEqual(true); expect(v.z).toEqual(3); }); - it("magnitudeSquared", function() { + it('magnitudeSquared', function() { var v = new Cartesian3(2, 3, 4); expect(v.magnitudeSquared()).toEqual(29); }); - it("magnitude", function() { + it('magnitude', function() { var v = new Cartesian3(2, 3, 4); expect(v.magnitude()).toEqual(Math.sqrt(29)); }); - it("normalize", function() { + it('normalize', function() { var v = new Cartesian3(0, 2, 0).normalize(); expect(v.x).toEqual(0); expect(v.y).toEqual(1); expect(v.z).toEqual(0); }); - it("cross", function() { + it('cross', function() { var c = new Cartesian3(1, 0, 0).cross(new Cartesian3(0, 1, 0)); expect(c.equals(new Cartesian3(0, 0, 1))).toEqual(true); }); - it("dot", function() { + it('dot', function() { var s = new Cartesian3(2, 3, 4).dot(new Cartesian3(5, 6, 7)); expect(s).toEqual(2 * 5 + 3 * 6 + 4 * 7); }); - it("add", function() { + it('add', function() { var v = new Cartesian3(1, 2, 3).add(new Cartesian3(4, 5, 6)); expect(v.equals(new Cartesian3(5, 7, 9))).toEqual(true); }); - it("multiplyWithScalar", function() { + it('multiplyWithScalar', function() { var v = new Cartesian3(1, 2, 3).multiplyWithScalar(2); expect(v.equals(new Cartesian3(2, 4, 6))).toEqual(true); }); - it("multiplyComponents", function() { + it('multiplyComponents', function() { var v = new Cartesian3(1, 2, 3).multiplyComponents(new Cartesian3(4, 5, 6)); expect(v.equals(new Cartesian3(4, 10, 18))).toEqual(true); }); - it("divideByScalar", function() { + it('divideByScalar', function() { var v = new Cartesian3(2, 4, 6).divideByScalar(2); expect(v.equals(new Cartesian3(1, 2, 3))).toEqual(true); }); - it("getMinimumComponent", function() { + it('getMinimumComponent', function() { var v = new Cartesian3(1, 2, 3); expect(v.getMinimumComponent()).toEqual(1); }); - it("getMaximumComponent", function() { + it('getMaximumComponent', function() { var v = new Cartesian3(1, 2, 3); expect(v.getMaximumComponent()).toEqual(3); }); - it("mostOrthogonalAxis", function() { + it('mostOrthogonalAxis', function() { expect(new Cartesian3(1, 2, 3).mostOrthogonalAxis().equals(Cartesian3.UNIT_X)).toEqual(true); expect(new Cartesian3(3, 1, 2).mostOrthogonalAxis().equals(Cartesian3.UNIT_Y)).toEqual(true); expect(new Cartesian3(2, 3, 1).mostOrthogonalAxis().equals(Cartesian3.UNIT_Z)).toEqual(true); }); - it("angleBetween", function() { + it('angleBetween', function() { var x = Cartesian3.UNIT_X; var y = Cartesian3.UNIT_Y; expect(x.angleBetween(x)).toEqual(0); expect(x.angleBetween(y)).toEqual(CesiumMath.PI_OVER_TWO); }); - it("rotateAroundAxis", function() { + it('rotateAroundAxis', function() { var x = Cartesian3.UNIT_X; var z = Cartesian3.UNIT_Z; expect(x.rotateAroundAxis(z, CesiumMath.PI_OVER_TWO).equalsEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON14)).toEqual(true); expect(x.rotateAroundAxis(z, Math.PI).equalsEpsilon(x.negate(), CesiumMath.EPSILON14)).toEqual(true); }); - it("negate", function() { + it('negate', function() { var v = new Cartesian3(1, 2, 3).negate(); expect(v.equals(new Cartesian3(-1, -2, -3))).toEqual(true); }); - it("abs", function() { + it('abs', function() { var v = new Cartesian2(-1, -2, -3).abs(); expect(v.equals(new Cartesian2(1, 2, 3))).toEqual(true); }); - it("subtract", function() { + it('subtract', function() { var v = new Cartesian3(3, 4, 5).subtract(new Cartesian3(3, 2, 1)); expect(v.equals(new Cartesian3(0, 2, 4))).toEqual(true); }); - it("lerp", function() { + it('lerp', function() { var v = new Cartesian3(4, 8, 12).lerp(new Cartesian3(8, 20, 16), 0.25); expect(v.equals(new Cartesian3(5, 11, 13))).toEqual(true); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Cartesian3(1, 2, 1).equalsEpsilon(new Cartesian3(1, 2, 1), 0)).toEqual(true); expect(new Cartesian3(1, 2, 1).equalsEpsilon(new Cartesian3(1, 2, 2), 1)).toEqual(true); expect(new Cartesian3(1, 2, 1).equalsEpsilon(new Cartesian3(1, 2, 3), 1)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var v = new Cartesian3(1, 2, 3); - expect(v.toString()).toEqual("(1, 2, 3)"); + expect(v.toString()).toEqual('(1, 2, 3)'); }); }); \ No newline at end of file diff --git a/Specs/Core/Cartesian4Spec.js b/Specs/Core/Cartesian4Spec.js index 30fca5d501d..dcca09d0c86 100644 --- a/Specs/Core/Cartesian4Spec.js +++ b/Specs/Core/Cartesian4Spec.js @@ -10,7 +10,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var v = new Cartesian4(); expect(v.x).toEqual(0); expect(v.y).toEqual(0); @@ -18,7 +18,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var v = new Cartesian4(1); expect(v.x).toEqual(1); expect(v.y).toEqual(0); @@ -26,7 +26,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("construct2", function() { + it('construct2', function() { var v = new Cartesian4(1, 2); expect(v.x).toEqual(1); expect(v.y).toEqual(2); @@ -34,7 +34,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("construct3", function() { + it('construct3', function() { var v = new Cartesian4(1, 2, 3); expect(v.x).toEqual(1); expect(v.y).toEqual(2); @@ -42,7 +42,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("construct4", function() { + it('construct4', function() { var v = new Cartesian4(1, 2, 3, 4); expect(v.x).toEqual(1); expect(v.y).toEqual(2); @@ -50,13 +50,13 @@ defineSuite([ expect(v.w).toEqual(4); }); - it("clone", function() { + it('clone', function() { var v = new Cartesian4(1, 2, 3, 4); var w = v.clone(); expect(v.equals(w)).toEqual(true); }); - it("ZERO", function() { + it('ZERO', function() { var v = Cartesian4.ZERO; expect(v.x).toEqual(0); expect(v.y).toEqual(0); @@ -64,7 +64,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("UNIT_X", function() { + it('UNIT_X', function() { var v = Cartesian4.UNIT_X; expect(v.x).toEqual(1); expect(v.y).toEqual(0); @@ -72,7 +72,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("UNIT_Y", function() { + it('UNIT_Y', function() { var v = Cartesian4.UNIT_Y; expect(v.x).toEqual(0); expect(v.y).toEqual(1); @@ -80,7 +80,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("UNIT_Z", function() { + it('UNIT_Z', function() { var v = Cartesian4.UNIT_Z; expect(v.x).toEqual(0); expect(v.y).toEqual(0); @@ -88,7 +88,7 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("UNIT_W", function() { + it('UNIT_W', function() { var v = Cartesian4.UNIT_W; expect(v.x).toEqual(0); expect(v.y).toEqual(0); @@ -96,30 +96,30 @@ defineSuite([ expect(v.w).toEqual(1); }); - it("getXYZ", function() { + it('getXYZ', function() { var v = new Cartesian4(1, 2, 3, 4); expect(v.getXYZ().equals(new Cartesian3(1, 2, 3))).toEqual(true); expect(v.w).toEqual(4); }); - it("getXY", function() { + it('getXY', function() { var v = new Cartesian4(1, 2, 3, 4); expect(v.getXY().equals(new Cartesian2(1, 2))).toEqual(true); expect(v.z).toEqual(3); expect(v.w).toEqual(4); }); - it("magnitudeSquared", function() { + it('magnitudeSquared', function() { var v = new Cartesian4(2, 3, 4, 5); expect(v.magnitudeSquared()).toEqual(54); }); - it("magnitude", function() { + it('magnitude', function() { var v = new Cartesian4(2, 3, 4, 5); expect(v.magnitude()).toEqual(Math.sqrt(54)); }); - it("normalize", function() { + it('normalize', function() { var v = new Cartesian4(0, 2, 0, 0).normalize(); expect(v.x).toEqual(0); expect(v.y).toEqual(1); @@ -127,71 +127,71 @@ defineSuite([ expect(v.w).toEqual(0); }); - it("dot", function() { + it('dot', function() { var s = new Cartesian4(2, 3, 4, 5).dot(new Cartesian4(6, 7, 8, 9)); expect(s).toEqual(2 * 6 + 3 * 7 + 4 * 8 + 5 * 9); }); - it("add", function() { + it('add', function() { var v = new Cartesian4(1, 2, 3, 4).add(new Cartesian4(5, 6, 7, 8)); expect(v.equals(new Cartesian4(6, 8, 10, 12))).toEqual(true); }); - it("multiplyWithScalar", function() { + it('multiplyWithScalar', function() { var v = new Cartesian4(1, 2, 3, 4).multiplyWithScalar(2); expect(v.equals(new Cartesian4(2, 4, 6, 8))).toEqual(true); }); - it("multiplyComponents", function() { + it('multiplyComponents', function() { var v = new Cartesian4(1, 2, 3, 4).multiplyComponents(new Cartesian4(5, 6, 7, 8)); expect(v.equals(new Cartesian4(5, 12, 21, 32))).toEqual(true); }); - it("divideByScalar", function() { + it('divideByScalar', function() { var v = new Cartesian4(2, 4, 6, 8).divideByScalar(2); expect(v.equals(new Cartesian4(1, 2, 3, 4))).toEqual(true); }); - it("getMinimumComponent", function() { + it('getMinimumComponent', function() { var v = new Cartesian4(1, 2, 3, 4); expect(v.getMinimumComponent()).toEqual(1); }); - it("getMaximumComponent", function() { + it('getMaximumComponent', function() { var v = new Cartesian4(1, 2, 3, 4); expect(v.getMaximumComponent()).toEqual(4); }); - it("mostOrthogonalAxis", function() { + it('mostOrthogonalAxis', function() { expect(new Cartesian4(1, 2, 3, 4).mostOrthogonalAxis().equals(Cartesian4.UNIT_X)).toEqual(true); expect(new Cartesian4(4, 1, 2, 3).mostOrthogonalAxis().equals(Cartesian4.UNIT_Y)).toEqual(true); expect(new Cartesian4(3, 4, 1, 2).mostOrthogonalAxis().equals(Cartesian4.UNIT_Z)).toEqual(true); expect(new Cartesian4(2, 3, 4, 1).mostOrthogonalAxis().equals(Cartesian4.UNIT_W)).toEqual(true); }); - it("negate", function() { + it('negate', function() { var v = new Cartesian4(1, 2, 3, 4).negate(); expect(v.equals(new Cartesian4(-1, -2, -3, -4))).toEqual(true); }); - it("abs", function() { + it('abs', function() { var v = new Cartesian4(-1, -2, -3, -4).abs(); expect(v.equals(new Cartesian4(1, 2, 3, 4))).toEqual(true); }); - it("subtract", function() { + it('subtract', function() { var v = new Cartesian4(4, 5, 6, 7).subtract(new Cartesian4(4, 3, 2, 1)); expect(v.equals(new Cartesian4(0, 2, 4, 6))).toEqual(true); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Cartesian4(1, 1, 2, 1).equalsEpsilon(new Cartesian4(1, 1, 2, 1), 0)).toEqual(true); expect(new Cartesian4(1, 1, 2, 1).equalsEpsilon(new Cartesian4(1, 1, 2, 2), 1)).toEqual(true); expect(new Cartesian4(1, 1, 2, 1).equalsEpsilon(new Cartesian4(1, 1, 2, 3), 1)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var v = new Cartesian4(1, 2, 3, 4); - expect(v.toString()).toEqual("(1, 2, 3, 4)"); + expect(v.toString()).toEqual('(1, 2, 3, 4)'); }); }); \ No newline at end of file diff --git a/Specs/Core/Cartographic2Spec.js b/Specs/Core/Cartographic2Spec.js index 36b800cbd48..da63c0c0839 100644 --- a/Specs/Core/Cartographic2Spec.js +++ b/Specs/Core/Cartographic2Spec.js @@ -8,31 +8,31 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var c = new Cartographic2(); expect(c.longitude).toEqual(0); expect(c.latitude).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var c = new Cartographic2(new Cartographic3(1, 2, 3)); expect(c.longitude).toEqual(1); expect(c.latitude).toEqual(2); }); - it("construct2", function() { + it('construct2', function() { var c = new Cartographic2(1, 2); expect(c.longitude).toEqual(1); expect(c.latitude).toEqual(2); }); - it("getZero", function() { + it('getZero', function() { var c = Cartographic2.ZERO; expect(c.longitude).toEqual(0); expect(c.latitude).toEqual(0); }); - it("clones itself", function() { + it('clones itself', function() { var c = new Cartographic2(0, 1); var c2 = c.clone(); expect(c.equals(c2)).toEqual(true); @@ -41,14 +41,14 @@ defineSuite([ expect(c.equals(c2)).toEqual(false); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Cartographic2(1, 2).equalsEpsilon(new Cartographic2(1, 2), 0)).toEqual(true); expect(new Cartographic2(1, 2).equalsEpsilon(new Cartographic2(2, 2), 1)).toEqual(true); expect(new Cartographic2(1, 2).equalsEpsilon(new Cartographic2(3, 2), 1)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var c = new Cartographic2(1, 2); - expect(c.toString()).toEqual("(1, 2)"); + expect(c.toString()).toEqual('(1, 2)'); }); }); diff --git a/Specs/Core/Cartographic3Spec.js b/Specs/Core/Cartographic3Spec.js index 64b065a7067..02b829ff494 100644 --- a/Specs/Core/Cartographic3Spec.js +++ b/Specs/Core/Cartographic3Spec.js @@ -8,42 +8,42 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var c = new Cartographic3(); expect(c.longitude).toEqual(0); expect(c.latitude).toEqual(0); expect(c.height).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var c = new Cartographic3(new Cartographic2(1, 2)); expect(c.longitude).toEqual(1); expect(c.latitude).toEqual(2); expect(c.height).toEqual(0); }); - it("construct2", function() { + it('construct2', function() { var c = new Cartographic3(1, 2); expect(c.longitude).toEqual(1); expect(c.latitude).toEqual(2); expect(c.height).toEqual(0); }); - it("construct3", function() { + it('construct3', function() { var c = new Cartographic3(1, 2, 3); expect(c.longitude).toEqual(1); expect(c.latitude).toEqual(2); expect(c.height).toEqual(3); }); - it("getZero", function() { + it('getZero', function() { var c = Cartographic3.ZERO; expect(c.longitude).toEqual(0); expect(c.latitude).toEqual(0); expect(c.height).toEqual(0); }); - it("clones itself", function() { + it('clones itself', function() { var c = new Cartographic3(0, 1, 2); var c2 = c.clone(); expect(c.equals(c2)).toEqual(true); @@ -52,14 +52,14 @@ defineSuite([ expect(c.equals(c2)).toEqual(false); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Cartographic3(0, 2, 1).equalsEpsilon(new Cartographic3(0, 2, 1), 0)).toEqual(true); expect(new Cartographic3(0, 2, 1).equalsEpsilon(new Cartographic3(0, 2, 2), 1)).toEqual(true); expect(new Cartographic3(0, 2, 1).equalsEpsilon(new Cartographic3(0, 2, 3), 1)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var c = new Cartographic3(1, 2, 3); - expect(c.toString()).toEqual("(1, 2, 3)"); + expect(c.toString()).toEqual('(1, 2, 3)'); }); }); diff --git a/Specs/Core/CatmullRomSplineSpec.js b/Specs/Core/CatmullRomSplineSpec.js index 5d0b9dc8f75..cb8b4c255a1 100644 --- a/Specs/Core/CatmullRomSplineSpec.js +++ b/Specs/Core/CatmullRomSplineSpec.js @@ -29,7 +29,7 @@ defineSuite([ }]; }); - it("constructor throws an exception with invalid control points", function() { + it('constructor throws an exception with invalid control points', function() { expect(function() { return new CatmullRomSpline(); }).toThrow(); @@ -43,12 +43,12 @@ defineSuite([ }).toThrow(); }); - it("get control points", function() { + it('get control points', function() { var crs = new CatmullRomSpline(points); expect(crs.getControlPoints()).toEqual(points); }); - it("get start and end tangents", function() { + it('get start and end tangents', function() { var start = points[1].point.subtract(points[0].point); var end = points[points.length - 1].point.subtract(points[points.length - 2].point); var crs = new CatmullRomSpline(points, start, end); @@ -57,7 +57,7 @@ defineSuite([ expect(end.equals(crs.getEndTangent())).toEqual(true); }); - it("evaluate fails with undefined time", function() { + it('evaluate fails with undefined time', function() { var crs = new CatmullRomSpline(points); expect(function() { @@ -65,7 +65,7 @@ defineSuite([ }).toThrow(); }); - it("evaluate fails with time out of range", function() { + it('evaluate fails with time out of range', function() { var crs = new CatmullRomSpline(points); expect(function() { @@ -77,7 +77,7 @@ defineSuite([ }).toThrow(); }); - it("check Catmull-Rom spline against a Hermite spline", function() { + it('check Catmull-Rom spline against a Hermite spline', function() { var crs = new CatmullRomSpline(points); points[0].tangent = crs.getStartTangent(); diff --git a/Specs/Core/CubeMapEllipsoidTessellatorSpec.js b/Specs/Core/CubeMapEllipsoidTessellatorSpec.js index e57a26c61aa..8f7d41b30e7 100644 --- a/Specs/Core/CubeMapEllipsoidTessellatorSpec.js +++ b/Specs/Core/CubeMapEllipsoidTessellatorSpec.js @@ -12,27 +12,27 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("compute0", function() { + it('compute0', function() { expect(function() { return CubeMapEllipsoidTessellator.compute(Ellipsoid.UNIT_SPHERE, -1); }).toThrow(); }); - it("compute1", function() { + it('compute1', function() { var m = CubeMapEllipsoidTessellator.compute(Ellipsoid.UNIT_SPHERE, 1); expect(m.attributes.position.values.length).toEqual(3 * 8); expect(m.indexLists[0].values.length).toEqual(12 * 3); }); - it("compute2", function() { + it('compute2', function() { var m = CubeMapEllipsoidTessellator.compute(Ellipsoid.UNIT_SPHERE, 2); expect(m.attributes.position.values.length).toEqual(3 * (8 + 6 + 12)); expect(m.indexLists[0].values.length).toEqual(2 * 3 * 4 * 6); }); - it("compute3", function() { + it('compute3', function() { var m = CubeMapEllipsoidTessellator.compute(Ellipsoid.UNIT_SPHERE, 3); var position = m.attributes.position.values; diff --git a/Specs/Core/EllipsoidSpec.js b/Specs/Core/EllipsoidSpec.js index 3f20a723e0b..6d45b0a42ff 100644 --- a/Specs/Core/EllipsoidSpec.js +++ b/Specs/Core/EllipsoidSpec.js @@ -14,7 +14,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct", function() { + it('construct', function() { var e = new Ellipsoid(new Cartesian3(1, 2, 3)); expect(e.getRadii().equals(new Cartesian3(1, 2, 3))).toEqual(true); @@ -23,13 +23,13 @@ defineSuite([ expect(e.getOneOverRadiiSquared().equals(new Cartesian3(1 / (1 * 1), 1 / (2 * 2), 1 / (3 * 3)))).toEqual(true); }); - it("throws with no arguments", function() { + it('throws with no arguments', function() { expect(function() { return new Ellipsoid(); }).toThrow(); }); - it("throws with negative radii componenets", function() { + it('throws with negative radii componenets', function() { expect(function() { return new Ellipsoid({ x: -1, @@ -39,30 +39,30 @@ defineSuite([ }).toThrow(); }); - it("getMinimumRadius", function() { + it('getMinimumRadius', function() { expect(new Ellipsoid(new Cartesian3(1, 2, 3)).getMinimumRadius()).toEqual(1); }); - it("getMaximumRadius", function() { + it('getMaximumRadius', function() { expect(new Ellipsoid(new Cartesian3(1, 2, 3)).getMaximumRadius()).toEqual(3); }); - it("geocentricSurfaceNormal", function() { + it('geocentricSurfaceNormal', function() { var v = new Cartesian3(1, 2, 3); expect(v.normalize().equals(Ellipsoid.geocentricSurfaceNormal(v))).toEqual(true); }); - it("geodeticSurfaceNormal", function() { + it('geodeticSurfaceNormal', function() { expect(Cartesian3.UNIT_X.equals(Ellipsoid.UNIT_SPHERE.geodeticSurfaceNormal(Cartesian3.UNIT_X))).toEqual(true); expect(Cartesian3.UNIT_Z.equals(Ellipsoid.UNIT_SPHERE.geodeticSurfaceNormal(Cartesian3.UNIT_Z))).toEqual(true); }); - it("geodeticSurfaceNormalc", function() { + it('geodeticSurfaceNormalc', function() { expect(Cartesian3.UNIT_X.equalsEpsilon(Ellipsoid.UNIT_SPHERE.geodeticSurfaceNormalc(Cartographic3.ZERO), CesiumMath.EPSILON10)).toEqual(true); expect(Cartesian3.UNIT_Z.equalsEpsilon(Ellipsoid.UNIT_SPHERE.geodeticSurfaceNormalc(new Cartographic3(0, CesiumMath.PI_OVER_TWO, 0)), CesiumMath.EPSILON10)).toEqual(true); }); - it("toCartesian", function() { + it('toCartesian', function() { var ellipsoid = new Ellipsoid(new Cartesian3(1, 1, 0.7)); expect(Cartesian3.UNIT_X.equalsEpsilon(ellipsoid.toCartesian(new Cartographic2(0, 0)), CesiumMath.EPSILON10)).toEqual(true); @@ -72,7 +72,7 @@ defineSuite([ expect(new Cartesian3(0, 0, 0.7).equalsEpsilon(ellipsoid.toCartesian(new Cartographic2(0, CesiumMath.toRadians(90))), CesiumMath.EPSILON10)).toEqual(true); }); - it("toCartesian", function() { + it('toCartesian', function() { var ellipsoid = new Ellipsoid(new Cartesian3(1, 1, 0.7)); expect(new Cartesian3(2, 0, 0).equalsEpsilon(ellipsoid.toCartesian(new Cartographic3(0, 0, 1)), CesiumMath.EPSILON10)).toEqual(true); @@ -82,7 +82,7 @@ defineSuite([ expect(new Cartesian3(0, 0, 1.7).equalsEpsilon(ellipsoid.toCartesian(new Cartographic3(0, CesiumMath.toRadians(90), 1)), CesiumMath.EPSILON10)).toEqual(true); }); - it("toCartesians", function() { + it('toCartesians', function() { var ellipsoid = new Ellipsoid(new Cartesian3(1, 1, 0.7)); var cartographics = [new Cartographic3(0, 0, 1), new Cartographic3(CesiumMath.toRadians(90), 0, 1), @@ -93,7 +93,7 @@ defineSuite([ expect(cartesians[2].equalsEpsilon(new Cartesian3(0, 0, 1.7), CesiumMath.EPSILON10)).toEqual(true); }); - it("toCartographic3", function() { + it('toCartographic3', function() { var ellipsoid = Ellipsoid.WGS84; expect(Cartographic3.ZERO.equalsEpsilon(ellipsoid.toCartographic3(ellipsoid.toCartesian(Cartographic3.ZERO)), CesiumMath.EPSILON8)).toEqual(true); @@ -105,7 +105,7 @@ defineSuite([ expect(p2.equalsEpsilon(ellipsoid.toCartographic3(ellipsoid.toCartesian(p2)), CesiumMath.EPSILON3)).toEqual(true); }); - it("toCartographic3s", function() { + it('toCartographic3s', function() { var ellipsoid = Ellipsoid.WGS84; var p1 = Cartographic3.ZERO; var p2 = new Cartographic3(CesiumMath.toRadians(45), CesiumMath.toRadians(-60), -123.4); @@ -119,7 +119,7 @@ defineSuite([ expect(cartographics[2].equalsEpsilon(p3, CesiumMath.EPSILON9)).toEqual(true); }); - it("toCartographic2", function() { + it('toCartographic2', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; expect(Cartographic2.ZERO.equalsEpsilon(unitSphere.toCartographic2(Cartesian3.UNIT_X), CesiumMath.EPSILON8)).toEqual(true); @@ -127,7 +127,7 @@ defineSuite([ expect(new Cartographic2(0, CesiumMath.PI_OVER_TWO).equalsEpsilon(unitSphere.toCartographic2(Cartesian3.UNIT_Z), CesiumMath.EPSILON8)).toEqual(true); }); - it("can convert cartographicDegrees to Cartesian", function() { + it('can convert cartographicDegrees to Cartesian', function() { var ellipsoid = Ellipsoid.WGS84; var lon = 45, lat = -60, height = 123.4; @@ -141,13 +141,13 @@ defineSuite([ expect(expected[0].equalsEpsilon(actual[0], CesiumMath.EPSILON8)).toEqual(true); }); - it("scaleToGeocentricSurface", function() { + it('scaleToGeocentricSurface', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; expect(Cartesian3.UNIT_X.equalsEpsilon(unitSphere.scaleToGeocentricSurface(new Cartesian3(0.5, 0, 0)), CesiumMath.EPSILON8)).toEqual(true); }); - it("scaleToGeodeticSurface", function() { + it('scaleToGeodeticSurface', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; expect(Cartesian3.UNIT_X.equalsEpsilon(unitSphere.scaleToGeodeticSurface(new Cartesian3(0.5, 0, 0)), CesiumMath.EPSILON8)).toEqual(true); @@ -155,13 +155,13 @@ defineSuite([ expect(Cartesian3.UNIT_X.equalsEpsilon(unitSphere.scaleToGeodeticSurface(new Cartesian3(3, 0, 0)), CesiumMath.EPSILON8)).toEqual(true); }); - it("equals another ellipsoid", function() { + it('equals another ellipsoid', function() { var e0 = new Ellipsoid(new Cartesian3(1, 2, 3)); var e1 = new Ellipsoid(new Cartesian3(1, 2, 3)); expect(e0.equals(e1)).toEqual(true); }); - it("doesn't equal another ellipsoid", function() { + it('does not equal another ellipsoid', function() { var e0 = new Ellipsoid(new Cartesian3(1, 2, 3)); var e1 = new Ellipsoid(new Cartesian3(4, 5, 6)); expect(e0.equals(e1)).toEqual(false); diff --git a/Specs/Core/EllipsoidTangentPlaneSpec.js b/Specs/Core/EllipsoidTangentPlaneSpec.js index 808c152005e..194a7483ea1 100644 --- a/Specs/Core/EllipsoidTangentPlaneSpec.js +++ b/Specs/Core/EllipsoidTangentPlaneSpec.js @@ -12,7 +12,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("projectPointsOntoEllipsoid", function () { + it('projectPointsOntoEllipsoid', function () { var ellipsoid = Ellipsoid.UNIT_SPHERE; var tangentPlane = new EllipsoidTangentPlane(ellipsoid, new Cartesian3(1, 0, 0)); var positions = [new Cartesian3(2, -2, 0), @@ -22,7 +22,7 @@ defineSuite([ expect(results[1].equalsEpsilon(new Cartesian3(1/3, 2/3, 2/3), CesiumMath.EPSILON10)).toEqual(true); }); - it("projectPointsOntoEllipsoid throws without positions", function () { + it('projectPointsOntoEllipsoid throws without positions', function () { var ellipsoid = Ellipsoid.UNIT_SPHERE; var tangentPlane = new EllipsoidTangentPlane(ellipsoid, new Cartesian3(1, 0, 0)); expect(function() { diff --git a/Specs/Core/EventHandlerSpec.js b/Specs/Core/EventHandlerSpec.js index 95512bac11b..bf107d5ed83 100644 --- a/Specs/Core/EventHandlerSpec.js +++ b/Specs/Core/EventHandlerSpec.js @@ -38,8 +38,8 @@ defineSuite([ }; MockDoc.prototype.addEventListener = function(name, callback, bubble) { - if (name === "DOMMouseScroll") { - name = "mousewheel"; + if (name === 'DOMMouseScroll') { + name = 'mousewheel'; } if (this._callbacks[name]) { @@ -48,8 +48,8 @@ defineSuite([ }; MockDoc.prototype.removeEventListener = function(name, callback) { - if (name === "DOMMouseScroll") { - name = "mousewheel"; + if (name === 'DOMMouseScroll') { + name = 'mousewheel'; } var callbacks = this._callbacks[name]; @@ -105,57 +105,57 @@ defineSuite([ handler = !handler.isDestroyed() && handler.destroy(); }); - it("setting key events require an action", function() { + it('setting key events require an action', function() { expect(function() { handler.setKeyAction(); }).toThrow(); }); - it("setting key events require a key", function() { + it('setting key events require a key', function() { expect(function() { handler.setKeyAction(function() { }); }).toThrow(); }); - it("getting key events require a key", function() { + it('getting key events require a key', function() { expect(function() { handler.getKeyAction(); }).toThrow(); }); - it("removing key events require a key", function() { + it('removing key events require a key', function() { expect(function() { handler.removeKeyAction(); }).toThrow(); }); - it("setting mouse events require an action", function() { + it('setting mouse events require an action', function() { expect(function() { handler.setMouseAction(); }).toThrow(); }); - it("setting mouse events require a type", function() { + it('setting mouse events require a type', function() { expect(function() { handler.setMouseAction(function() { }); }).toThrow(); }); - it("getting mouse events require a type", function() { + it('getting mouse events require a type', function() { expect(function() { handler.getMouseAction(); }).toThrow(); }); - it("removing mouse events require a type", function() { + it('removing mouse events require a type', function() { expect(function() { handler.removeMouseAction(); }).toThrow(); }); - it("key events", function() { + it('key events', function() { var keyPressed = false; var keyPressedFunction = function() { @@ -163,7 +163,7 @@ defineSuite([ }; handler.setKeyAction(keyPressedFunction, 'a'); - element.fireEvents("keydown", { + element.fireEvents('keydown', { keyCode : 'a'.charCodeAt(0) }); expect(keyPressed).toEqual(true); @@ -171,14 +171,14 @@ defineSuite([ expect(handler.getKeyAction('a') === keyPressedFunction).toEqual(true); handler.removeKeyAction('a'); - element.fireEvents("keyDown", { + element.fireEvents('keyDown', { keyCode : 'a'.charCodeAt(0) }); expect(keyPressed).toEqual(true); }); - it("modified key events", function() { + it('modified key events', function() { var modifiedKeyPressed = false; var modfiedKeyPressedFunction = function() { @@ -186,7 +186,7 @@ defineSuite([ }; handler.setKeyAction(modfiedKeyPressedFunction, 'b', EventModifier.CTRL); - element.fireEvents("keydown", { + element.fireEvents('keydown', { keyCode : 'b'.charCodeAt(0), ctrlKey : true }); @@ -195,7 +195,7 @@ defineSuite([ expect(handler.getKeyAction('b', EventModifier.CTRL) === modfiedKeyPressedFunction).toEqual(true); handler.removeKeyAction('b', EventModifier.CTRL); - element.fireEvents("keyDown", { + element.fireEvents('keyDown', { keyCode : 'b'.charCodeAt(0), ctrlKey : true }); @@ -203,7 +203,7 @@ defineSuite([ expect(modifiedKeyPressed).toEqual(true); }); - it("mouse right down", function() { + it('mouse right down', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -212,7 +212,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 1, clientY : 1 @@ -222,7 +222,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_DOWN) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 2, clientY : 2 @@ -231,7 +231,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse right up", function() { + it('mouse right up', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -240,7 +240,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_UP); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 2, clientX : 1, clientY : 1 @@ -250,7 +250,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_UP) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_UP); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 2, clientY : 2 @@ -259,7 +259,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse right click", function() { + it('mouse right click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -268,12 +268,12 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_CLICK); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 1, clientY : 1 }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 2, clientX : 1, clientY : 1 @@ -283,12 +283,12 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_CLICK) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_CLICK); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 2, clientY : 2 }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 2, clientX : 2, clientY : 2 @@ -297,7 +297,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse left down", function() { + it('mouse left down', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -306,7 +306,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 1, clientY : 1 @@ -316,7 +316,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_DOWN) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 2, clientY : 2 @@ -325,7 +325,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse left up", function() { + it('mouse left up', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -334,7 +334,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_UP); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 0, clientX : 1, clientY : 1 @@ -344,7 +344,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_UP) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_UP); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 2, clientY : 2 @@ -353,7 +353,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse left click", function() { + it('mouse left click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -362,12 +362,12 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_CLICK); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 1, clientY : 1 }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 0, clientX : 1, clientY : 1 @@ -377,12 +377,12 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_CLICK) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_CLICK); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 2, clientY : 2 }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 0, clientX : 2, clientY : 2 @@ -391,7 +391,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse middle down", function() { + it('mouse middle down', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -400,7 +400,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 1, clientY : 1 @@ -410,7 +410,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_DOWN) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 2, clientY : 2 @@ -419,7 +419,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse middle up", function() { + it('mouse middle up', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -428,7 +428,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_UP); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 1, clientY : 1 @@ -438,7 +438,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_UP) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_UP); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 2, clientY : 2 @@ -447,7 +447,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse middle click", function() { + it('mouse middle click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -456,12 +456,12 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_CLICK); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 1, clientY : 1 }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 1, clientY : 1 @@ -471,12 +471,12 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_CLICK) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_CLICK); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 2, clientY : 2 }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 2, clientY : 2 @@ -485,7 +485,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse left double click", function() { + it('mouse left double click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -494,7 +494,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_DOUBLE_CLICK); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 0, clientX : 1, clientY : 1 @@ -504,7 +504,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_DOUBLE_CLICK) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_DOUBLE_CLICK); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 0, clientX : 2, clientY : 2 @@ -513,7 +513,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse right double click", function() { + it('mouse right double click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -522,7 +522,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_DOUBLE_CLICK); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 2, clientX : 1, clientY : 1 @@ -532,7 +532,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_DOUBLE_CLICK) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_DOUBLE_CLICK); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 2, clientX : 2, clientY : 2 @@ -541,7 +541,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse middle double click", function() { + it('mouse middle double click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -550,7 +550,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_DOUBLE_CLICK); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 1, clientX : 1, clientY : 1 @@ -560,7 +560,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_DOUBLE_CLICK) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_DOUBLE_CLICK); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 1, clientX : 2, clientY : 2 @@ -569,7 +569,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("mouse move", function() { + it('mouse move', function() { var actualMove = { startPosition : new Cartesian2(0, 0), endPosition : new Cartesian2(0, 0) @@ -585,12 +585,12 @@ defineSuite([ }; handler.setMouseAction(mouseMove, MouseEventType.MOVE); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 1, clientY : 1 }); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 2, clientY : 2 @@ -600,12 +600,12 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MOVE) === mouseMove).toEqual(true); handler.removeMouseAction(MouseEventType.MOVE); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 2, clientY : 2 }); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 3, clientY : 3 @@ -614,7 +614,7 @@ defineSuite([ expect(actualMove).toEqual(expectedMove); }); - it("mouse wheel", function() { + it('mouse wheel', function() { var actualDelta = 0; var expectedDelta = -120; @@ -623,7 +623,7 @@ defineSuite([ }; handler.setMouseAction(mouseWheel, MouseEventType.WHEEL); - element.fireEvents("mousewheel", { + element.fireEvents('mousewheel', { wheelDelta : -120 }); expect(actualDelta).toEqual(expectedDelta); @@ -631,14 +631,14 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.WHEEL) === mouseWheel).toEqual(true); handler.removeMouseAction(MouseEventType.WHEEL); - element.fireEvents("mousewheel", { + element.fireEvents('mousewheel', { wheelDelta : -360 }); expect(actualDelta).toEqual(expectedDelta); }); - it("modified mouse right down", function() { + it('modified mouse right down', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -647,7 +647,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_DOWN, EventModifier.SHIFT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 1, clientY : 1, @@ -658,7 +658,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_DOWN, EventModifier.SHIFT) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_DOWN, EventModifier.SHIFT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 2, clientY : 2, @@ -668,7 +668,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse right up", function() { + it('modified mouse right up', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -677,7 +677,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_UP, EventModifier.SHIFT); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 2, clientX : 1, clientY : 1, @@ -688,7 +688,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_UP, EventModifier.SHIFT) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_UP, EventModifier.SHIFT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 2, clientY : 2, @@ -698,7 +698,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse right click", function() { + it('modified mouse right click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -707,13 +707,13 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_CLICK, EventModifier.SHIFT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 1, clientY : 1, shiftKey : true }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 2, clientX : 1, clientY : 1, @@ -724,13 +724,13 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_CLICK, EventModifier.SHIFT) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_CLICK, EventModifier.SHIFT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 2, clientX : 2, clientY : 2, shiftKey : true }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 2, clientX : 2, clientY : 2, @@ -740,7 +740,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse left down", function() { + it('modified mouse left down', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -749,7 +749,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_DOWN, EventModifier.ALT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 1, clientY : 1, @@ -760,7 +760,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_DOWN, EventModifier.ALT) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_DOWN, EventModifier.ALT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 2, clientY : 2, @@ -770,7 +770,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse left up", function() { + it('modified mouse left up', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -779,7 +779,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_UP, EventModifier.ALT); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 0, clientX : 1, clientY : 1, @@ -790,7 +790,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_UP, EventModifier.ALT) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_UP, EventModifier.ALT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 2, clientY : 2, @@ -800,7 +800,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse left click", function() { + it('modified mouse left click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -809,13 +809,13 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_CLICK, EventModifier.ALT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 1, clientY : 1, altKey : true }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 0, clientX : 1, clientY : 1, @@ -826,13 +826,13 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_CLICK, EventModifier.ALT) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_CLICK, EventModifier.ALT); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 0, clientX : 2, clientY : 2, altKey : true }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 0, clientX : 2, clientY : 2, @@ -842,7 +842,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse middle down", function() { + it('modified mouse middle down', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -851,7 +851,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_DOWN, EventModifier.CTRL); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 1, clientY : 1, @@ -862,7 +862,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_DOWN, EventModifier.CTRL) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_DOWN, EventModifier.CTRL); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 2, clientY : 2, @@ -872,7 +872,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse middle up", function() { + it('modified mouse middle up', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -881,7 +881,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_UP, EventModifier.CTRL); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 1, clientY : 1, @@ -892,7 +892,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_UP, EventModifier.CTRL) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_UP, EventModifier.CTRL); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 2, clientY : 2, @@ -902,7 +902,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse middle click", function() { + it('modified mouse middle click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -911,13 +911,13 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_CLICK, EventModifier.CTRL); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 1, clientY : 1, ctrlKey : true }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 1, clientY : 1, @@ -928,13 +928,13 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_CLICK, EventModifier.CTRL) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_CLICK, EventModifier.CTRL); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 2, clientY : 2, ctrlKey : true }); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 2, clientY : 2, @@ -944,7 +944,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse left double click", function() { + it('modified mouse left double click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -953,7 +953,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.LEFT_DOUBLE_CLICK, EventModifier.CTRL); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 0, clientX : 1, clientY : 1, @@ -964,7 +964,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.LEFT_DOUBLE_CLICK, EventModifier.CTRL) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.LEFT_DOUBLE_CLICK, EventModifier.CTRL); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 0, clientX : 2, clientY : 2, @@ -974,7 +974,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse right double click", function() { + it('modified mouse right double click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -983,7 +983,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.RIGHT_DOUBLE_CLICK, EventModifier.CTRL); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 2, clientX : 1, clientY : 1, @@ -994,7 +994,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.RIGHT_DOUBLE_CLICK, EventModifier.CTRL) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.RIGHT_DOUBLE_CLICK, EventModifier.CTRL); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 2, clientX : 2, clientY : 2, @@ -1004,7 +1004,7 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("modified mouse middle double click", function() { + it('modified mouse middle double click', function() { var actualCoords = new Cartesian2(0, 0); var expectedCoords = new Cartesian2(1, 1); @@ -1013,7 +1013,7 @@ defineSuite([ }; handler.setMouseAction(mouseDown, MouseEventType.MIDDLE_DOUBLE_CLICK, EventModifier.CTRL); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 1, clientX : 1, clientY : 1, @@ -1024,7 +1024,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MIDDLE_DOUBLE_CLICK, EventModifier.CTRL) === mouseDown).toEqual(true); handler.removeMouseAction(MouseEventType.MIDDLE_DOUBLE_CLICK, EventModifier.CTRL); - element.fireEvents("dblclick", { + element.fireEvents('dblclick', { button : 1, clientX : 2, clientY : 2, @@ -1034,9 +1034,9 @@ defineSuite([ expect(actualCoords).toEqual(expectedCoords); }); - it("get middle press time", function() { + it('get middle press time', function() { handler.setMouseAction(function(event) {}, MouseEventType.MIDDLE_DOWN); - element.fireEvents("mousedown", { + element.fireEvents('mousedown', { button : 1, clientX : 1, clientY : 1 @@ -1045,9 +1045,9 @@ defineSuite([ expect(handler.getMiddlePressTime()).toBeDefined(); }); - it("get middle release time", function() { + it('get middle release time', function() { handler.setMouseAction(function(event) {}, MouseEventType.MIDDLE_DOWN); - element.fireEvents("mouseup", { + element.fireEvents('mouseup', { button : 1, clientX : 1, clientY : 1 @@ -1056,7 +1056,7 @@ defineSuite([ expect(handler.getMiddleReleaseTime()).toBeDefined(); }); - it("modified mouse move", function() { + it('modified mouse move', function() { var actualMove = { startPosition : new Cartesian2(0, 0), endPosition : new Cartesian2(0, 0) @@ -1072,13 +1072,13 @@ defineSuite([ }; handler.setMouseAction(mouseMove, MouseEventType.MOVE, EventModifier.CTRL); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 1, clientY : 1, ctrlKey : true }); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 2, clientY : 2, @@ -1089,13 +1089,13 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.MOVE, EventModifier.CTRL) === mouseMove).toEqual(true); handler.removeMouseAction(MouseEventType.MOVE, EventModifier.CTRL); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 2, clientY : 2, ctrlKey : true }); - element.fireEvents("mousemove", { + element.fireEvents('mousemove', { button : 1, clientX : 3, clientY : 3, @@ -1105,7 +1105,7 @@ defineSuite([ expect(actualMove).toEqual(expectedMove); }); - it("modified mouse wheel", function() { + it('modified mouse wheel', function() { var actualDelta = 0; var expectedDelta = -120; @@ -1114,7 +1114,7 @@ defineSuite([ }; handler.setMouseAction(mouseWheel, MouseEventType.WHEEL, EventModifier.CTRL); - element.fireEvents("mousewheel", { + element.fireEvents('mousewheel', { wheelDelta : -120, ctrlKey : true }); @@ -1123,7 +1123,7 @@ defineSuite([ expect(handler.getMouseAction(MouseEventType.WHEEL, EventModifier.CTRL) === mouseWheel).toEqual(true); handler.removeMouseAction(MouseEventType.WHEEL, EventModifier.CTRL); - element.fireEvents("mousewheel", { + element.fireEvents('mousewheel', { wheelDelta : -360, ctrlKey : true }); @@ -1131,13 +1131,13 @@ defineSuite([ expect(actualDelta).toEqual(expectedDelta); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(handler.isDestroyed()).toEqual(false); handler.destroy(); expect(handler.isDestroyed()).toEqual(true); }); - it("destroy event handler", function() { + it('destroy event handler', function() { expect(element.getNumRegistered() !== 0).toEqual(true); handler._unregister(); expect(element.getNumRegistered()).toEqual(0); diff --git a/Specs/Core/ExtentSpec.js b/Specs/Core/ExtentSpec.js index 0ad2c2a4729..20e485f8a66 100644 --- a/Specs/Core/ExtentSpec.js +++ b/Specs/Core/ExtentSpec.js @@ -8,13 +8,13 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("constructor checks for a valid extent.", function() { + it('constructor checks for a valid extent.', function() { expect(function() { return new Extent(); }).toThrow(); }); - it("constructor throws exception with invalid extent 1", function() { + it('constructor throws exception with invalid extent 1', function() { expect(function() { return new Extent( -CesiumMath.PI - 1, @@ -25,7 +25,7 @@ defineSuite([ }).toThrow(); }); - it("constructor throws exception with invalid extent 2", function() { + it('constructor throws exception with invalid extent 2', function() { expect(function() { return new Extent( -CesiumMath.PI, @@ -36,7 +36,7 @@ defineSuite([ }).toThrow(); }); - it("constructor throws exception with invalid extent 3", function() { + it('constructor throws exception with invalid extent 3', function() { expect(function() { return new Extent( -CesiumMath.PI, @@ -47,7 +47,7 @@ defineSuite([ }).toThrow(); }); - it("constructor throws exception with invalid extent 4", function() { + it('constructor throws exception with invalid extent 4', function() { expect(function() { return new Extent( -CesiumMath.PI, @@ -58,7 +58,7 @@ defineSuite([ }).toThrow(); }); - it("validate throws exception with undefined extent", function() { + it('validate throws exception with undefined extent', function() { expect(function() { Extent.validate(); }).toThrow(); diff --git a/Specs/Core/ExtentTessellatorSpec.js b/Specs/Core/ExtentTessellatorSpec.js index f67277dcad6..c02a29c0437 100644 --- a/Specs/Core/ExtentTessellatorSpec.js +++ b/Specs/Core/ExtentTessellatorSpec.js @@ -10,17 +10,17 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("compute 0", function() { + it('compute 0', function() { var m = ExtentTessellator.compute({ extent : new Extent(-2.0, -1.0, 0.0, 1.0), granularity : 1.0 }); expect(m.attributes.position.values.length).toEqual(9 * 3); - expect(typeof m.attributes.textureCoordinates === "undefined").toEqual(true); + expect(typeof m.attributes.textureCoordinates === 'undefined').toEqual(true); expect(m.indexLists[0].values.length).toEqual(8 * 3); }); - it("compute 1", function() { + it('compute 1', function() { var m = ExtentTessellator.compute({ extent : new Extent(-2.0, -1.0, 0.0, 1.0), granularity : 1.0, @@ -31,7 +31,7 @@ defineSuite([ expect(m.indexLists[0].values.length).toEqual(8 * 3); }); - it("computeBuffers 0", function() { + it('computeBuffers 0', function() { var buffers = ExtentTessellator.computeBuffers({ extent : new Extent(-2.0, -1.0, 0.0, 1.0), granularity : 1.0 @@ -41,7 +41,7 @@ defineSuite([ expect(buffers.indices.length).toEqual(8 * 3); }); - it("computeBuffers 1", function() { + it('computeBuffers 1', function() { var buffers = ExtentTessellator.computeBuffers({ extent : new Extent(-2.0, -1.0, 0.0, 1.0), granularity : 1.0, @@ -53,7 +53,7 @@ defineSuite([ expect(buffers.indices.length).toEqual(8 * 3); }); - it("computeBuffers 2", function() { + it('computeBuffers 2', function() { var buffers = ExtentTessellator.computeBuffers({ extent : new Extent(-2.0, -1.0, 0.0, 1.0), granularity : 1.0, diff --git a/Specs/Core/HermiteSplineSpec.js b/Specs/Core/HermiteSplineSpec.js index d2071cac1ae..0fd35e00869 100644 --- a/Specs/Core/HermiteSplineSpec.js +++ b/Specs/Core/HermiteSplineSpec.js @@ -27,7 +27,7 @@ defineSuite([ }]; }); - it("constructor throws an exception with invalid control points", function() { + it('constructor throws an exception with invalid control points', function() { expect(function() { return new HermiteSpline(); }).toThrow(); @@ -41,19 +41,19 @@ defineSuite([ }).toThrow(); }); - it("get control points", function() { + it('get control points', function() { var hs = new HermiteSpline(points); expect(hs.getControlPoints()).toEqual(points); }); - it("evaluate fails with undefined time", function() { + it('evaluate fails with undefined time', function() { var hs = new HermiteSpline(points); expect(function() { hs.evaluate(); }).toThrow(); }); - it("evaluate fails with time out of range", function() { + it('evaluate fails with time out of range', function() { var hs = new HermiteSpline(points); expect(function() { @@ -65,7 +65,7 @@ defineSuite([ }).toThrow(); }); - it("evaluate can jump around in time", function() { + it('evaluate can jump around in time', function() { var hs = new HermiteSpline(points); expect(hs.evaluate(points[0].time).equals(points[0].point)).toEqual(true); @@ -101,7 +101,7 @@ defineSuite([ }; }; - it("natural cubic spline", function() { + it('natural cubic spline', function() { points = [{ point : new Cartesian3(1.0, 0.0, 0.0), time : 0.0 @@ -128,7 +128,7 @@ defineSuite([ } }); - it("clamped cubic spline", function() { + it('clamped cubic spline', function() { points = [{ point : new Cartesian3(1.0, 0.0, 0.0), time : 0.0, diff --git a/Specs/Core/IntersectionTestsSpec.js b/Specs/Core/IntersectionTestsSpec.js index b1b8903740c..6776ca5beb0 100644 --- a/Specs/Core/IntersectionTestsSpec.js +++ b/Specs/Core/IntersectionTestsSpec.js @@ -12,7 +12,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("rayPlane intersects", function() { + it('rayPlane intersects', function() { var rayOrigin = new Cartesian3(2.0, 0.0, 0.0); var rayDirection = new Cartesian3(-1.0, 0.0, 0.0); var planeNormal = new Cartesian3(1.0, 0.0, 0.0); @@ -23,7 +23,7 @@ defineSuite([ expect(intersectionPoint.equals(new Cartesian3(1.0, 0.0, 0.0))).toEqual(true); }); - it("rayPlane misses", function() { + it('rayPlane misses', function() { var rayOrigin = new Cartesian3(2.0, 0.0, 0.0); var rayDirection = new Cartesian3(1.0, 0.0, 0.0); var planeNormal = new Cartesian3(1.0, 0.0, 0.0); @@ -34,7 +34,7 @@ defineSuite([ expect(intersectionPoint).not.toBeDefined(); }); - it("rayPlane misses (parallel)", function() { + it('rayPlane misses (parallel)', function() { var rayOrigin = new Cartesian3(2.0, 0.0, 0.0); var rayDirection = new Cartesian3(0.0, 1.0, 0.0); var planeNormal = new Cartesian3(1.0, 0.0, 0.0); @@ -45,49 +45,49 @@ defineSuite([ expect(intersectionPoint).not.toBeDefined(); }); - it("rayPlane throws without rayOrigin", function() { + it('rayPlane throws without rayOrigin', function() { expect(function() { IntersectionTests.rayPlane(); }).toThrow(); }); - it("rayPlane throws without rayDirection", function() { + it('rayPlane throws without rayDirection', function() { expect(function() { IntersectionTests.rayPlane(new Cartesian3()); }).toThrow(); }); - it("rayPlane throws without planeNormal", function() { + it('rayPlane throws without planeNormal', function() { expect(function() { IntersectionTests.rayPlane(new Cartesian3(), new Cartesian3()); }).toThrow(); }); - it("rayPlane throws without planeD", function() { + it('rayPlane throws without planeD', function() { expect(function() { IntersectionTests.rayPlane(new Cartesian3(), new Cartesian3(), new Cartesian3()); }).toThrow(); }); - it("rayEllipsoid throws without rayOrigin", function() { + it('rayEllipsoid throws without rayOrigin', function() { expect(function() { IntersectionTests.rayEllipsoid(); }).toThrow(); }); - it("rayEllipsoid throws without rayDirection", function() { + it('rayEllipsoid throws without rayDirection', function() { expect(function() { IntersectionTests.rayEllipsoid(new Cartesian3()); }).toThrow(); }); - it("rayEllipsoid throws without ellipsoid", function() { + it('rayEllipsoid throws without ellipsoid', function() { expect(function() { IntersectionTests.rayEllipsoid(new Cartesian3(), new Cartesian3()); }).toThrow(); }); - it("rayEllipsoid outside intersections", function() { + it('rayEllipsoid outside intersections', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; var intersections = IntersectionTests.rayEllipsoid(new Cartesian3(2.0, 0.0, 0.0), new Cartesian3(-1.0, 0.0, 0.0), unitSphere); @@ -121,16 +121,16 @@ defineSuite([ expect(intersections.start).toEqualEpsilon(1.0, CesiumMath.EPSILON14); intersections = IntersectionTests.rayEllipsoid(new Cartesian3(-2.0, 0.0, 0.0), new Cartesian3(-1.0, 0.0, 0.0), unitSphere); - expect(typeof intersections === "undefined").toEqual(true); + expect(typeof intersections === 'undefined').toEqual(true); intersections = IntersectionTests.rayEllipsoid(new Cartesian3(0.0, -2.0, 0.0), new Cartesian3(0.0, -1.0, 0.0), unitSphere); - expect(typeof intersections === "undefined").toEqual(true); + expect(typeof intersections === 'undefined').toEqual(true); intersections = IntersectionTests.rayEllipsoid(new Cartesian3(0.0, 0.0, -2.0), new Cartesian3(0.0, 0.0, -1.0), unitSphere); - expect(typeof intersections === "undefined").toEqual(true); + expect(typeof intersections === 'undefined').toEqual(true); }); - it("rayEllipsoid inside intersection", function() { + it('rayEllipsoid inside intersection', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; var intersections = IntersectionTests.rayEllipsoid(Cartesian3.ZERO, new Cartesian3(0.0, 0.0, 1.0), unitSphere); @@ -138,14 +138,14 @@ defineSuite([ expect(intersections.stop).toEqualEpsilon(1.0, CesiumMath.EPSILON14); }); - it("rayEllipsoid tangent intersections", function() { + it('rayEllipsoid tangent intersections', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; var intersections = IntersectionTests.rayEllipsoid(Cartesian3.UNIT_X, Cartesian3.UNIT_Z, unitSphere); expect(intersections).not.toBeDefined(); }); - it("rayEllipsoid no intersections", function() { + it('rayEllipsoid no intersections', function() { var unitSphere = Ellipsoid.UNIT_SPHERE; var intersections = IntersectionTests.rayEllipsoid(new Cartesian3(2.0, 0.0, 0.0), new Cartesian3(0.0, 0.0, 1.0), unitSphere); diff --git a/Specs/Core/JobsSpec.js b/Specs/Core/JobsSpec.js index 615d16ff406..5dd64d74700 100644 --- a/Specs/Core/JobsSpec.js +++ b/Specs/Core/JobsSpec.js @@ -8,16 +8,16 @@ defineSuite([ "use strict"; /*global it,expect,waitsFor,runs*/ - it("downloads an image", function() { + it('downloads an image', function() { var image; - Chain.run(Jobs.downloadImage("./Data/Images/Green.png")).thenRun(function() { - image = this.images["./Data/Images/Green.png"]; + Chain.run(Jobs.downloadImage('./Data/Images/Green.png')).thenRun(function() { + image = this.images['./Data/Images/Green.png']; }); waitsFor(function() { return image; - }, "downloads an image.", 3000); + }, 'downloads an image.', 3000); runs(function() { expect(image.width).toEqual(1); diff --git a/Specs/Core/JulianDateSpec.js b/Specs/Core/JulianDateSpec.js index 0b6f448bfa9..129c6ef5a51 100644 --- a/Specs/Core/JulianDateSpec.js +++ b/Specs/Core/JulianDateSpec.js @@ -11,8 +11,8 @@ function(JulianDate, /*global it, expect*/ // All exact Julian Dates found using NASA's Time Conversion Tool: http://ssd.jpl.nasa.gov/tc.cgi - it("Construct a default date", function() { - // Default constructing a date uses "now". Unfortunately, + it('Construct a default date', function() { + // Default constructing a date uses 'now'. Unfortunately, // there's no way to know exactly what that time will be, so we // give ourselves a 5 second epsilon as a hack to avoid possible // race conditions. In reality, it might be better to just omit @@ -23,7 +23,7 @@ function(JulianDate, expect(defaultDate.equalsEpsilon(dateNow, 5)).toEqual(true); }); - it("Construct a date from basic components", function() { + it('Construct a date from basic components', function() { var dayNumber = 12; var seconds = 12.5; var timeStandard = TimeStandard.TAI; @@ -33,7 +33,7 @@ function(JulianDate, expect(julianDate.getTimeStandard()).toEqual(timeStandard); }); - it("Construct a date from basic components with more seconds than a day", function() { + it('Construct a date from basic components with more seconds than a day', function() { var dayNumber = 12; var seconds = 86401; var timeStandard = TimeStandard.UTC; @@ -43,7 +43,7 @@ function(JulianDate, expect(julianDate.getTimeStandard()).toEqual(timeStandard); }); - it("Construct a date from basic components with negative seconds in a day", function() { + it('Construct a date from basic components with negative seconds in a day', function() { var dayNumber = 12; var seconds = -1; var timeStandard = TimeStandard.UTC; @@ -53,7 +53,7 @@ function(JulianDate, expect(julianDate.getTimeStandard()).toEqual(timeStandard); }); - it("Construct a date from basic components with partial day and seconds in a day", function() { + it('Construct a date from basic components with partial day and seconds in a day', function() { var dayNumber = 12.5; var seconds = -1; var timeStandard = TimeStandard.UTC; @@ -63,7 +63,7 @@ function(JulianDate, expect(julianDate.getTimeStandard()).toEqual(timeStandard); }); - it("Construct a date with default time standard", function() { + it('Construct a date with default time standard', function() { var dayNumber = 12; var seconds = 12.5; var julianDate = new JulianDate(dayNumber, seconds); @@ -72,16 +72,16 @@ function(JulianDate, expect(julianDate.getTimeStandard()).toEqual(TimeStandard.UTC); }); - it("Fail to construct a date with invalid time standard", function() { + it('Fail to construct a date with invalid time standard', function() { var dayNumber = 12; var seconds = 12.5; - var timeStandard = "invalid"; + var timeStandard = 'invalid'; expect(function() { return new JulianDate(dayNumber, seconds, timeStandard); }).toThrow(); }); - it("Fail to construct a date with a null time standard", function() { + it('Fail to construct a date with a null time standard', function() { var dayNumber = 12; var seconds = 12.5; var timeStandard = null; @@ -90,7 +90,7 @@ function(JulianDate, }).toThrow(); }); - it("Fail to construct a date with an undefined secondsOfDay", function() { + it('Fail to construct a date with an undefined secondsOfDay', function() { var dayNumber = 12; var timeStandard = TimeStandard.UTC; expect(function() { @@ -98,7 +98,7 @@ function(JulianDate, }).toThrow(); }); - it("Fail to construct a date with null secondsOfDay", function() { + it('Fail to construct a date with null secondsOfDay', function() { var dayNumber = 12; var seconds = null; var timeStandard = TimeStandard.UTC; @@ -107,16 +107,16 @@ function(JulianDate, }).toThrow(); }); - it("Fail to construct a date with non-numerical secondsOfDay", function() { + it('Fail to construct a date with non-numerical secondsOfDay', function() { var dayNumber = 12; - var seconds = "not a number"; + var seconds = 'not a number'; var timeStandard = TimeStandard.UTC; expect(function() { return new JulianDate(dayNumber, seconds, timeStandard); }).toThrow(); }); - it("Fail to construct a date with undefined day number", function() { + it('Fail to construct a date with undefined day number', function() { var seconds = 12.5; var timeStandard = TimeStandard.UTC; expect(function() { @@ -124,7 +124,7 @@ function(JulianDate, }).toThrow(); }); - it("Fail to construct a date with null day number", function() { + it('Fail to construct a date with null day number', function() { var dayNumber = null; var seconds = 12.5; var timeStandard = TimeStandard.UTC; @@ -133,8 +133,8 @@ function(JulianDate, }).toThrow(); }); - it("Fail to construct a date with non-numerical day number", function() { - var dayNumber = "not a number"; + it('Fail to construct a date with non-numerical day number', function() { + var dayNumber = 'not a number'; var seconds = 12.5; var timeStandard = TimeStandard.UTC; expect(function() { @@ -142,617 +142,617 @@ function(JulianDate, }).toThrow(); }); - it("Construct a date from a JavaScript Date (1)", function() { - var date = new Date("January 1, 1991 06:00:00 UTC"); + it('Construct a date from a JavaScript Date (1)', function() { + var date = new Date('January 1, 1991 06:00:00 UTC'); var julianDate = JulianDate.fromDate(date); expect(julianDate.getTotalDays()).toEqualEpsilon(2448257.75, CesiumMath.EPSILON5); }); - it("Construct a date from a JavaScript Date (2)", function() { - var date = new Date("July 4, 2011 12:00:00 UTC"); + it('Construct a date from a JavaScript Date (2)', function() { + var date = new Date('July 4, 2011 12:00:00 UTC'); var julianDate = JulianDate.fromDate(date); expect(julianDate.getTotalDays()).toEqualEpsilon(2455747.0, CesiumMath.EPSILON5); }); - it("Construct a date from a JavaScript Date (3)", function() { - var date = new Date("December 31, 2021 18:00:00 UTC"); + it('Construct a date from a JavaScript Date (3)', function() { + var date = new Date('December 31, 2021 18:00:00 UTC'); var julianDate = JulianDate.fromDate(date); expect(julianDate.getTotalDays()).toEqualEpsilon(2459580.25, CesiumMath.EPSILON5); }); - it("Construct a date from a JavaScript Date (4)", function() { - var jsDate = new Date("September 1, 2011 12:00:00 UTC"); + it('Construct a date from a JavaScript Date (4)', function() { + var jsDate = new Date('September 1, 2011 12:00:00 UTC'); var julianDate = JulianDate.fromDate(jsDate); expect(julianDate.getTotalDays()).toEqualEpsilon(2455806.0, CesiumMath.EPSILON5); }); - it("Construct a date from a JavaScript Date in different TimeStandard", function() { - var taiDate = new Date("September 1, 2011 12:00:00"); + it('Construct a date from a JavaScript Date in different TimeStandard', function() { + var taiDate = new Date('September 1, 2011 12:00:00'); var taiJulianDate = JulianDate.fromDate(taiDate, TimeStandard.TAI); - var utcDate = new Date("September 1, 2011 11:59:26"); + var utcDate = new Date('September 1, 2011 11:59:26'); var utcJulianDate = JulianDate.fromDate(utcDate, TimeStandard.UTC); expect(taiJulianDate.equalsEpsilon(utcJulianDate, CesiumMath.EPSILON20)).toEqual(true); }); - it("Fail to construct from an undefined JavaScript Date", function() { + it('Fail to construct from an undefined JavaScript Date', function() { expect(function() { return JulianDate.fromDate(undefined); }).toThrow(); }); - it("Fail to construct from a null JavaScript Date", function() { + it('Fail to construct from a null JavaScript Date', function() { expect(function() { return JulianDate.fromDate(null); }).toThrow(); }); - it("Fail to construct from an invalid JavaScript Date", function() { + it('Fail to construct from an invalid JavaScript Date', function() { expect(function() { - return JulianDate.fromDate(new Date(Date.parse("garbage"))); + return JulianDate.fromDate(new Date(Date.parse('garbage'))); }).toThrow(); }); - it("Fail to construct from a non-date JavaScript Date", function() { + it('Fail to construct from a non-date JavaScript Date', function() { expect(function() { return JulianDate.fromDate(0); }).toThrow(); }); - it("Fail to construct from a JavaScript Date with null time standard", function() { + it('Fail to construct from a JavaScript Date with null time standard', function() { expect(function() { return JulianDate.fromDate(new Date(), null); }).toThrow(); }); - it("Fail to construct from a JavaScript Date with invalid time standard", function() { + it('Fail to construct from a JavaScript Date with invalid time standard', function() { expect(function() { - return JulianDate.fromDate(new Date(), "invalid"); + return JulianDate.fromDate(new Date(), 'invalid'); }).toThrow(); }); - it("Construct a date from total days (1)", function() { + it('Construct a date from total days (1)', function() { var julianDate = JulianDate.fromTotalDays(2448257.75, TimeStandard.UTC); - expect(julianDate.equals(JulianDate.fromDate(new Date("January 1, 1991 06:00:00 UTC")))).toEqual(true); + expect(julianDate.equals(JulianDate.fromDate(new Date('January 1, 1991 06:00:00 UTC')))).toEqual(true); }); - it("Construct a date from total days (2)", function() { + it('Construct a date from total days (2)', function() { var julianDate = JulianDate.fromTotalDays(2455747.0, TimeStandard.UTC); - expect(julianDate.equals(JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")))).toEqual(true); + expect(julianDate.equals(JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')))).toEqual(true); }); - it("Construct a date from total days (3)", function() { + it('Construct a date from total days (3)', function() { var julianDate = JulianDate.fromTotalDays(2459580.25, TimeStandard.UTC); - expect(julianDate.equals(JulianDate.fromDate(new Date("December 31, 2021 18:00:00 UTC")))).toEqual(true); + expect(julianDate.equals(JulianDate.fromDate(new Date('December 31, 2021 18:00:00 UTC')))).toEqual(true); }); - it("Construct a date from total days with different time standards", function() { + it('Construct a date from total days with different time standards', function() { var julianDate = JulianDate.fromTotalDays(2455806, TimeStandard.TAI); - expect(julianDate.equals(JulianDate.fromDate(new Date("September 1, 2011 12:00:00 UTC"), TimeStandard.TAI))).toEqual(true); + expect(julianDate.equals(JulianDate.fromDate(new Date('September 1, 2011 12:00:00 UTC'), TimeStandard.TAI))).toEqual(true); }); - it("Fail to construct from non-numeric total days", function() { + it('Fail to construct from non-numeric total days', function() { expect(function() { - return JulianDate.fromTotalDays("not a number", TimeStandard.UTC); + return JulianDate.fromTotalDays('not a number', TimeStandard.UTC); }).toThrow(); }); - it("Fail to construct from null total days", function() { + it('Fail to construct from null total days', function() { expect(function() { return JulianDate.fromTotalDays(null, TimeStandard.UTC); }).toThrow(); }); - it("Fail to construct from undefined total days", function() { + it('Fail to construct from undefined total days', function() { expect(function() { return JulianDate.fromTotalDays(undefined, TimeStandard.UTC); }).toThrow(); }); - it("Fail to construct from total days with null time standard", function() { + it('Fail to construct from total days with null time standard', function() { expect(function() { return JulianDate.fromTotalDays(1234, null); }).toThrow(); }); - it("Fail to construct from total days with invalid time standard", function() { + it('Fail to construct from total days with invalid time standard', function() { expect(function() { - return JulianDate.fromTotalDays(1234, "invalid"); + return JulianDate.fromTotalDays(1234, 'invalid'); }).toThrow(); }); - it("Construct from ISO8601 local calendar date, basic format", function() { + it('Construct from ISO8601 local calendar date, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(2009, 7, 1)); - var computedDate = JulianDate.fromIso8601("20090801"); + var computedDate = JulianDate.fromIso8601('20090801'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 local calendar date, extended format", function() { + it('Construct from ISO8601 local calendar date, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(2009, 7, 1)); - var computedDate = JulianDate.fromIso8601("2009-08-01"); + var computedDate = JulianDate.fromIso8601('2009-08-01'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 local calendar date on Feb 29th, basic format", function() { + it('Construct from ISO8601 local calendar date on Feb 29th, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(2000, 1, 29)); - var computedDate = JulianDate.fromIso8601("20000229"); + var computedDate = JulianDate.fromIso8601('20000229'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 local calendar date on Feb 29th, extended format", function() { + it('Construct from ISO8601 local calendar date on Feb 29th, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(2000, 1, 29)); - var computedDate = JulianDate.fromIso8601("2000-02-29"); + var computedDate = JulianDate.fromIso8601('2000-02-29'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local ordinal date, basic format", function() { + it('Construct from an ISO8601 local ordinal date, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(1985, 3, 12)); - var computedDate = JulianDate.fromIso8601("1985102"); + var computedDate = JulianDate.fromIso8601('1985102'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local ordinal date, extended format", function() { + it('Construct from an ISO8601 local ordinal date, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(1985, 3, 12)); - var computedDate = JulianDate.fromIso8601("1985-102"); + var computedDate = JulianDate.fromIso8601('1985-102'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct an ISO8601 ordinal date on a leap year", function() { + it('Construct an ISO8601 ordinal date on a leap year', function() { var expectedDate = JulianDate.fromDate(new Date(2000, 11, 31)); - var computedDate = JulianDate.fromIso8601("2000-366"); + var computedDate = JulianDate.fromIso8601('2000-366'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local week date, basic format", function() { + it('Construct from an ISO8601 local week date, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(1985, 3, 12)); - var computedDate = JulianDate.fromIso8601("1985W155"); + var computedDate = JulianDate.fromIso8601('1985W155'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local week date, extended format", function() { + it('Construct from an ISO8601 local week date, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(2008, 8, 27)); - var computedDate = JulianDate.fromIso8601("2008-W39-6"); + var computedDate = JulianDate.fromIso8601('2008-W39-6'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local calendar week date, basic format", function() { + it('Construct from an ISO8601 local calendar week date, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(1985, 3, 7)); - var computedDate = JulianDate.fromIso8601("1985W15"); + var computedDate = JulianDate.fromIso8601('1985W15'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local calendar week date, extended format", function() { + it('Construct from an ISO8601 local calendar week date, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(2008, 8, 21)); - var computedDate = JulianDate.fromIso8601("2008-W39"); + var computedDate = JulianDate.fromIso8601('2008-W39'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - //Note, there is no "extended format" for calendar month because eliminating the + //Note, there is no 'extended format' for calendar month because eliminating the //would confuse is with old YYMMDD dates - it("Construct from an ISO8601 local calendar month, basic format", function() { + it('Construct from an ISO8601 local calendar month, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(1985, 3, 1)); - var computedDate = JulianDate.fromIso8601("1985-04"); + var computedDate = JulianDate.fromIso8601('1985-04'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - //Note, there is no "extended format" for calendar year for obvious reasons - it("Construct from an ISO8601 local calendar month, basic format", function() { + //Note, there is no 'extended format' for calendar year for obvious reasons + it('Construct from an ISO8601 local calendar month, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(1985, 0, 1)); - var computedDate = JulianDate.fromIso8601("1985"); + var computedDate = JulianDate.fromIso8601('1985'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time, basic format", function() { + it('Construct from ISO8601 UTC calendar date and time, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 25))); - var computedDate = JulianDate.fromIso8601("20090801T123025Z"); + var computedDate = JulianDate.fromIso8601('20090801T123025Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time, extended format", function() { + it('Construct from ISO8601 UTC calendar date and time, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 25))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12:30:25Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12:30:25Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional seconds, basic format", function() { + it('Construct from ISO8601 UTC calendar date and time fractional seconds, basic format', function() { //Date is only accurate to milliseconds, while JulianDate, much more so. The below date gets //rounded to 513, so we need to construct a JulianDate directly. //var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 25, 5125423))); var expectedDate = new JulianDate(2455045, 1825.5125423, TimeStandard.UTC); - var computedDate = JulianDate.fromIso8601("20090801T123025.5125423Z"); + var computedDate = JulianDate.fromIso8601('20090801T123025.5125423Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional seconds, extended format", function() { + it('Construct from ISO8601 UTC calendar date and time fractional seconds, extended format', function() { //Date is only accurate to milliseconds, while JulianDate, much more so. The below date gets //rounded to 513, so we need to construct a JulianDate directly. var expectedDate = new JulianDate(2455045, 1825.5125423, TimeStandard.UTC); - var computedDate = JulianDate.fromIso8601("2009-08-01T12:30:25.5125423Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12:30:25.5125423Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional seconds, basic format, ',' instead of '.'", function() { + it('Construct from ISO8601 UTC calendar date and time fractional seconds, basic format, "," instead of "."', function() { //Date is only accurate to milliseconds, while JulianDate, much more so. The below date gets //rounded to 513, so we need to construct a JulianDate directly. //var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 25, 5125423))); var expectedDate = new JulianDate(2455045, 1825.5125423, TimeStandard.UTC); - var computedDate = JulianDate.fromIso8601("20090801T123025,5125423Z"); + var computedDate = JulianDate.fromIso8601('20090801T123025,5125423Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional seconds, extended format, ',' instead of '.'", function() { + it('Construct from ISO8601 UTC calendar date and time fractional seconds, extended format, "," instead of "."', function() { //Date is only accurate to milliseconds, while JulianDate, much more so. The below date gets //rounded to 513, so we need to construct a JulianDate directly. var expectedDate = new JulianDate(2455045, 1825.5125423, TimeStandard.UTC); - var computedDate = JulianDate.fromIso8601("2009-08-01T12:30:25,5125423Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12:30:25,5125423Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time no seconds, basic format", function() { + it('Construct from ISO8601 UTC calendar date and time no seconds, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 0))); - var computedDate = JulianDate.fromIso8601("20090801T1230Z"); + var computedDate = JulianDate.fromIso8601('20090801T1230Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time no seconds, extended format", function() { + it('Construct from ISO8601 UTC calendar date and time no seconds, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 0))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12:30Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12:30Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional minutes, basic format", function() { + it('Construct from ISO8601 UTC calendar date and time fractional minutes, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 30))); - var computedDate = JulianDate.fromIso8601("20090801T1230.5Z"); + var computedDate = JulianDate.fromIso8601('20090801T1230.5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional minutes, extended format", function() { + it('Construct from ISO8601 UTC calendar date and time fractional minutes, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 30))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12:30.5Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12:30.5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional minutes, basic format, ',' instead of '.'", function() { + it('Construct from ISO8601 UTC calendar date and time fractional minutes, basic format, "," instead of "."', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 30))); - var computedDate = JulianDate.fromIso8601("20090801T1230,5Z"); + var computedDate = JulianDate.fromIso8601('20090801T1230,5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional minutes, extended format, ',' instead of '.'", function() { + it('Construct from ISO8601 UTC calendar date and time fractional minutes, extended format, "," instead of "."', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 30))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12:30,5Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12:30,5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time no minutes/seconds, basic format", function() { + it('Construct from ISO8601 UTC calendar date and time no minutes/seconds, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 0, 0))); - var computedDate = JulianDate.fromIso8601("20090801T12Z"); + var computedDate = JulianDate.fromIso8601('20090801T12Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time no minutes/seconds, extended format", function() { + it('Construct from ISO8601 UTC calendar date and time no minutes/seconds, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 0, 0))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional hours, basic format", function() { + it('Construct from ISO8601 UTC calendar date and time fractional hours, basic format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 0))); - var computedDate = JulianDate.fromIso8601("20090801T12.5Z"); + var computedDate = JulianDate.fromIso8601('20090801T12.5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional hours, extended format", function() { + it('Construct from ISO8601 UTC calendar date and time fractional hours, extended format', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 0))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12.5Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12.5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional hours, basic format, ',' instead of '.'", function() { + it('Construct from ISO8601 UTC calendar date and time fractional hours, basic format, "," instead of "."', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 0))); - var computedDate = JulianDate.fromIso8601("20090801T12,5Z"); + var computedDate = JulianDate.fromIso8601('20090801T12,5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from ISO8601 UTC calendar date and time fractional hours, extended format, ',' instead of '.'", function() { + it('Construct from ISO8601 UTC calendar date and time fractional hours, extended format, "," instead of "."', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 1, 12, 30, 0))); - var computedDate = JulianDate.fromIso8601("2009-08-01T12,5Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T12,5Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 UTC calendar date and time on a leap second", function() { - var julianDate = JulianDate.fromIso8601("2008-12-31T23:59:60Z"); + it('Construct from an ISO8601 UTC calendar date and time on a leap second', function() { + var julianDate = JulianDate.fromIso8601('2008-12-31T23:59:60Z'); expect(julianDate.equals(new JulianDate(2454832, 43233, TimeStandard.TAI))).toEqual(true); }); - it("Construct from an ISO8601 UTC calendar date and time within a leap second", function() { - var julianDate = JulianDate.fromIso8601("2008-12-31T23:59:60.123456789Z"); + it('Construct from an ISO8601 UTC calendar date and time within a leap second', function() { + var julianDate = JulianDate.fromIso8601('2008-12-31T23:59:60.123456789Z'); expect(julianDate.equals(new JulianDate(2454832, 43233.123456789, TimeStandard.TAI))).toEqual(true); }); - it("Construct from an ISO8601 local calendar date and time on a leap second 1 hour behind UTC", function() { - var julianDate = JulianDate.fromIso8601("2008-12-31T22:59:60-01"); + it('Construct from an ISO8601 local calendar date and time on a leap second 1 hour behind UTC', function() { + var julianDate = JulianDate.fromIso8601('2008-12-31T22:59:60-01'); expect(julianDate.equals(new JulianDate(2454832, 43233, TimeStandard.TAI))).toEqual(true); }); - it("Construct from an ISO8601 local calendar date and time on a leap second 1 hour ahead of UTC", function() { - var julianDate = JulianDate.fromIso8601("2009-01-01T00:59:60+01"); + it('Construct from an ISO8601 local calendar date and time on a leap second 1 hour ahead of UTC', function() { + var julianDate = JulianDate.fromIso8601('2009-01-01T00:59:60+01'); expect(julianDate.equals(new JulianDate(2454832, 43233, TimeStandard.TAI))).toEqual(true); }); - it("Construct from an ISO8601 calendar date and time using 24:00:00 midnight notation", function() { + it('Construct from an ISO8601 calendar date and time using 24:00:00 midnight notation', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 7, 2, 0, 0, 0))); - var computedDate = JulianDate.fromIso8601("2009-08-01T24:00:00Z"); + var computedDate = JulianDate.fromIso8601('2009-08-01T24:00:00Z'); expect(computedDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local calendar date with UTC offset that crosses into next year", function() { + it('Construct from an ISO8601 local calendar date with UTC offset that crosses into next year', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2008, 11, 31, 23, 0, 0))); - var julianDate = JulianDate.fromIso8601("2009-01-01T01:00:00+02"); + var julianDate = JulianDate.fromIso8601('2009-01-01T01:00:00+02'); expect(julianDate.equals(expectedDate)).toEqual(true); }); - it("Construct from an ISO8601 local calendar date with UTC offset that crosses into previous year", function() { + it('Construct from an ISO8601 local calendar date with UTC offset that crosses into previous year', function() { var expectedDate = JulianDate.fromDate(new Date(Date.UTC(2009, 0, 1, 1, 0, 0))); - var julianDate = JulianDate.fromIso8601("2008-12-31T23:00:00-02"); + var julianDate = JulianDate.fromIso8601('2008-12-31T23:00:00-02'); expect(julianDate.equals(expectedDate)).toEqual(true); }); - it("Fails to construct an ISO8601 ordinal date with day less than 1", function() { + it('Fails to construct an ISO8601 ordinal date with day less than 1', function() { expect(function() { - return JulianDate.fromIso8601("2009-000"); + return JulianDate.fromIso8601('2009-000'); }).toThrow(); }); - it("Fails to construct an ISO8601 ordinal date with day more than 365 on non-leap year", function() { + it('Fails to construct an ISO8601 ordinal date with day more than 365 on non-leap year', function() { expect(function() { - return JulianDate.fromIso8601("2001-366"); + return JulianDate.fromIso8601('2001-366'); }).toThrow(); }); - it("Fails to construct ISO8601 UTC calendar date of invalid YYMMDD format", function() { + it('Fails to construct ISO8601 UTC calendar date of invalid YYMMDD format', function() { expect(function() { - return JulianDate.fromIso8601("200905"); + return JulianDate.fromIso8601('200905'); }).toThrow(); }); - it("Fails to construct a complete ISO8601 date missing T delimeter", function() { + it('Fails to construct a complete ISO8601 date missing T delimeter', function() { expect(function() { - return JulianDate.fromIso8601("2009-08-0112:30.5Z"); + return JulianDate.fromIso8601('2009-08-0112:30.5Z'); }).toThrow(); }); - it("Fails to construct a complete ISO8601 date with delimeter other than T", function() { + it('Fails to construct a complete ISO8601 date with delimeter other than T', function() { expect(function() { - return JulianDate.fromIso8601("2009-08-01Q12:30.5Z"); + return JulianDate.fromIso8601('2009-08-01Q12:30.5Z'); }).toThrow(); }); - it("Fails to construct an ISO8601 date from undefined", function() { + it('Fails to construct an ISO8601 date from undefined', function() { expect(function() { return JulianDate.fromIso8601(undefined); }).toThrow(); }); - it("Fails to construct an ISO8601 date from null", function() { + it('Fails to construct an ISO8601 date from null', function() { expect(function() { return JulianDate.fromIso8601(null); }).toThrow(); }); - it("Fails to construct an ISO8601 from complete garbage", function() { + it('Fails to construct an ISO8601 from complete garbage', function() { expect(function() { - return JulianDate.fromIso8601("this is not a date"); + return JulianDate.fromIso8601('this is not a date'); }).toThrow(); }); - it("Fails to construct an ISO8601 date from a valid ISO8601 interval", function() { + it('Fails to construct an ISO8601 date from a valid ISO8601 interval', function() { expect(function() { - return JulianDate.fromIso8601("2007-03-01T13:00:00Z/2008-05-11T15:30:00Z"); + return JulianDate.fromIso8601('2007-03-01T13:00:00Z/2008-05-11T15:30:00Z'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with too many year digits", function() { + it('Fails to construct from an ISO8601 with too many year digits', function() { expect(function() { - return JulianDate.fromIso8601("20091-05-19"); + return JulianDate.fromIso8601('20091-05-19'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with too many month digits", function() { + it('Fails to construct from an ISO8601 with too many month digits', function() { expect(function() { - return JulianDate.fromIso8601("2009-100-19"); + return JulianDate.fromIso8601('2009-100-19'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with more than 12 months", function() { + it('Fails to construct from an ISO8601 with more than 12 months', function() { expect(function() { - return JulianDate.fromIso8601("2009-13-19"); + return JulianDate.fromIso8601('2009-13-19'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with less than 1 months", function() { + it('Fails to construct from an ISO8601 with less than 1 months', function() { expect(function() { - return JulianDate.fromIso8601("2009-00-19"); + return JulianDate.fromIso8601('2009-00-19'); }).toThrow(); }); - it("Fails to construct an ISO8601 January date with more than 31 days", function() { + it('Fails to construct an ISO8601 January date with more than 31 days', function() { expect(function() { - return JulianDate.fromIso8601("2009-01-32"); + return JulianDate.fromIso8601('2009-01-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 Febuary date with more than 28 days", function() { + it('Fails to construct an ISO8601 Febuary date with more than 28 days', function() { expect(function() { - return JulianDate.fromIso8601("2009-02-29"); + return JulianDate.fromIso8601('2009-02-29'); }).toThrow(); }); - it("Fails to construct an ISO8601 Febuary leap year date with more than 29 days", function() { + it('Fails to construct an ISO8601 Febuary leap year date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-02-30"); + return JulianDate.fromIso8601('2000-02-30'); }).toThrow(); }); - it("Fails to construct an ISO8601 March date with more than 29 days", function() { + it('Fails to construct an ISO8601 March date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-03-32"); + return JulianDate.fromIso8601('2000-03-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 April date with more than 29 days", function() { + it('Fails to construct an ISO8601 April date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-04-31"); + return JulianDate.fromIso8601('2000-04-31'); }).toThrow(); }); - it("Fails to construct an ISO8601 May date with more than 29 days", function() { + it('Fails to construct an ISO8601 May date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-05-32"); + return JulianDate.fromIso8601('2000-05-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 June date with more than 29 days", function() { + it('Fails to construct an ISO8601 June date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-06-31"); + return JulianDate.fromIso8601('2000-06-31'); }).toThrow(); }); - it("Fails to construct an ISO8601 July date with more than 29 days", function() { + it('Fails to construct an ISO8601 July date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-07-32"); + return JulianDate.fromIso8601('2000-07-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 August date with more than 29 days", function() { + it('Fails to construct an ISO8601 August date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-08-32"); + return JulianDate.fromIso8601('2000-08-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 September date with more than 29 days", function() { + it('Fails to construct an ISO8601 September date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-09-31"); + return JulianDate.fromIso8601('2000-09-31'); }).toThrow(); }); - it("Fails to construct an ISO8601 October date with more than 29 days", function() { + it('Fails to construct an ISO8601 October date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-10-32"); + return JulianDate.fromIso8601('2000-10-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 November date with more than 29 days", function() { + it('Fails to construct an ISO8601 November date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-11-31"); + return JulianDate.fromIso8601('2000-11-31'); }).toThrow(); }); - it("Fails to construct an ISO8601 December date with more than 29 days", function() { + it('Fails to construct an ISO8601 December date with more than 29 days', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-32"); + return JulianDate.fromIso8601('2000-12-32'); }).toThrow(); }); - it("Fails to construct an ISO8601 date with more than 24 hours (extra seconds)", function() { + it('Fails to construct an ISO8601 date with more than 24 hours (extra seconds)', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T24:00:01"); + return JulianDate.fromIso8601('2000-12-15T24:00:01'); }).toThrow(); }); - it("Fails to construct an ISO8601 date with more than 24 hours (extra minutes)", function() { + it('Fails to construct an ISO8601 date with more than 24 hours (extra minutes)', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T24:01:00"); + return JulianDate.fromIso8601('2000-12-15T24:01:00'); }).toThrow(); }); - it("Fails to construct an ISO8601 date with more than 59 minutes", function() { + it('Fails to construct an ISO8601 date with more than 59 minutes', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T12:60"); + return JulianDate.fromIso8601('2000-12-15T12:60'); }).toThrow(); }); - it("Fails to construct an ISO8601 date with more than 60 seconds", function() { + it('Fails to construct an ISO8601 date with more than 60 seconds', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T12:59:61"); + return JulianDate.fromIso8601('2000-12-15T12:59:61'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with less than 1 day", function() { + it('Fails to construct from an ISO8601 with less than 1 day', function() { expect(function() { - return JulianDate.fromIso8601("2009-01-00"); + return JulianDate.fromIso8601('2009-01-00'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with too many dashes", function() { + it('Fails to construct from an ISO8601 with too many dashes', function() { expect(function() { - return JulianDate.fromIso8601("2009--01-01"); + return JulianDate.fromIso8601('2009--01-01'); }).toThrow(); }); - it("Fails to construct from an ISO8601 with garbage offset", function() { + it('Fails to construct from an ISO8601 with garbage offset', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T12:59:23ZZ+-050708::1234"); + return JulianDate.fromIso8601('2000-12-15T12:59:23ZZ+-050708::1234'); }).toThrow(); }); - it("Fails to construct an ISO8601 date with more than one decimal place", function() { + it('Fails to construct an ISO8601 date with more than one decimal place', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T12:59:22..2"); + return JulianDate.fromIso8601('2000-12-15T12:59:22..2'); }).toThrow(); }); - it("Fails to construct an ISO8601 calendar date mixing basic and extended format", function() { + it('Fails to construct an ISO8601 calendar date mixing basic and extended format', function() { expect(function() { - return JulianDate.fromIso8601("200108-01"); + return JulianDate.fromIso8601('200108-01'); }).toThrow(); }); - it("Fails to construct an ISO8601 calendar date mixing basic and extended format", function() { + it('Fails to construct an ISO8601 calendar date mixing basic and extended format', function() { expect(function() { - return JulianDate.fromIso8601("2001-0801"); + return JulianDate.fromIso8601('2001-0801'); }).toThrow(); }); - it("Fails to construct an ISO8601 calendar week mixing basic and extended format", function() { + it('Fails to construct an ISO8601 calendar week mixing basic and extended format', function() { expect(function() { - return JulianDate.fromIso8601("2008-W396"); + return JulianDate.fromIso8601('2008-W396'); }).toThrow(); }); - it("Fails to construct an ISO8601 calendar week mixing basic and extended format", function() { + it('Fails to construct an ISO8601 calendar week mixing basic and extended format', function() { expect(function() { - return JulianDate.fromIso8601("2008W39-6"); + return JulianDate.fromIso8601('2008W39-6'); }).toThrow(); }); - it("Fails to construct an ISO8601 date with trailing -", function() { + it('Fails to construct an ISO8601 date with trailing -', function() { expect(function() { - return JulianDate.fromIso8601("2001-"); + return JulianDate.fromIso8601('2001-'); }).toThrow(); }); - it("Fails to construct an ISO8601 time mixing basic and extended format", function() { + it('Fails to construct an ISO8601 time mixing basic and extended format', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T22:0100"); + return JulianDate.fromIso8601('2000-12-15T22:0100'); }).toThrow(); }); - it("Fails to construct an ISO8601 time mixing basic and extended format", function() { + it('Fails to construct an ISO8601 time mixing basic and extended format', function() { expect(function() { - return JulianDate.fromIso8601("2000-12-15T2201:00"); + return JulianDate.fromIso8601('2000-12-15T2201:00'); }).toThrow(); }); - it("getJulianTimeFraction works", function() { + it('getJulianTimeFraction works', function() { var seconds = 12345.678; var fraction = seconds / 86400.0; var julianDate = new JulianDate(0, seconds); expect(julianDate.getJulianTimeFraction()).toEqualEpsilon(fraction, CesiumMath.EPSILON20); }); - it("toDate works when constructed from total days", function() { + it('toDate works when constructed from total days', function() { var julianDate = JulianDate.fromTotalDays(2455770.9986087964, TimeStandard.UTC); var javascriptDate = julianDate.toDate(); expect(javascriptDate.getUTCFullYear()).toEqual(2011); @@ -764,7 +764,7 @@ function(JulianDate, expect(javascriptDate.getUTCMilliseconds()).toEqualEpsilon(800, 10); }); - it("toDate works when using TAI", function() { + it('toDate works when using TAI', function() { var julianDate = JulianDate.fromTotalDays(2455927.157772, TimeStandard.UTC); var julianDateTai = TimeStandard.convertUtcToTai(julianDate); var javascriptDate = julianDateTai.toDate(); @@ -777,316 +777,316 @@ function(JulianDate, expect(javascriptDate.getUTCMilliseconds()).toEqualEpsilon(500, 10); }); - it("toDate works on a leap second", function() { + it('toDate works on a leap second', function() { var date = new JulianDate(2454832, 43233, TimeStandard.TAI).toDate(); - expect(date).toEqual(new Date("1/1/2009 12:00:00 AM UTC")); + expect(date).toEqual(new Date('1/1/2009 12:00:00 AM UTC')); }); - it("getSecondsDifference works in UTC", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); - var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); + it('getSecondsDifference works in UTC', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); + var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00 UTC')); expect(start.getSecondsDifference(end)).toEqualEpsilon(TimeConstants.SECONDS_PER_DAY + TimeConstants.SECONDS_PER_MINUTE, CesiumMath.EPSILON5); }); - it("getSecondsDifference works in TAI", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); - var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); + it('getSecondsDifference works in TAI', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); + var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00 UTC')); start = TimeStandard.convertUtcToTai(start); end = TimeStandard.convertUtcToTai(end); expect(start.getSecondsDifference(end)).toEqualEpsilon(TimeConstants.SECONDS_PER_DAY + TimeConstants.SECONDS_PER_MINUTE, CesiumMath.EPSILON5); }); - it("getSecondsDifference works with mixed time standards", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); - var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); + it('getSecondsDifference works with mixed time standards', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); + var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00 UTC')); start = TimeStandard.convertUtcToTai(start); expect(start.getSecondsDifference(end)).toEqualEpsilon(TimeConstants.SECONDS_PER_DAY + TimeConstants.SECONDS_PER_MINUTE, CesiumMath.EPSILON5); }); - it("getMinutesDifference works in UTC", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); - var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); + it('getMinutesDifference works in UTC', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); + var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00 UTC')); expect(start.getMinutesDifference(end)).toEqualEpsilon(TimeConstants.MINUTES_PER_DAY + 1.0, CesiumMath.EPSILON5); }); - it("getMinutesDifference works in TAI", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); - var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); + it('getMinutesDifference works in TAI', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); + var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00 UTC')); start = TimeStandard.convertUtcToTai(start); end = TimeStandard.convertUtcToTai(end); expect(start.getMinutesDifference(end)).toEqualEpsilon(TimeConstants.MINUTES_PER_DAY + 1.0, CesiumMath.EPSILON5); }); - it("getMinutesDifference works with mixed time standards", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); - var end = JulianDate.fromDate(new Date("July 5, 2011 12:01:00 UTC")); + it('getMinutesDifference works with mixed time standards', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); + var end = JulianDate.fromDate(new Date('July 5, 2011 12:01:00 UTC')); end = TimeStandard.convertUtcToTai(end); expect(start.getMinutesDifference(end)).toEqualEpsilon(TimeConstants.MINUTES_PER_DAY + 1.0, CesiumMath.EPSILON5); }); - it("addSeconds works with whole seconds", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:30 UTC")); + it('addSeconds works with whole seconds', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:30 UTC')); var end = start.addSeconds(95); expect(end.toDate().getUTCSeconds()).toEqualEpsilon(5, CesiumMath.EPSILON5); expect(end.toDate().getUTCMinutes()).toEqualEpsilon(2, CesiumMath.EPSILON5); }); - it("addSeconds works with fractions (1)", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 23:59:59 UTC")); + it('addSeconds works with fractions (1)', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 23:59:59 UTC')); var end = start.addSeconds(1.5); expect(end.getTotalDays()).toEqualEpsilon(2455747.5000058, CesiumMath.EPSILON7); }); - it("addSeconds works with fractions (2)", function() { - var start = JulianDate.fromDate(new Date("August 11 2011 6:00:00 UTC")); + it('addSeconds works with fractions (2)', function() { + var start = JulianDate.fromDate(new Date('August 11 2011 6:00:00 UTC')); var end = start.addSeconds(0.5); expect(end.getTotalDays()).toEqualEpsilon(2455784.7500058, CesiumMath.EPSILON7); }); - it("addSeconds works with fractions (3)", function() { - var start = JulianDate.fromDate(new Date("August 11 2011 11:59:59 UTC")); + it('addSeconds works with fractions (3)', function() { + var start = JulianDate.fromDate(new Date('August 11 2011 11:59:59 UTC')); var end = start.addSeconds(1.25); expect(end.getTotalDays()).toEqualEpsilon(2455785.0000029, CesiumMath.EPSILON7); }); - it("addSeconds works with negative numbers", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:01:30 UTC")); + it('addSeconds works with negative numbers', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:01:30 UTC')); var end = start.addSeconds(-60); expect(end.toDate().getUTCSeconds()).toEqualEpsilon(30, CesiumMath.EPSILON5); expect(end.toDate().getUTCMinutes()).toEqualEpsilon(0, CesiumMath.EPSILON5); }); - it("addSeconds works with more seconds than in a day", function() { + it('addSeconds works with more seconds than in a day', function() { var start = new JulianDate(2448444, 0, TimeStandard.UTC); var end = start.addSeconds(TimeConstants.SECONDS_PER_DAY * 7 + 15); expect(end.getJulianDayNumber()).toEqual(2448451); expect(end.getSecondsOfDay()).toEqual(15); }); - it("addSeconds works with negative seconds more than in a day", function() { + it('addSeconds works with negative seconds more than in a day', function() { var start = new JulianDate(2448444, 0, TimeStandard.UTC); var end = start.addSeconds(-TimeConstants.SECONDS_PER_DAY * 7 - 15); expect(end.getJulianDayNumber()).toEqual(2448436); expect(end.getSecondsOfDay()).toEqual(TimeConstants.SECONDS_PER_DAY - 15); }); - it("addSeconds fails with non-numeric input", function() { + it('addSeconds fails with non-numeric input', function() { expect(function() { - return new JulianDate().addSeconds("banana"); + return new JulianDate().addSeconds('banana'); }).toThrow(); }); - it("addSeconds fails with null input", function() { + it('addSeconds fails with null input', function() { expect(function() { return new JulianDate().addSeconds(null); }).toThrow(); }); - it("addSeconds fails with undefined input", function() { + it('addSeconds fails with undefined input', function() { expect(function() { return new JulianDate().addSeconds(undefined); }).toThrow(); }); - it("addMinutes works", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); + it('addMinutes works', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); var end = start.addMinutes(65); expect(end.toDate().getUTCMinutes()).toEqualEpsilon(5, CesiumMath.EPSILON5); expect(end.toDate().getUTCHours()).toEqualEpsilon(13, CesiumMath.EPSILON5); }); - it("addMinutes works with negative numbers", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); + it('addMinutes works with negative numbers', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); var end = start.addMinutes(-35); expect(end.toDate().getUTCMinutes()).toEqualEpsilon(25, CesiumMath.EPSILON5); expect(end.toDate().getUTCHours()).toEqualEpsilon(11, CesiumMath.EPSILON5); }); - it("addMinutes fails with non-numeric input", function() { + it('addMinutes fails with non-numeric input', function() { expect(function() { - return new JulianDate().addMinutes("banana"); + return new JulianDate().addMinutes('banana'); }).toThrow(); }); - it("addMinutes fails with null input", function() { + it('addMinutes fails with null input', function() { expect(function() { return new JulianDate().addMinutes(null); }).toThrow(); }); - it("addMinutes fails with undefined input", function() { + it('addMinutes fails with undefined input', function() { expect(function() { return new JulianDate().addMinutes(undefined); }).toThrow(); }); - it("addHours works", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); + it('addHours works', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); var end = start.addHours(6); expect(end.toDate().getUTCHours()).toEqualEpsilon(18, CesiumMath.EPSILON5); }); - it("addHours works with negative numbers", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); + it('addHours works with negative numbers', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); var end = start.addHours(-6); expect(end.toDate().getUTCHours()).toEqualEpsilon(6, CesiumMath.EPSILON5); }); - it("addHours fails with non-numeric input", function() { + it('addHours fails with non-numeric input', function() { expect(function() { - return new JulianDate().addHours("banana"); + return new JulianDate().addHours('banana'); }).toThrow(); }); - it("addHours fails with null input", function() { + it('addHours fails with null input', function() { expect(function() { return new JulianDate().addHours(null); }).toThrow(); }); - it("addHours fails with undefined input", function() { + it('addHours fails with undefined input', function() { expect(function() { return new JulianDate().addHours(undefined); }).toThrow(); }); - it("addDays works", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); + it('addDays works', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); var end = start.addDays(32); expect(end.toDate().getUTCDate()).toEqualEpsilon(5, CesiumMath.EPSILON5); expect(end.toDate().getUTCMonth()).toEqualEpsilon(7, CesiumMath.EPSILON5); }); - it("addDays works with negative numbers", function() { - var start = JulianDate.fromDate(new Date("July 4, 2011 12:00:00 UTC")); + it('addDays works with negative numbers', function() { + var start = JulianDate.fromDate(new Date('July 4, 2011 12:00:00 UTC')); var end = start.addDays(-4); expect(end.toDate().getUTCDate()).toEqualEpsilon(30, CesiumMath.EPSILON5); expect(end.toDate().getUTCMonth()).toEqualEpsilon(5, CesiumMath.EPSILON5); }); - it("addDays fails with non-numeric input", function() { + it('addDays fails with non-numeric input', function() { expect(function() { - return new JulianDate().addDays("banana"); + return new JulianDate().addDays('banana'); }).toThrow(); }); - it("addDays fails with null input", function() { + it('addDays fails with null input', function() { expect(function() { return new JulianDate().addDays(null); }).toThrow(); }); - it("addDays fails with undefined input", function() { + it('addDays fails with undefined input', function() { expect(function() { return new JulianDate().addDays(undefined); }).toThrow(); }); - it("lessThan works", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - var end = JulianDate.fromDate(new Date("July 6, 2011 12:01:00")); + it('lessThan works', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + var end = JulianDate.fromDate(new Date('July 6, 2011 12:01:00')); expect(start.lessThan(end)).toEqual(true); }); - it("lessThan works with equal values", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - var end = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); + it('lessThan works with equal values', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + var end = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); expect(start.lessThan(end)).toEqual(false); expect(start.lessThan(end.addSeconds(1))).toEqual(true); }); - it("lessThan works with different time standards", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00"), TimeStandard.UTC); - var end = JulianDate.fromDate(new Date("July 6, 2011 12:00:00"), TimeStandard.TAI); + it('lessThan works with different time standards', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00'), TimeStandard.UTC); + var end = JulianDate.fromDate(new Date('July 6, 2011 12:00:00'), TimeStandard.TAI); expect(start.lessThan(end)).toEqual(true); }); - it("lessThanOrEquals works", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - var end = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); + it('lessThanOrEquals works', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + var end = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); expect(start.lessThanOrEquals(end)).toEqual(true); expect(start.addSeconds(1).lessThanOrEquals(end)).toEqual(false); expect(start.addSeconds(-1).lessThanOrEquals(end)).toEqual(true); }); - it("lessThanOrEquals works with different time standards", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00"), TimeStandard.UTC); + it('lessThanOrEquals works with different time standards', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00'), TimeStandard.UTC); var end = TimeStandard.convertUtcToTai(start); expect(start.lessThanOrEquals(end)).toEqual(true); expect(start.addSeconds(1).lessThanOrEquals(end)).toEqual(false); expect(start.addSeconds(-1).lessThanOrEquals(end)).toEqual(true); }); - it("greaterThan works", function() { - var start = JulianDate.fromDate(new Date("July 6, 2011 12:01:00")); - var end = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); + it('greaterThan works', function() { + var start = JulianDate.fromDate(new Date('July 6, 2011 12:01:00')); + var end = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); expect(start.greaterThan(end)).toEqual(true); }); - it("greaterThan works with equal values", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - var end = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); + it('greaterThan works with equal values', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + var end = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); expect(start.greaterThan(end)).toEqual(false); expect(start.greaterThan(end.addSeconds(-1))).toEqual(true); }); - it("greaterThan works with different time standards", function() { - var start = JulianDate.fromDate(new Date("July 6, 2011 12:01:00"), TimeStandard.TAI); - var end = JulianDate.fromDate(new Date("July 6, 1991 12:00:00"), TimeStandard.UTC); + it('greaterThan works with different time standards', function() { + var start = JulianDate.fromDate(new Date('July 6, 2011 12:01:00'), TimeStandard.TAI); + var end = JulianDate.fromDate(new Date('July 6, 1991 12:00:00'), TimeStandard.UTC); expect(start.greaterThan(end)).toEqual(true); }); - it("greaterThanOrEquals works", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); - var end = JulianDate.fromDate(new Date("July 6, 1991 12:00:00")); + it('greaterThanOrEquals works', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); + var end = JulianDate.fromDate(new Date('July 6, 1991 12:00:00')); expect(start.greaterThanOrEquals(end)).toEqual(true); expect(start.addSeconds(-1).greaterThanOrEquals(end)).toEqual(false); expect(start.addSeconds(1).greaterThanOrEquals(end)).toEqual(true); }); - it("greaterThanOrEquals works with different time standards", function() { - var start = JulianDate.fromDate(new Date("July 6, 1991 12:00:00"), TimeStandard.UTC); + it('greaterThanOrEquals works with different time standards', function() { + var start = JulianDate.fromDate(new Date('July 6, 1991 12:00:00'), TimeStandard.UTC); var end = TimeStandard.convertUtcToTai(start); expect(start.greaterThanOrEquals(end)).toEqual(true); expect(start.addSeconds(-1).greaterThanOrEquals(end)).toEqual(false); expect(start.addSeconds(1).greaterThanOrEquals(end)).toEqual(true); }); - it("can be equal to within an epsilon of another JulianDate", function() { - var original = JulianDate.fromDate(new Date("September 7, 2011 12:55:00 UTC")); - var clone = JulianDate.fromDate(new Date("September 7, 2011 12:55:00 UTC")); + it('can be equal to within an epsilon of another JulianDate', function() { + var original = JulianDate.fromDate(new Date('September 7, 2011 12:55:00 UTC')); + var clone = JulianDate.fromDate(new Date('September 7, 2011 12:55:00 UTC')); clone = clone.addSeconds(1); expect(original.equalsEpsilon(clone, 2)).toEqual(true); }); - it("getTotalDays works", function() { + it('getTotalDays works', function() { var totalDays = 2455784.7500058; var original = JulianDate.fromTotalDays(totalDays); expect(totalDays).toEqual(original.getTotalDays()); }); - it("equalsEpsilon works", function() { + it('equalsEpsilon works', function() { var original = new JulianDate(); var clone = JulianDate.fromDate(original.toDate()); clone = clone.addSeconds(0.01); expect(original.equalsEpsilon(clone, CesiumMath.EPSILON1)).toEqual(true); }); - it("getTaiMinusUtc works between TAI and UTC (1)", function() { - var date = new Date("July 11, 2011 12:00:00 UTC"); + it('getTaiMinusUtc works between TAI and UTC (1)', function() { + var date = new Date('July 11, 2011 12:00:00 UTC'); var jd = JulianDate.fromDate(date, TimeStandard.TAI); var difference = jd.getTaiMinusUtc(); expect(difference).toEqual(34); }); - it("getTaiMinusUtc works between TAI and UTC (2)", function() { - var date = new Date("July 11, 1979 12:00:00 UTC"); + it('getTaiMinusUtc works between TAI and UTC (2)', function() { + var date = new Date('July 11, 1979 12:00:00 UTC'); var jd = JulianDate.fromDate(date, TimeStandard.TAI); var difference = jd.getTaiMinusUtc(); expect(difference).toEqual(18); }); - it("getTaiMinusUtc works between TAI and UTC (3)", function() { - var date = new Date("July 11, 1970 12:00:00 UTC"); + it('getTaiMinusUtc works between TAI and UTC (3)', function() { + var date = new Date('July 11, 1970 12:00:00 UTC'); var jd = JulianDate.fromDate(date, TimeStandard.TAI); var difference = jd.getTaiMinusUtc(); expect(difference).toEqual(10); diff --git a/Specs/Core/LeapSecondSpec.js b/Specs/Core/LeapSecondSpec.js index 2105faa2d32..f926bf99afd 100644 --- a/Specs/Core/LeapSecondSpec.js +++ b/Specs/Core/LeapSecondSpec.js @@ -12,7 +12,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("has the proper default leapSeconds", function() { + it('has the proper default leapSeconds', function() { var leapSeconds = LeapSecond.getLeapSeconds(); expect(leapSeconds[0].julianDate.getTotalDays()).toEqual(2441317.5); expect(leapSeconds[1].julianDate.getTotalDays()).toEqual(2441499.5); @@ -41,39 +41,39 @@ defineSuite([ expect(leapSeconds[24].julianDate.getTotalDays()).toEqual(2454832.5); }); - it("throws an exception if constructed without a julian date", function() { + it('throws an exception if constructed without a julian date', function() { expect(function() { return new LeapSecond(); }).toThrow(); }); - it("throws an exception if constructed without an offset", function() { + it('throws an exception if constructed without an offset', function() { expect(function() { return new LeapSecond(new JulianDate()); }).toThrow(); }); - it("can get the TAI offset from UTC", function() { + it('can get the TAI offset from UTC', function() { var ls = new LeapSecond(new JulianDate(), 1.0); expect(ls.offset).toEqual(1.0); }); - it("can get the TAI offset for an index (in range)", function() { + it('can get the TAI offset for an index (in range)', function() { var leapSeconds = LeapSecond.getLeapSeconds(); - var toFind = new LeapSecond("January 1, 1973 00:00:00 UTC", 12.0); + var toFind = new LeapSecond('January 1, 1973 00:00:00 UTC', 12.0); var index = binarySearch(leapSeconds, toFind, LeapSecond.compareLeapSecondDate); expect(LeapSecond.getLeapSeconds()[index].offset).toEqual(12.0); }); - it("can get the Julian date for an index (in range)", function() { + it('can get the Julian date for an index (in range)', function() { var leapSeconds = LeapSecond.getLeapSeconds(); - var toFind = new LeapSecond("July 1, 1972 00:00:00 UTC", 0.0); + var toFind = new LeapSecond('July 1, 1972 00:00:00 UTC', 0.0); var index = binarySearch(leapSeconds, toFind, LeapSecond.compareLeapSecondDate); expect(LeapSecond.getLeapSeconds()[index].julianDate.getTotalDays()).toEqual(2441499.5); }); - it("can check to see if leap seconds are equal", function() { - var date = new Date("January 1, 1990 00:00:00 UTC"); + it('can check to see if leap seconds are equal', function() { + var date = new Date('January 1, 1990 00:00:00 UTC'); var leapSecond1 = new LeapSecond(JulianDate.fromDate(date), 25.0); var leapSecond2 = new LeapSecond(JulianDate.fromDate(date), 25.0); var leapSecond3 = new LeapSecond(JulianDate.fromDate(date), 26.0); @@ -82,108 +82,108 @@ defineSuite([ }); - it("can construct a leapSecond using JSON data", function() { + it('can construct a leapSecond using JSON data', function() { var data = [{ - date : "January 1, 1972 00:00:00 UTC", + date : 'January 1, 1972 00:00:00 UTC', offset : 10 }, { - date : "July 1, 1972 00:00:00 UTC", + date : 'July 1, 1972 00:00:00 UTC', offset : 11 }, { - date : "January 1, 1973 00:00:00 UTC", + date : 'January 1, 1973 00:00:00 UTC', offset : 12 }, { - date : "January 1, 1974 00:00:00 UTC", + date : 'January 1, 1974 00:00:00 UTC', offset : 13 }, { - date : "January 1, 1975 00:00:00 UTC", + date : 'January 1, 1975 00:00:00 UTC', offset : 14 }, { - date : "January 1, 1976 00:00:00 UTC", + date : 'January 1, 1976 00:00:00 UTC', offset : 15 }, { - date : "January 1, 1977 00:00:00 UTC", + date : 'January 1, 1977 00:00:00 UTC', offset : 16 }, { - date : "January 1, 1978 00:00:00 UTC", + date : 'January 1, 1978 00:00:00 UTC', offset : 17 }, { - date : "January 1, 1979 00:00:00 UTC", + date : 'January 1, 1979 00:00:00 UTC', offset : 18 }, { - date : "January 1, 1980 00:00:00 UTC", + date : 'January 1, 1980 00:00:00 UTC', offset : 19 }, { - date : "July 1, 1981 00:00:00 UTC", + date : 'July 1, 1981 00:00:00 UTC', offset : 20 }, { - date : "July 1, 1982 00:00:00 UTC", + date : 'July 1, 1982 00:00:00 UTC', offset : 21 }, { - date : "July 1, 1983 00:00:00 UTC", + date : 'July 1, 1983 00:00:00 UTC', offset : 22 }, { - date : "July 1, 1985 00:00:00 UTC", + date : 'July 1, 1985 00:00:00 UTC', offset : 23 }, { - date : "January 1, 1988 00:00:00 UTC", + date : 'January 1, 1988 00:00:00 UTC', offset : 24 }, { - date : "January 1, 1990 00:00:00 UTC", + date : 'January 1, 1990 00:00:00 UTC', offset : 25 }, { - date : "January 1, 1991 00:00:00 UTC", + date : 'January 1, 1991 00:00:00 UTC', offset : 26 }, { - date : "July 1, 1992 00:00:00 UTC", + date : 'July 1, 1992 00:00:00 UTC', offset : 27 }, { - date : "July 1, 1993 00:00:00 UTC", + date : 'July 1, 1993 00:00:00 UTC', offset : 28 }, { - date : "July 1, 1994 00:00:00 UTC", + date : 'July 1, 1994 00:00:00 UTC', offset : 100 }, { - date : "January 1, 1996 00:00:00 UTC", + date : 'January 1, 1996 00:00:00 UTC', offset : 30 }, { - date : "July 1, 1997 00:00:00 UTC", + date : 'July 1, 1997 00:00:00 UTC', offset : 31 }, { - date : "January 1, 1999 00:00:00 UTC", + date : 'January 1, 1999 00:00:00 UTC', offset : 32 }, { - date : "January 1, 2006 00:00:00 UTC", + date : 'January 1, 2006 00:00:00 UTC', offset : 33 }, { - date : "January 1, 2009 00:00:00 UTC", + date : 'January 1, 2009 00:00:00 UTC', offset : 34 }]; LeapSecond.setLeapSeconds(data); - var jd = JulianDate.fromDate(new Date("July 11, 1994 12:00:00 UTC")); + var jd = JulianDate.fromDate(new Date('July 11, 1994 12:00:00 UTC')); jd = TimeStandard.convertUtcToTai(jd); var difference = jd.getTaiMinusUtc(); expect(difference).toEqual(100); }); - it("throws an exception if setting leap seconds without data", function() { + it('throws an exception if setting leap seconds without data', function() { expect(function() { LeapSecond.setLeapSeconds(); }).toThrow(); }); - it("can compare leap second dates (1)", function() { - var leapSecond1 = new LeapSecond("July 18, 2011 12:00:00 UTC", 0.0); - var leapSecond2 = new LeapSecond("July 20, 2011 12:00:00 UTC", 0.0); + it('can compare leap second dates (1)', function() { + var leapSecond1 = new LeapSecond('July 18, 2011 12:00:00 UTC', 0.0); + var leapSecond2 = new LeapSecond('July 20, 2011 12:00:00 UTC', 0.0); expect(LeapSecond.compareLeapSecondDate(leapSecond1, leapSecond2)).toBeLessThan(0); expect(LeapSecond.compareLeapSecondDate(leapSecond2, leapSecond1)).toBeGreaterThan(0); expect(LeapSecond.compareLeapSecondDate(leapSecond1, leapSecond1)).toEqual(0); }); - it("can compare leap second dates (2)", function() { - var leapSecond1 = new LeapSecond("July 18, 2011 15:00:00 UTC", 0.0); - var leapSecond2 = new LeapSecond("July 18, 2011 16:00:00 UTC", 0.0); + it('can compare leap second dates (2)', function() { + var leapSecond1 = new LeapSecond('July 18, 2011 15:00:00 UTC', 0.0); + var leapSecond2 = new LeapSecond('July 18, 2011 16:00:00 UTC', 0.0); expect(LeapSecond.compareLeapSecondDate(leapSecond1, leapSecond2)).toBeLessThan(0); expect(LeapSecond.compareLeapSecondDate(leapSecond2, leapSecond1)).toBeGreaterThan(0); diff --git a/Specs/Core/MathSpec.js b/Specs/Core/MathSpec.js index f8328f8a8d1..83df522ae6b 100644 --- a/Specs/Core/MathSpec.js +++ b/Specs/Core/MathSpec.js @@ -12,139 +12,139 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("sign of -2", function() { + it('sign of -2', function() { expect(CesiumMath.sign(-2)).toEqual(-1); }); - it("sign of 2", function() { + it('sign of 2', function() { expect(CesiumMath.sign(2)).toEqual(1); }); - it("sign of 0", function() { + it('sign of 0', function() { expect(CesiumMath.sign(0)).toEqual(0); }); /////////////////////////////////////////////////////////////////////// - it("angleBetween between orthogonal vectors", function() { + it('angleBetween between orthogonal vectors', function() { expect(CesiumMath.angleBetween(Cartesian3.UNIT_X, Cartesian3.UNIT_Y)).toEqual(CesiumMath.PI_OVER_TWO); }); - it("angleBetween between colinear vectors", function() { + it('angleBetween between colinear vectors', function() { expect(CesiumMath.angleBetween(Cartesian3.UNIT_X, Cartesian3.UNIT_X)).toEqual(0.0); }); - it("angleBetween between zero vector", function() { + it('angleBetween between zero vector', function() { expect(CesiumMath.angleBetween(Cartesian3.UNIT_X, Cartesian3.ZERO)).toEqual(0.0); }); ////////////////////////////////////////////////////////////////////// - it("cosh", function() { + it('cosh', function() { expect(CesiumMath.cosh(0.0)).toEqual(1.0); expect(CesiumMath.cosh(-1.0)).toBeGreaterThan(1.0); expect(CesiumMath.cosh(1.0)).toBeGreaterThan(1.0); }); - it("cosh NaN", function() { + it('cosh NaN', function() { expect(isNaN(CesiumMath.cosh(NaN))).toEqual(true); }); - it("cosh infinity", function() { + it('cosh infinity', function() { expect(CesiumMath.cosh(Infinity)).toEqual(Infinity); expect(CesiumMath.cosh(-Infinity)).toEqual(Infinity); }); - it("sinh", function() { + it('sinh', function() { expect(CesiumMath.sinh(0.0)).toEqual(0.0); expect(CesiumMath.sinh(-1.0)).toBeLessThan(1.0); expect(CesiumMath.sinh(1.0)).toBeGreaterThan(1.0); }); - it("sinh NaN", function() { + it('sinh NaN', function() { expect(isNaN(CesiumMath.sinh(NaN))).toEqual(true); }); - it("sinh infinity", function() { + it('sinh infinity', function() { expect(CesiumMath.sinh(Infinity)).toEqual(Infinity); expect(CesiumMath.sinh(-Infinity)).toEqual(-Infinity); }); /////////////////////////////////////////////////////////////////////// - it("lerps at time 0", function() { + it('lerps at time 0', function() { expect(CesiumMath.lerp(1.0, 2.0, 0.0)).toEqual(1.0); }); - it("lerps at time 0.5", function() { + it('lerps at time 0.5', function() { expect(CesiumMath.lerp(1.0, 2.0, 0.5)).toEqual(1.5); }); - it("lerps at time 1", function() { + it('lerps at time 1', function() { expect(CesiumMath.lerp(1.0, 2.0, 1.0)).toEqual(2.0); }); /////////////////////////////////////////////////////////////////////// - it("toRadians", function() { + it('toRadians', function() { expect(CesiumMath.toRadians(360.0)).toEqual(2 * Math.PI); }); - it("cartographic3ToRadians", function() { + it('cartographic3ToRadians', function() { var c = CesiumMath.cartographic3ToRadians(new Cartographic3(360.0, 180.0, 1.0)); expect(c.longitude).toEqual(2.0 * Math.PI); expect(c.latitude).toEqual(Math.PI); expect(c.height).toEqual(1.0); }); - it("cartographic2ToRadians", function() { + it('cartographic2ToRadians', function() { var c = CesiumMath.cartographic2ToRadians(new Cartographic2(180.0, 360.0)); expect(c.longitude).toEqual(Math.PI); expect(c.latitude).toEqual(2.0 * Math.PI); }); - it("toDegrees", function() { + it('toDegrees', function() { expect(CesiumMath.toDegrees(Math.PI)).toEqual(180.0); }); - it("cartographic3ToDegrees", function() { + it('cartographic3ToDegrees', function() { var c = CesiumMath.cartographic3ToDegrees(new Cartographic3(2.0 * Math.PI, Math.PI, 1.0)); expect(c.longitude).toEqual(360.0); expect(c.latitude).toEqual(180.0); expect(c.height).toEqual(1.0); }); - it("cartographic2ToDegrees", function() { + it('cartographic2ToDegrees', function() { var c = CesiumMath.cartographic2ToDegrees(new Cartographic2(Math.PI, 2.0 * Math.PI)); expect(c.longitude).toEqual(180.0); expect(c.latitude).toEqual(360.0); }); - it("convertLongitudeRange (1)", function() { + it('convertLongitudeRange (1)', function() { expect(CesiumMath.convertLongitudeRange(CesiumMath.THREE_PI_OVER_TWO)).toEqualEpsilon(-CesiumMath.PI_OVER_TWO, CesiumMath.EPSILON16); }); - it("convertLongitudeRange (2)", function() { + it('convertLongitudeRange (2)', function() { expect(CesiumMath.convertLongitudeRange(-Math.PI)).toEqualEpsilon(-Math.PI, CesiumMath.EPSILON16); }); - it("convertLongitudeRange (3)", function() { + it('convertLongitudeRange (3)', function() { expect(CesiumMath.convertLongitudeRange(Math.PI)).toEqualEpsilon(-Math.PI, CesiumMath.EPSILON16); }); - it("negativePiToPi positive", function() { + it('negativePiToPi positive', function() { expect(CesiumMath.negativePiToPi((Math.PI / 2) * Math.PI)).toEqualEpsilon((Math.PI / 2) * Math.PI - CesiumMath.TWO_PI, CesiumMath.EPSILON16); expect(CesiumMath.negativePiToPi(Math.PI / 0.5)).toEqualEpsilon(0.0, CesiumMath.EPSILON16); expect(CesiumMath.negativePiToPi(Math.PI + CesiumMath.EPSILON10)).toEqualEpsilon(Math.PI, CesiumMath.EPSILON16); }); - it("negativePiToPi negative", function() { + it('negativePiToPi negative', function() { expect(CesiumMath.negativePiToPi(-Math.PI / 0.5)).toEqualEpsilon(0.0, CesiumMath.EPSILON16); expect(CesiumMath.negativePiToPi(-(Math.PI / 2) * Math.PI)).toEqualEpsilon(-(Math.PI / 2) * Math.PI + CesiumMath.TWO_PI, CesiumMath.EPSILON16); expect(CesiumMath.negativePiToPi(-(Math.PI + CesiumMath.EPSILON10))).toEqualEpsilon(-Math.PI, CesiumMath.EPSILON16); }); - it("negativePiToPi should not change", function() { + it('negativePiToPi should not change', function() { expect(CesiumMath.negativePiToPi(Math.PI - 1)).toEqualEpsilon(Math.PI - 1, CesiumMath.EPSILON16); expect(CesiumMath.negativePiToPi(-Math.PI + 1)).toEqualEpsilon(-Math.PI + 1, CesiumMath.EPSILON16); }); diff --git a/Specs/Core/Matrix2Spec.js b/Specs/Core/Matrix2Spec.js index bd73da2123f..e1f2961a31d 100644 --- a/Specs/Core/Matrix2Spec.js +++ b/Specs/Core/Matrix2Spec.js @@ -8,7 +8,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var m = new Matrix2(); expect(m.getColumn0Row0()).toEqual(0); expect(m.getColumn0Row1()).toEqual(0); @@ -16,7 +16,7 @@ defineSuite([ expect(m.getColumn1Row1()).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var m = new Matrix2(1); expect(m.getColumn0Row0()).toEqual(1); expect(m.getColumn0Row1()).toEqual(0); @@ -24,7 +24,7 @@ defineSuite([ expect(m.getColumn1Row1()).toEqual(1); }); - it("construct2", function() { + it('construct2', function() { var m = new Matrix2(1, 2, 3, 4); expect(m.getColumn0Row0()).toEqual(1); @@ -33,26 +33,26 @@ defineSuite([ expect(m.getColumn1Row1()).toEqual(4); }); - it("creates a non-uniform scale matrix", function() { + it('creates a non-uniform scale matrix', function() { var m = Matrix2.createNonUniformScale(new Cartesian2(1, 2)); expect(m.getColumn0().equals(new Cartesian2(1, 0))).toEqual(true); expect(m.getColumn1().equals(new Cartesian2(0, 2))).toEqual(true); }); - it("creates a uniform scale matrix", function() { + it('creates a uniform scale matrix', function() { var m0 = Matrix2.createScale(2); var m1 = Matrix2.createNonUniformScale(new Cartesian2(2, 2)); expect(m0.equals(m1)).toEqual(true); }); - it("creates scale matrices without arguments", function() { + it('creates scale matrices without arguments', function() { expect(Matrix2.createNonUniformScale().equals(new Matrix2())).toEqual(true); expect(Matrix2.createScale().equals(new Matrix2())).toEqual(true); }); - it("creates from a column major array", function() { + it('creates from a column major array', function() { var values = [1, 2, 3, 4]; var m = Matrix2.fromColumnMajorArray(values); @@ -62,15 +62,15 @@ defineSuite([ expect(m.getColumn1Row1()).toEqual(4); }); - it("creates from a column major array 2", function() { + it('creates from a column major array 2', function() { expect(Matrix2.fromColumnMajorArray().equals(new Matrix2())).toEqual(true); }); - it("IDENTITY", function() { + it('IDENTITY', function() { expect(Matrix2.IDENTITY.equals(new Matrix2(1))).toEqual(true); }); - it("getColumnMajorValue0", function() { + it('getColumnMajorValue0', function() { var m = new Matrix2(1, 2, 3, 4); expect(m.getColumnMajorValue(0)).toEqual(1); @@ -79,19 +79,19 @@ defineSuite([ expect(m.getColumnMajorValue(3)).toEqual(4); }); - it("getColumnMajorValue1", function() { + it('getColumnMajorValue1', function() { expect(function() { new Matrix2().getColumnMajorValue(-1); }).toThrow(); }); - it("getColumnMajorValue2", function() { + it('getColumnMajorValue2', function() { expect(function() { new Matrix2().getColumnMajorValue(4); }).toThrow(); }); - it("gets individual columns", function() { + it('gets individual columns', function() { var m = new Matrix2(1, 2, 4, 5); @@ -99,12 +99,12 @@ defineSuite([ expect(m.getColumn1().equals(new Cartesian2(2, 5))).toEqual(true); }); - it("gets individual columns 2", function() { + it('gets individual columns 2', function() { expect(Matrix2.IDENTITY.getColumn0().equals(Cartesian2.UNIT_X)).toEqual(true); expect(Matrix2.IDENTITY.getColumn1().equals(Cartesian2.UNIT_Y)).toEqual(true); }); - it("sets individual columns", function() { + it('sets individual columns', function() { var m = new Matrix2(); var c0 = new Cartesian2(1, 2); var c1 = new Cartesian2(3, 4); @@ -119,7 +119,7 @@ defineSuite([ 2, 4))).toEqual(true); }); - it("gets individual rows", function() { + it('gets individual rows', function() { var m = new Matrix2(1, 2, 3, 4); @@ -127,12 +127,12 @@ defineSuite([ expect(m.getRow1().equals(new Cartesian2(3, 4))).toEqual(true); }); - it("gets individual rows 2", function() { + it('gets individual rows 2', function() { expect(Matrix2.IDENTITY.getRow0().equals(Cartesian2.UNIT_X)).toEqual(true); expect(Matrix2.IDENTITY.getRow1().equals(Cartesian2.UNIT_Y)).toEqual(true); }); - it("sets individual rows", function() { + it('sets individual rows', function() { var m = new Matrix2(); var c0 = new Cartesian2(1, 2); var c1 = new Cartesian2(3, 4); @@ -147,11 +147,11 @@ defineSuite([ 3, 4))).toEqual(true); }); - it("getNumberOfElements0", function() { + it('getNumberOfElements0', function() { expect(Matrix2.getNumberOfElements()).toEqual(4); }); - it("transpose", function() { + it('transpose', function() { var m = new Matrix2(1, 2, 3, 4); var mT = new Matrix2(1, 3, @@ -161,7 +161,7 @@ defineSuite([ expect(m.transpose().transpose().equals(m)).toEqual(true); }); - it("equals0", function() { + it('equals0', function() { var m = new Matrix2(1, 2, 3, 4); var m2 = new Matrix2(1, 2, @@ -169,7 +169,7 @@ defineSuite([ expect(m.equals(m2)).toEqual(true); }); - it("equals1", function() { + it('equals1', function() { var m = new Matrix2(1, 2, 3, 4); var m2 = new Matrix2(1, 9, @@ -177,7 +177,7 @@ defineSuite([ expect(m.equals(m2)).toEqual(false); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { var m = new Matrix2(1, 2, 3, 4); var m2 = new Matrix2(2, 3, @@ -186,13 +186,13 @@ defineSuite([ expect(m.equalsEpsilon(m2, 0.5)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var m = new Matrix2(1, 2, 3, 4); - expect(m.toString()).toEqual("(1, 2)\n(3, 4)"); + expect(m.toString()).toEqual('(1, 2)\n(3, 4)'); }); - it("throws when creating from a column major array without enough elements", function() { + it('throws when creating from a column major array without enough elements', function() { var values = [1, 2, 3]; @@ -201,7 +201,7 @@ defineSuite([ }).toThrow(); }); - it("clone", function() { + it('clone', function() { var m = new Matrix2(1.0, 2.0, 3.0, 4.0); var n = m.clone(); diff --git a/Specs/Core/Matrix3Spec.js b/Specs/Core/Matrix3Spec.js index 9e2ac5826f7..90afcedd672 100644 --- a/Specs/Core/Matrix3Spec.js +++ b/Specs/Core/Matrix3Spec.js @@ -8,7 +8,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var m = new Matrix3(); expect(m.getColumn0Row0()).toEqual(0); expect(m.getColumn0Row1()).toEqual(0); @@ -21,7 +21,7 @@ defineSuite([ expect(m.getColumn2Row2()).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var m = new Matrix3(1); expect(m.getColumn0Row0()).toEqual(1); expect(m.getColumn0Row1()).toEqual(0); @@ -34,7 +34,7 @@ defineSuite([ expect(m.getColumn2Row2()).toEqual(1); }); - it("construct2", function() { + it('construct2', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -49,7 +49,7 @@ defineSuite([ expect(m.getColumn2Row2()).toEqual(9); }); - it("creates a non-uniform scale matrix", function() { + it('creates a non-uniform scale matrix', function() { var m = Matrix3.createNonUniformScale(new Cartesian3(1, 2, 3)); expect(m.getColumn0().equals(new Cartesian3(1, 0, 0))).toEqual(true); @@ -57,19 +57,19 @@ defineSuite([ expect(m.getColumn2().equals(new Cartesian3(0, 0, 3))).toEqual(true); }); - it("creates a uniform scale matrix", function() { + it('creates a uniform scale matrix', function() { var m0 = Matrix3.createScale(2); var m1 = Matrix3.createNonUniformScale(new Cartesian3(2, 2, 2)); expect(m0.equals(m1)).toEqual(true); }); - it("creates scale matrices without arguments", function() { + it('creates scale matrices without arguments', function() { expect(Matrix3.createNonUniformScale().equals(new Matrix3())).toEqual(true); expect(Matrix3.createScale().equals(new Matrix3())).toEqual(true); }); - it("creates from a column major array", function() { + it('creates from a column major array', function() { var values = [1, 2, 3, 4, 5, 6, 7, 8, 9]; @@ -86,15 +86,15 @@ defineSuite([ expect(m.getColumn2Row2()).toEqual(9); }); - it("creates from a column major array 2", function() { + it('creates from a column major array 2', function() { expect(Matrix3.fromColumnMajorArray().equals(new Matrix3())).toEqual(true); }); - it("IDENTITY", function() { + it('IDENTITY', function() { expect(Matrix3.IDENTITY.equals(new Matrix3(1))).toEqual(true); }); - it("getColumnMajorValue0", function() { + it('getColumnMajorValue0', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -109,19 +109,19 @@ defineSuite([ expect(m.getColumnMajorValue(8)).toEqual(9); }); - it("getColumnMajorValue1", function() { + it('getColumnMajorValue1', function() { expect(function() { new Matrix3().getColumnMajorValue(-1); }).toThrow(); }); - it("getColumnMajorValue2", function() { + it('getColumnMajorValue2', function() { expect(function() { new Matrix3().getColumnMajorValue(9); }).toThrow(); }); - it("gets individual columns", function() { + it('gets individual columns', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -131,13 +131,13 @@ defineSuite([ expect(m.getColumn2().equals(new Cartesian3(3, 6, 9))).toEqual(true); }); - it("gets individual columns 2", function() { + it('gets individual columns 2', function() { expect(Matrix3.IDENTITY.getColumn0().equals(Cartesian3.UNIT_X)).toEqual(true); expect(Matrix3.IDENTITY.getColumn1().equals(Cartesian3.UNIT_Y)).toEqual(true); expect(Matrix3.IDENTITY.getColumn2().equals(Cartesian3.UNIT_Z)).toEqual(true); }); - it("sets individual columns", function() { + it('sets individual columns', function() { var m = new Matrix3(); var c0 = new Cartesian3(1, 2, 3); var c1 = new Cartesian3(4, 5, 6); @@ -156,7 +156,7 @@ defineSuite([ 3, 6, 9))).toEqual(true); }); - it("gets individual rows", function() { + it('gets individual rows', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -166,13 +166,13 @@ defineSuite([ expect(m.getRow2().equals(new Cartesian3(7, 8, 9))).toEqual(true); }); - it("gets individual rows 2", function() { + it('gets individual rows 2', function() { expect(Matrix3.IDENTITY.getRow0().equals(Cartesian3.UNIT_X)).toEqual(true); expect(Matrix3.IDENTITY.getRow1().equals(Cartesian3.UNIT_Y)).toEqual(true); expect(Matrix3.IDENTITY.getRow2().equals(Cartesian3.UNIT_Z)).toEqual(true); }); - it("sets individual rows", function() { + it('sets individual rows', function() { var m = new Matrix3(); var c0 = new Cartesian3(1, 2, 3); var c1 = new Cartesian3(4, 5, 6); @@ -191,11 +191,11 @@ defineSuite([ 7, 8, 9))).toEqual(true); }); - it("getNumberOfElements0", function() { + it('getNumberOfElements0', function() { expect(Matrix3.getNumberOfElements()).toEqual(9); }); - it("equals0", function() { + it('equals0', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -205,7 +205,7 @@ defineSuite([ expect(m.equals(m2)).toEqual(true); }); - it("equals1", function() { + it('equals1', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -215,7 +215,7 @@ defineSuite([ expect(m.equals(m2)).toEqual(false); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -226,14 +226,14 @@ defineSuite([ expect(m.equalsEpsilon(m2, 0.5)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); - expect(m.toString()).toEqual("(1, 2, 3)\n(4, 5, 6)\n(7, 8, 9)"); + expect(m.toString()).toEqual('(1, 2, 3)\n(4, 5, 6)\n(7, 8, 9)'); }); - it("transpose", function() { + it('transpose', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -245,20 +245,20 @@ defineSuite([ expect(m.transpose().transpose().equals(m)).toEqual(true); }); - it("multiplyWithVector0", function() { + it('multiplyWithVector0', function() { var m = new Matrix3(1); var v = new Cartesian3(1, 2, 3); expect(m.multiplyWithVector(v).equals(v)).toEqual(true); }); - it("multiplyWithVector1", function() { + it('multiplyWithVector1', function() { var m = new Matrix3(2); var v = new Cartesian3(1, 2, 3); var u = new Cartesian3(2, 4, 6); expect(m.multiplyWithVector(v).equals(u)).toEqual(true); }); - it("negate", function() { + it('negate', function() { var m = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -270,7 +270,7 @@ defineSuite([ expect(m.negate().negate().equals(m)).toEqual(true); }); - it("multiplyWithMatrix", function() { + it('multiplyWithMatrix', function() { var m = new Matrix3(1, 2, 3, 1, 2, 3, 1, 2, 3); @@ -280,7 +280,7 @@ defineSuite([ expect(m.multiplyWithMatrix(m).equals(n)).toEqual(true); }); - it("rotates around Z", function() { + it('rotates around Z', function() { var theta = Math.PI / 3; var s = Math.sin(theta); var c = Math.cos(theta); @@ -292,7 +292,7 @@ defineSuite([ expect(Matrix3.rotationAroundZ(theta).equals(m)).toEqual(true); }); - it("rotates around Y", function() { + it('rotates around Y', function() { var theta = Math.PI / 3; var s = Math.sin(theta); var c = Math.cos(theta); @@ -304,7 +304,7 @@ defineSuite([ expect(Matrix3.rotationAroundY(theta).equals(m)).toEqual(true); }); - it("rotates around X", function() { + it('rotates around X', function() { var theta = Math.PI / 3; var s = Math.sin(theta); var c = Math.cos(theta); @@ -316,25 +316,25 @@ defineSuite([ expect(Matrix3.rotationAroundX(theta).equals(m)).toEqual(true); }); - it("fromAxisAngle (z)", function() { + it('fromAxisAngle (z)', function() { var theta = Math.PI / 3; var zAxis = new Cartesian3(0.0, 0.0, 1.0); expect(Matrix3.fromAxisAngle(zAxis, theta).equals(Matrix3.rotationAroundZ(theta))).toEqual(true); }); - it("fromAxisAngle (y)", function() { + it('fromAxisAngle (y)', function() { var theta = Math.PI / 3; var yAxis = new Cartesian3(0.0, 1.0, 0.0); expect(Matrix3.fromAxisAngle(yAxis, theta).equals(Matrix3.rotationAroundY(theta))).toEqual(true); }); - it("fromAxisAngle (x)", function() { + it('fromAxisAngle (x)', function() { var theta = Math.PI / 3; var xAxis = new Cartesian3(1.0, 0.0, 0.0); expect(Matrix3.fromAxisAngle(xAxis, theta).equals(Matrix3.rotationAroundX(theta))).toEqual(true); }); - it("throws when creating from a column major array without enough elements", function() { + it('throws when creating from a column major array without enough elements', function() { var values = [1, 2, 3, 4, 5, 6, 7, 8]; @@ -344,7 +344,7 @@ defineSuite([ }).toThrow(); }); - it("clone", function() { + it('clone', function() { var m = new Matrix3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); diff --git a/Specs/Core/Matrix4Spec.js b/Specs/Core/Matrix4Spec.js index 5b4f1a6d3e8..008f350c57b 100644 --- a/Specs/Core/Matrix4Spec.js +++ b/Specs/Core/Matrix4Spec.js @@ -14,7 +14,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var m = new Matrix4(); expect(m.getColumn0Row0()).toEqual(0); expect(m.getColumn0Row1()).toEqual(0); @@ -34,7 +34,7 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(0); }); - it("construct1", function() { + it('construct1', function() { var m = new Matrix4(1); expect(m.getColumn0Row0()).toEqual(1); expect(m.getColumn0Row1()).toEqual(0); @@ -54,7 +54,7 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(1); }); - it("construct2", function() { + it('construct2', function() { var m = new Matrix4(new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9), new Cartesian3(10, 11, 12)); @@ -77,7 +77,7 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(1); }); - it("construct3", function() { + it('construct3', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -101,7 +101,7 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(16); }); - it("creates from a column major array", function() { + it('creates from a column major array', function() { var values = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -126,11 +126,11 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(16); }); - it("creates from a column major array 2", function() { + it('creates from a column major array 2', function() { expect(Matrix4.fromColumnMajorArray().equals(new Matrix4())).toEqual(true); }); - it("creates a non-uniform scale matrix", function() { + it('creates a non-uniform scale matrix', function() { var m = Matrix4.createNonUniformScale(new Cartesian3(1, 2, 3)); expect(m.getColumn0().equals(new Cartesian4(1, 0, 0, 0))).toEqual(true); @@ -139,19 +139,19 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(0, 0, 0, 1))).toEqual(true); }); - it("creates a uniform scale matrix", function() { + it('creates a uniform scale matrix', function() { var m0 = Matrix4.createScale(2); var m1 = Matrix4.createNonUniformScale(new Cartesian3(2, 2, 2)); expect(m0.equals(m1)).toEqual(true); }); - it("creates scale matrices without arguments", function() { + it('creates scale matrices without arguments', function() { expect(Matrix4.createNonUniformScale().equals(new Matrix4())).toEqual(true); expect(Matrix4.createScale().equals(new Matrix4())).toEqual(true); }); - it("creates a translation matrix", function() { + it('creates a translation matrix', function() { var t = new Cartesian3(1, 2, 3); var m = Matrix4.createTranslation(t); expect(m.getColumn0Row0()).toEqual(1); @@ -172,7 +172,7 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(1); }); - it("creates a translation matrix without arguments", function() { + it('creates a translation matrix without arguments', function() { var m = Matrix4.createTranslation(); expect(m.getColumn0Row0()).toEqual(0); expect(m.getColumn0Row1()).toEqual(0); @@ -192,11 +192,11 @@ defineSuite([ expect(m.getColumn3Row3()).toEqual(0); }); - it("IDENTITY", function() { + it('IDENTITY', function() { expect(Matrix4.IDENTITY.equals(new Matrix4(1))).toEqual(true); }); - it("getColumnMajorValue0", function() { + it('getColumnMajorValue0', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -220,19 +220,19 @@ defineSuite([ expect(m.getColumnMajorValue(15)).toEqual(16); }); - it("getColumnMajorValue1", function() { + it('getColumnMajorValue1', function() { expect(function() { new Matrix4().getColumnMajorValue(-1); }).toThrow(); }); - it("getColumnMajorValue2", function() { + it('getColumnMajorValue2', function() { expect(function() { new Matrix4().getColumnMajorValue(16); }).toThrow(); }); - it("gets individual columns", function() { + it('gets individual columns', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -244,14 +244,14 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(4, 8, 12, 16))).toEqual(true); }); - it("gets individual columns 2", function() { + it('gets individual columns 2', function() { expect(Matrix4.IDENTITY.getColumn0().equals(Cartesian4.UNIT_X)).toEqual(true); expect(Matrix4.IDENTITY.getColumn1().equals(Cartesian4.UNIT_Y)).toEqual(true); expect(Matrix4.IDENTITY.getColumn2().equals(Cartesian4.UNIT_Z)).toEqual(true); expect(Matrix4.IDENTITY.getColumn3().equals(Cartesian4.UNIT_W)).toEqual(true); }); - it("sets individual columns", function() { + it('sets individual columns', function() { var m = new Matrix4(); var c0 = new Cartesian4(1, 2, 3, 4); var c1 = new Cartesian4(5, 6, 7, 8); @@ -274,7 +274,7 @@ defineSuite([ 4, 8, 12, 16))).toEqual(true); }); - it("gets individual rows", function() { + it('gets individual rows', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -286,14 +286,14 @@ defineSuite([ expect(m.getRow3().equals(new Cartesian4(13, 14, 15, 16))).toEqual(true); }); - it("gets individual rows 2", function() { + it('gets individual rows 2', function() { expect(Matrix4.IDENTITY.getRow0().equals(Cartesian4.UNIT_X)).toEqual(true); expect(Matrix4.IDENTITY.getRow1().equals(Cartesian4.UNIT_Y)).toEqual(true); expect(Matrix4.IDENTITY.getRow2().equals(Cartesian4.UNIT_Z)).toEqual(true); expect(Matrix4.IDENTITY.getRow3().equals(Cartesian4.UNIT_W)).toEqual(true); }); - it("sets individual rows", function() { + it('sets individual rows', function() { var m = new Matrix4(); var c0 = new Cartesian4(1, 2, 3, 4); var c1 = new Cartesian4(5, 6, 7, 8); @@ -316,11 +316,11 @@ defineSuite([ 13, 14, 15, 16))).toEqual(true); }); - it("getNumberOfElements0", function() { + it('getNumberOfElements0', function() { expect(Matrix4.getNumberOfElements()).toEqual(16); }); - it("equals0", function() { + it('equals0', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -332,7 +332,7 @@ defineSuite([ expect(m.equals(m2)).toEqual(true); }); - it("equals1", function() { + it('equals1', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -344,7 +344,7 @@ defineSuite([ expect(m.equals(m2)).toEqual(false); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -357,15 +357,15 @@ defineSuite([ expect(m.equalsEpsilon(m2, 0.5)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); - expect(m.toString()).toEqual("(1, 2, 3, 4)\n(5, 6, 7, 8)\n(9, 10, 11, 12)\n(13, 14, 15, 16)"); + expect(m.toString()).toEqual('(1, 2, 3, 4)\n(5, 6, 7, 8)\n(9, 10, 11, 12)\n(13, 14, 15, 16)'); }); - it("getRotation", function() { + it('getRotation', function() { var r = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -375,7 +375,7 @@ defineSuite([ expect(r.equals(r2)).toEqual(true); }); - it("getRotationTranspose", function() { + it('getRotationTranspose', function() { var r = new Matrix3(1, 2, 3, 4, 5, 6, 7, 8, 9); @@ -385,7 +385,7 @@ defineSuite([ expect(r.transpose().equals(r2)).toEqual(true); }); - it("inverseTransformation0", function() { + it('inverseTransformation0', function() { var m = new Matrix4(Matrix3.IDENTITY, Cartesian3.ZERO); var mInverse = m.inverseTransformation(); @@ -396,7 +396,7 @@ defineSuite([ expect(v.equals(vv)).toEqual(true); }); - it("inverseTransformation1", function() { + it('inverseTransformation1', function() { var rotation = new Matrix3(1, 0, 0, 0, 0, 1, 0, 1, 0); @@ -412,7 +412,7 @@ defineSuite([ expect(v.equals(vv)).toEqual(true); }); - it("inverseTransformation2", function() { + it('inverseTransformation2', function() { var rotation = new Matrix3(1, 0, 0, 0, 0, 1, 0, 1, 0); @@ -424,21 +424,21 @@ defineSuite([ expect(Matrix4.IDENTITY.equals(mInverse.multiplyWithMatrix(m))).toEqual(true); }); - it("inverse0", function() { + it('inverse0', function() { var m = new Matrix4(Matrix3.IDENTITY, Cartesian3.ZERO); var mInverse = m.inverse(); expect(Matrix4.IDENTITY.equals(mInverse.multiplyWithMatrix(m))).toEqual(true); }); - it("inverse1", function() { + it('inverse1', function() { var m = new Matrix4(Matrix3.IDENTITY, new Cartesian3(1, 2, 3)); var mInverse = m.inverse(); expect(Matrix4.IDENTITY.equals(mInverse.multiplyWithMatrix(m))).toEqual(true); }); - it("inverse2", function() { + it('inverse2', function() { var m = new Matrix4( 0.72, 0.70, 0.00, 0.00, -0.40, 0.41, 0.82, 0.00, 0.57, -0.59, 0.57, -3.86, @@ -448,7 +448,7 @@ defineSuite([ expect(Matrix4.IDENTITY.equalsEpsilon(mInverse.multiplyWithMatrix(m), CesiumMath.EPSILON10)).toEqual(true); }); - it("inverse3", function() { + it('inverse3', function() { expect(function() { new Matrix4( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, @@ -457,7 +457,7 @@ defineSuite([ }).toThrow(); }); - it("getTranslation", function() { + it('getTranslation', function() { var t = new Cartesian3(1, 2, 3); var m = new Matrix4(new Matrix3(), t); var t2 = m.getTranslation(); @@ -465,7 +465,7 @@ defineSuite([ expect(t.equals(t2)).toEqual(true); }); - it("transpose", function() { + it('transpose', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -479,20 +479,20 @@ defineSuite([ expect(m.transpose().transpose().equals(m)).toEqual(true); }); - it("multiplyWithVector0", function() { + it('multiplyWithVector0', function() { var m = new Matrix4(1); var v = new Cartesian4(1, 2, 3, 4); expect(m.multiplyWithVector(v).equals(v)).toEqual(true); }); - it("multiplyWithVector1", function() { + it('multiplyWithVector1', function() { var m = new Matrix4(2); var v = new Cartesian4(1, 2, 3, 4); var u = new Cartesian4(2, 4, 6, 8); expect(m.multiplyWithVector(v).equals(u)).toEqual(true); }); - it("multiplyWithMatrix0", function() { + it('multiplyWithMatrix0', function() { var zero = new Matrix4(0); var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, @@ -501,7 +501,7 @@ defineSuite([ expect(zero.multiplyWithMatrix(m).equals(zero)).toEqual(true); }); - it("multiplyWithMatrix1", function() { + it('multiplyWithMatrix1', function() { var i = Matrix4.IDENTITY; var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, @@ -510,7 +510,7 @@ defineSuite([ expect(i.multiplyWithMatrix(m).equals(m)).toEqual(true); }); - it("multiplyWithMatrix2", function() { + it('multiplyWithMatrix2', function() { var m = new Matrix4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -522,7 +522,7 @@ defineSuite([ expect(m.multiplyWithMatrix(m).equals(result)).toEqual(true); }); - it("negate", function() { + it('negate', function() { var m = new Matrix4( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -536,31 +536,31 @@ defineSuite([ expect(m.negate().negate().equals(m)).toEqual(true); }); - it("createPerspectiveFieldOfView0", function() { + it('createPerspectiveFieldOfView0', function() { expect(function() { Matrix4.createPerspectiveFieldOfView(-1, 1, 1, 1); }).toThrow(); }); - it("createPerspectiveFieldOfView1", function() { + it('createPerspectiveFieldOfView1', function() { expect(function() { Matrix4.createPerspectiveFieldOfView(CesiumMath.PI_OVER_TWO, 0, 1, 1); }).toThrow(); }); - it("createPerspectiveFieldOfView2", function() { + it('createPerspectiveFieldOfView2', function() { expect(function() { Matrix4.createPerspectiveFieldOfView(CesiumMath.PI_OVER_TWO, 1, 0, 1); }).toThrow(); }); - it("createPerspectiveFieldOfView3", function() { + it('createPerspectiveFieldOfView3', function() { expect(function() { Matrix4.createPerspectiveFieldOfView(CesiumMath.PI_OVER_TWO, 1, 1, 0); }).toThrow(); }); - it("createPerspectiveFieldOfView4", function() { + it('createPerspectiveFieldOfView4', function() { var mExpected = new Matrix4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1.22, -2.22, @@ -570,7 +570,7 @@ defineSuite([ expect(mExpected.equalsEpsilon(m, CesiumMath.EPSILON2)).toEqual(true); }); - it("createPerspectiveOffCenter", function() { + it('createPerspectiveOffCenter', function() { var mExpected = new Matrix4(2, 0, 3, 0, 0, 2, 5, 0, 0, 0, -3, -4, @@ -580,7 +580,7 @@ defineSuite([ expect(mExpected.equalsEpsilon(m, CesiumMath.EPSILON2)).toEqual(true); }); - it("createInfinitePerspectiveOffCenter", function() { + it('createInfinitePerspectiveOffCenter', function() { var mExpected = new Matrix4(2, 0, 3, 0, 0, 2, 5, 0, 0, 0, -1, -2, @@ -590,7 +590,7 @@ defineSuite([ expect(mExpected.equalsEpsilon(m, CesiumMath.EPSILON2)).toEqual(true); }); - it("createOrthographicOffCenter", function() { + it('createOrthographicOffCenter', function() { var mExpected = new Matrix4(2, 0, 0, -1, 0, 2, 0, -5, 0, 0, -2, -1, @@ -600,7 +600,7 @@ defineSuite([ expect(mExpected.equals(m)).toEqual(true); }); - it("creates a viewport transformation", function() { + it('creates a viewport transformation', function() { var mExpected = new Matrix4(2.0, 0.0, 0.0, 2.0, 0.0, 3.0, 0.0, 3.0, 0.0, 0.0, 1.0, 1.0, @@ -615,14 +615,14 @@ defineSuite([ expect(mExpected.equals(m)).toEqual(true); }); - it("createLookAt", function() { + it('createLookAt', function() { var mExpected = new Matrix4(1); var m = Matrix4.createLookAt(Cartesian3.ZERO, Cartesian3.UNIT_Z.negate(), Cartesian3.UNIT_Y); expect(mExpected.equals(m)).toEqual(true); }); - it("throws when creating from a column major array without enough elements", function() { + it('throws when creating from a column major array without enough elements', function() { var values = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, @@ -633,7 +633,7 @@ defineSuite([ }).toThrow(); }); - it("clone", function() { + it('clone', function() { var m = new Matrix4( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, diff --git a/Specs/Core/MeshFiltersSpec.js b/Specs/Core/MeshFiltersSpec.js index 2c37e2d0445..722a715ec31 100644 --- a/Specs/Core/MeshFiltersSpec.js +++ b/Specs/Core/MeshFiltersSpec.js @@ -20,7 +20,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("converts triangles to wireframe in place", function() { + it('converts triangles to wireframe in place', function() { var mesh = MeshFilters.toWireframeInPlace({ indexLists : [{ primitiveType : PrimitiveType.TRIANGLES, @@ -48,7 +48,7 @@ defineSuite([ expect(v[11]).toEqual(3); }); - it("converts a triangle fan to wireframe in place", function() { + it('converts a triangle fan to wireframe in place', function() { var mesh = MeshFilters.toWireframeInPlace({ indexLists : [{ primitiveType : PrimitiveType.TRIANGLE_FAN, @@ -76,7 +76,7 @@ defineSuite([ expect(v[11]).toEqual(0); }); - it("converts a triangle strip to wireframe in place", function() { + it('converts a triangle strip to wireframe in place', function() { var mesh = MeshFilters.toWireframeInPlace({ indexLists : [{ primitiveType : PrimitiveType.TRIANGLE_STRIP, @@ -104,7 +104,7 @@ defineSuite([ expect(v[11]).toEqual(2); }); - it("creates attribute indices", function() { + it('creates attribute indices', function() { var mesh = { attributes : { position : {}, @@ -122,7 +122,7 @@ defineSuite([ expect(indices.position).not.toEqual(indices.color); }); - it("maps attribute indices to different names", function() { + it('maps attribute indices to different names', function() { var indices = { positions : 0, normals : 1, @@ -130,9 +130,9 @@ defineSuite([ }; var mappedIndices = MeshFilters.mapAttributeIndices(indices, { - positions : "position", - normals : "normal", - colors : "color" + positions : 'position', + normals : 'normal', + colors : 'color' }); expect(mappedIndices.position).toEqual(indices.positions); @@ -140,7 +140,7 @@ defineSuite([ expect(mappedIndices.color).toEqual(indices.colors); }); - it("throws an exception when mesh properties have a different number of attributes", function() { + it('throws an exception when mesh properties have a different number of attributes', function() { expect(function() { var mesh = {}; mesh.attributes = {}; @@ -160,7 +160,7 @@ defineSuite([ }).toThrow(); }); - it("can reorder all indices and attributes for the pre vertex cahce", function() { + it('can reorder all indices and attributes for the pre vertex cahce', function() { var mesh = {}; mesh.attributes = {}; mesh.indexLists = []; @@ -178,7 +178,7 @@ defineSuite([ mesh.attributes.vertexNames = { componentDatatype : ComponentDatatype.FLOAT, componentsPerAttribute : 1, - values : ["v0", "v1", "v2", "v3", "v4", "v5"] + values : ['v0', 'v1', 'v2', 'v3', 'v4', 'v5'] }; mesh.attributes.positions = { @@ -202,12 +202,12 @@ defineSuite([ expect(mesh.indexLists[1].values[4]).toEqual(0); expect(mesh.indexLists[1].values[5]).toEqual(3); - expect(mesh.attributes.vertexNames.values[0]).toEqual("v5"); - expect(mesh.attributes.vertexNames.values[1]).toEqual("v3"); - expect(mesh.attributes.vertexNames.values[2]).toEqual("v2"); - expect(mesh.attributes.vertexNames.values[3]).toEqual("v0"); - expect(mesh.attributes.vertexNames.values[4]).toEqual("v1"); - expect(mesh.attributes.vertexNames.values[5]).toEqual("v4"); + expect(mesh.attributes.vertexNames.values[0]).toEqual('v5'); + expect(mesh.attributes.vertexNames.values[1]).toEqual('v3'); + expect(mesh.attributes.vertexNames.values[2]).toEqual('v2'); + expect(mesh.attributes.vertexNames.values[3]).toEqual('v0'); + expect(mesh.attributes.vertexNames.values[4]).toEqual('v1'); + expect(mesh.attributes.vertexNames.values[5]).toEqual('v4'); expect(mesh.attributes.positions.values[0]).toEqual(15); expect(mesh.attributes.positions.values[1]).toEqual(16); @@ -229,7 +229,7 @@ defineSuite([ expect(mesh.attributes.positions.values[17]).toEqual(14); }); - it("can reorder indices for the post vertex cache", function() { + it('can reorder indices for the post vertex cache', function() { var mesh = CubeMapEllipsoidTessellator.compute(new Ellipsoid(new Cartesian3(10.0, 10.0, 10.0)), 100); var indices = mesh.indexLists[0].values; var numIndices = indices.length; @@ -251,7 +251,7 @@ defineSuite([ expect(ACMRafter).toBeLessThan(0.70); }); - it("fitToUnsignedShortIndices doesn't change mesh", function() { + it('fitToUnsignedShortIndices does not change mesh', function() { var mesh = { attributes : { time : { @@ -277,7 +277,7 @@ defineSuite([ expect(meshes[0]).toBe(mesh); }); - it("fitToUnsignedShortIndices creates one mesh", function() { + it('fitToUnsignedShortIndices creates one mesh', function() { var sixtyFourK = 64 * 1024; var times = []; for ( var i = 0; i < sixtyFourK + 1; ++i) { @@ -309,7 +309,7 @@ defineSuite([ expect(meshes[0].indexLists[0].values).toEqualArray([0, 0, 0, 1, 1, 1, 0, 1, 0]); }); - it("fitToUnsignedShortIndices creates two meshes", function() { + it('fitToUnsignedShortIndices creates two meshes', function() { var sixtyFourK = 64 * 1024; var positions = []; @@ -348,7 +348,7 @@ defineSuite([ expect(meshes[1].indexLists[0].values.length).toEqual(3); }); - it("fitToUnsignedShortIndices throws without triangles", function() { + it('fitToUnsignedShortIndices throws without triangles', function() { var mesh = { attributes : { time : { @@ -369,7 +369,7 @@ defineSuite([ }).toThrow(); }); - it("fitToUnsignedShortIndices throws with different numbers of attributes", function() { + it('fitToUnsignedShortIndices throws with different numbers of attributes', function() { var mesh = { attributes : { time : { @@ -396,7 +396,7 @@ defineSuite([ }).toThrow(); }); - it("projectTo2D", function() { + it('projectTo2D', function() { var p1 = new Cartesian3(1, 2, 3); var p2 = new Cartesian3(4, 5, 6); diff --git a/Specs/Core/OccluderSpec.js b/Specs/Core/OccluderSpec.js index 5126524a251..4633b42d6c7 100644 --- a/Specs/Core/OccluderSpec.js +++ b/Specs/Core/OccluderSpec.js @@ -14,25 +14,25 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("throws an exception during construction (1 of 3)", function() { + it('throws an exception during construction (1 of 3)', function() { expect(function() { return new Occluder(); }).toThrow(); }); - it("throws an exception during construction (2 of 3)", function() { + it('throws an exception during construction (2 of 3)', function() { expect(function() { return new Occluder(new BoundingSphere(new Cartesian3(0, 0, 0))); }).toThrow(); }); - it("throws an exception during construction (3 of 3)", function() { + it('throws an exception during construction (3 of 3)', function() { expect(function() { return new Occluder(new Cartesian3(0, 0, 0)); }).toThrow(); }); - it("can entirely eclipse a smaller occludee", function() { + it('can entirely eclipse a smaller occludee', function() { var giantSphere = new BoundingSphere(new Cartesian3(0, 0, -1.5), 0.5); var littleSphere = new BoundingSphere(new Cartesian3(0, 0, -2.75), 0.25); var cameraPosition = Cartesian3.ZERO; @@ -41,7 +41,7 @@ defineSuite([ expect(occluder.getVisibility(littleSphere)).toEqual(Visibility.NONE); }); - it("can have a fully visible occludee", function() { + it('can have a fully visible occludee', function() { var bigSphere = new BoundingSphere(new Cartesian3(0, 0, -1.5), 0.5); var littleSphere = new BoundingSphere(new Cartesian3(0, 0, -2.75), 0.25); var cameraPosition = Cartesian3.ZERO; @@ -51,7 +51,7 @@ defineSuite([ expect(occluder.getVisibility(bigSphere)).toEqual(Visibility.FULL); }); - it("blocks the occludee when both are aligned and the same size", function() { + it('blocks the occludee when both are aligned and the same size', function() { var sphere1 = new BoundingSphere(new Cartesian3(0, 0, -1.5), 0.5); var sphere2 = new BoundingSphere(new Cartesian3(0, 0, -2.5), 0.5); var cameraPosition = Cartesian3.ZERO; @@ -60,7 +60,7 @@ defineSuite([ expect(occluder.getVisibility(sphere2)).toEqual(Visibility.NONE); }); - it("can have a fully visible occludee", function() { + it('can have a fully visible occludee', function() { var sphere1 = new BoundingSphere(new Cartesian3(-1.25, 0, -1.5), 0.5); var sphere2 = new BoundingSphere(new Cartesian3(1.25, 0, -1.5), 0.5); var cameraPosition = Cartesian3.ZERO; @@ -68,7 +68,7 @@ defineSuite([ expect(occluder.getVisibility(sphere2)).toEqual(Visibility.FULL); }); - it("can partially block an occludee without intersecting", function() { + it('can partially block an occludee without intersecting', function() { var cameraPosition = Cartesian3.ZERO; var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -2), 1); var occluder = new Occluder(occluderBS, cameraPosition); @@ -76,7 +76,7 @@ defineSuite([ expect(occluder.getVisibility(occludeeBS)).toEqual(Visibility.PARTIAL); }); - it("can partially block an occludee when it intersects laterally", function() { + it('can partially block an occludee when it intersects laterally', function() { var cameraPosition = Cartesian3.ZERO; var occluderBS = new BoundingSphere(new Cartesian3(-0.5, 0, -1), 1); var occluder = new Occluder(occluderBS, cameraPosition); @@ -84,7 +84,7 @@ defineSuite([ expect(occluder.getVisibility(occludeeBS)).toEqual(Visibility.PARTIAL); }); - it("can partially block an occludee when it intersects vertically", function() { + it('can partially block an occludee when it intersects vertically', function() { var cameraPosition = Cartesian3.ZERO; var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -2), 1); var occluder = new Occluder(occluderBS, cameraPosition); @@ -92,7 +92,7 @@ defineSuite([ expect(occluder.getVisibility(occludeeBS)).toEqual(Visibility.PARTIAL); }); - it("reports full visibility when occludee is larger than occluder", function() { + it('reports full visibility when occludee is larger than occluder', function() { var littleSphere = new BoundingSphere(new Cartesian3(0, 0, -1.5), 0.5); var bigSphere = new BoundingSphere(new Cartesian3(0, 0, -3), 1); var cameraPosition = Cartesian3.ZERO; @@ -100,13 +100,13 @@ defineSuite([ expect(occluder.getVisibility(bigSphere)).toEqual(Visibility.FULL); }); - it("can throw errors during getOccludeePoint (1 of 5)", function() { + it('can throw errors during getOccludeePoint (1 of 5)', function() { expect(function() { Occluder.getOccludeePoint(); }).toThrow(); }); - it("can throw errors during getOccludeePoint (2 of 5)", function() { + it('can throw errors during getOccludeePoint (2 of 5)', function() { var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -5), 1); var occludeePosition = new Cartesian3(0, 0, -5); var positions = []; @@ -116,7 +116,7 @@ defineSuite([ }).toThrow(); }); - it("can throw errors during getOccludeePoint (3 of 5)", function() { + it('can throw errors during getOccludeePoint (3 of 5)', function() { var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -5), 1); var positions = []; @@ -125,7 +125,7 @@ defineSuite([ }).toThrow(); }); - it("can throw errors during getOccludeePoint (4 of 5)", function() { + it('can throw errors during getOccludeePoint (4 of 5)', function() { var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -5), 1); expect(function() { @@ -133,7 +133,7 @@ defineSuite([ }).toThrow(); }); - it("can throw errors during getOccludeePoint (5 of 5)", function() { + it('can throw errors during getOccludeePoint (5 of 5)', function() { var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -5), 1); expect(function() { @@ -141,7 +141,7 @@ defineSuite([ }).toThrow(); }); - it("can compute an occludee point", function() { + it('can compute an occludee point', function() { var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -8), 2); var positions = [new Cartesian3(-1.085, 0, -6.221), new Cartesian3(1.085, 0, -6.221)]; var tileOccluderSphere = new BoundingSphere(positions); @@ -151,7 +151,7 @@ defineSuite([ expect(result.occludeePoint.equalsEpsilon(new Cartesian3(0, 0, -5), CesiumMath.EPSILON1)).toEqual(true); }); - it("can compute a rotation vector (major axis = 0)", function() { + it('can compute a rotation vector (major axis = 0)', function() { var cameraPosition = Cartesian3.ZERO; var occluderBS = new BoundingSphere(new Cartesian3(5, 0, 0), 2); var occluder = new Occluder(occluderBS, cameraPosition); @@ -173,7 +173,7 @@ defineSuite([ expect(aRotationVector).toBeTruthy(); }); - it("can compute a rotation vector (major axis = 1)", function() { + it('can compute a rotation vector (major axis = 1)', function() { var cameraPosition = Cartesian3.ZERO; var occluderBS = new BoundingSphere(new Cartesian3(5, 0, 0), 2); var occluder = new Occluder(occluderBS, cameraPosition); @@ -195,7 +195,7 @@ defineSuite([ expect(aRotationVector).toBeTruthy(); }); - it("can compute a rotation vector (major axis = 2)", function() { + it('can compute a rotation vector (major axis = 2)', function() { var cameraPosition = Cartesian3.ZERO; var occluderBS = new BoundingSphere(new Cartesian3(5, 0, 0), 2); var occluder = new Occluder(occluderBS, cameraPosition); @@ -217,7 +217,7 @@ defineSuite([ expect(aRotationVector).toBeTruthy(); }); - it("can have an invisible occludee point", function() { + it('can have an invisible occludee point', function() { var cameraPosition = new Cartesian3(0, 0, -8); var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -8), 2); var occluder = new Occluder(occluderBS, cameraPosition); @@ -234,7 +234,7 @@ defineSuite([ expect(occluder.getVisibility(bs)).toEqual(Visibility.NONE); }); - it("can have a visible occludee point", function() { + it('can have a visible occludee point', function() { var cameraPosition = new Cartesian3(3, 0, -8); var occluderBS = new BoundingSphere(new Cartesian3(0, 0, -8), 2); var occluder = new Occluder(occluderBS, cameraPosition); diff --git a/Specs/Core/OrientationInterpolationSpec.js b/Specs/Core/OrientationInterpolationSpec.js index b78eeeac89f..3190d3cce27 100644 --- a/Specs/Core/OrientationInterpolationSpec.js +++ b/Specs/Core/OrientationInterpolationSpec.js @@ -24,7 +24,7 @@ defineSuite([ }]; }); - it("constructor throws an exception with invalid control points", function() { + it('constructor throws an exception with invalid control points', function() { expect(function() { return new OrientationInterpolator(); }).toThrow(); @@ -38,19 +38,19 @@ defineSuite([ }).toThrow(); }); - it("get control points", function() { + it('get control points', function() { var oi = new OrientationInterpolator(points); expect(oi.getControlPoints()).toEqual(points); }); - it("evaluate fails with undefined time", function() { + it('evaluate fails with undefined time', function() { var oi = new OrientationInterpolator(points); expect(function() { oi.evaluate(); }).toThrow(); }); - it("evaluate fails with time out of range", function() { + it('evaluate fails with time out of range', function() { var oi = new OrientationInterpolator(points); expect(function() { @@ -62,7 +62,7 @@ defineSuite([ }).toThrow(); }); - it("evaluate can jump around in time", function() { + it('evaluate can jump around in time', function() { var oi = new OrientationInterpolator(points); expect(oi.evaluate(points[0].time).equalsEpsilon(points[0].orientation, CesiumMath.EPSILON12)).toEqual(true); @@ -80,14 +80,14 @@ defineSuite([ expect(oi.evaluate(points[0].time).equalsEpsilon(points[0].orientation, CesiumMath.EPSILON12)).toEqual(true); }); - it("evaluate (1)", function() { + it('evaluate (1)', function() { var oi = new OrientationInterpolator(points); var actual = oi.evaluate((points[0].time + points[1].time) * 0.5); var expected = new Quaternion(0.0, 0.0, Math.sin(Math.PI / 8.0), Math.cos(Math.PI / 8.0)); expect(actual.equalsEpsilon(expected, CesiumMath.EPSILON15)).toEqual(true); }); - it("evaluate (2)", function() { + it('evaluate (2)', function() { var oi = new OrientationInterpolator(points); var actual = oi.evaluate(points[2].time); var expected = new Quaternion(0.0, -1.0, 0.0, CesiumMath.toRadians(15.0)); diff --git a/Specs/Core/PlaneTessellatorSpec.js b/Specs/Core/PlaneTessellatorSpec.js index d884dbb33b8..7f97dce0685 100644 --- a/Specs/Core/PlaneTessellatorSpec.js +++ b/Specs/Core/PlaneTessellatorSpec.js @@ -3,13 +3,13 @@ defineSuite(['Core/PlaneTessellator'], function(PlaneTessellator) { "use strict"; /*global it,expect*/ - it("compute with default arguments", function() { + it('compute with default arguments', function() { var m = PlaneTessellator.compute(); expect(m.indexLists[0].values.length).toEqual(2 * 3); // 2 triangles }); - it("compute with arguments", function() { + it('compute with arguments', function() { var m = PlaneTessellator.compute({ resolution : { x : 4, @@ -22,7 +22,7 @@ defineSuite(['Core/PlaneTessellator'], function(PlaneTessellator) { expect(m.indexLists[0].values.length).toEqual(12 * 3); // 8 triangles }); - it("compute with onInterpolation callback", function() { + it('compute with onInterpolation callback', function() { var callbacks = []; PlaneTessellator.compute({ @@ -50,7 +50,7 @@ defineSuite(['Core/PlaneTessellator'], function(PlaneTessellator) { }]); }); - it("throws if resolution is less than 1", function() { + it('throws if resolution is less than 1', function() { expect(function() { PlaneTessellator.compute({ resolution: { diff --git a/Specs/Core/PolygonPipelineSpec.js b/Specs/Core/PolygonPipelineSpec.js index 972cd89f8c6..30dc35ec065 100644 --- a/Specs/Core/PolygonPipelineSpec.js +++ b/Specs/Core/PolygonPipelineSpec.js @@ -18,7 +18,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("cleanUp removes duplicate points", function() { + it('cleanUp removes duplicate points', function() { var positions = PolygonPipeline.cleanUp([ new Cartesian3(1.0, 1.0, 1.0), new Cartesian3(2.0, 2.0, 2.0), @@ -33,7 +33,7 @@ defineSuite([ ]); }); - it("cleanUp removes duplicate first and last points", function() { + it('cleanUp removes duplicate first and last points', function() { var positions = PolygonPipeline.cleanUp([ new Cartesian3(1.0, 1.0, 1.0), new Cartesian3(2.0, 2.0, 2.0), @@ -48,13 +48,13 @@ defineSuite([ ]); }); - it("cleanUp throws without positions", function() { + it('cleanUp throws without positions', function() { expect(function() { PolygonPipeline.cleanUp(); }).toThrow(); }); - it("cleanUp throws without three positions", function() { + it('cleanUp throws without three positions', function() { expect(function() { PolygonPipeline.cleanUp([Cartesian3.ZERO, Cartesian3.ZERO]); }).toThrow(); @@ -62,7 +62,7 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("EllipsoidTangentPlane projects a point", function() { + it('EllipsoidTangentPlane projects a point', function() { var ellipsoid = Ellipsoid.WGS84; var p = ellipsoid.toCartesian(Cartographic3.ZERO); @@ -73,13 +73,13 @@ defineSuite([ expect(projectedP[0].equals(Cartesian2.ZERO)).toEqual(true); }); - it("EllipsoidTangentPlane throws without ellipsoid", function() { + it('EllipsoidTangentPlane throws without ellipsoid', function() { expect(function() { return EllipsoidTangentPlane.create(); }).toThrow(); }); - it("EllipsoidTangentPlane throws without positions", function() { + it('EllipsoidTangentPlane throws without positions', function() { var ellipsoid = Ellipsoid.WGS84; expect(function() { @@ -87,7 +87,7 @@ defineSuite([ }).toThrow(); }); - it("projectPointsOntoPlane throws without positions", function() { + it('projectPointsOntoPlane throws without positions', function() { var ellipsoid = Ellipsoid.WGS84; var p = ellipsoid.toCartesian(Cartographic3.ZERO); var tangentPlane = EllipsoidTangentPlane.create(ellipsoid, [p]); @@ -99,7 +99,7 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("computeArea2D computes a positive area", function() { + it('computeArea2D computes a positive area', function() { var area = PolygonPipeline.computeArea2D([ new Cartesian2(0.0, 0.0), new Cartesian2(2.0, 0.0), @@ -110,7 +110,7 @@ defineSuite([ expect(area).toEqual(2.0); }); - it("computeArea2D computes a negative area", function() { + it('computeArea2D computes a negative area', function() { var area = PolygonPipeline.computeArea2D([ new Cartesian2(0.0, 0.0), new Cartesian2(0.0, 2.0), @@ -121,13 +121,13 @@ defineSuite([ expect(area).toEqual(-2.0); }); - it("computeArea2D throws without positions", function() { + it('computeArea2D throws without positions', function() { expect(function() { PolygonPipeline.computeArea2D(); }).toThrow(); }); - it("computeArea2D throws without three positions", function() { + it('computeArea2D throws without three positions', function() { expect(function() { PolygonPipeline.computeArea2D([Cartesian3.ZERO, Cartesian3.ZERO]); }).toThrow(); @@ -135,7 +135,7 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("computeWindingOrder2D computes counter-clockwise", function() { + it('computeWindingOrder2D computes counter-clockwise', function() { var area = PolygonPipeline.computeWindingOrder2D([ new Cartesian2(0.0, 0.0), new Cartesian2(2.0, 0.0), @@ -146,7 +146,7 @@ defineSuite([ expect(area).toEqual(WindingOrder.COUNTER_CLOCKWISE); }); - it("computeWindingOrder2D computes clockwise", function() { + it('computeWindingOrder2D computes clockwise', function() { var area = PolygonPipeline.computeWindingOrder2D([ new Cartesian2(0.0, 0.0), new Cartesian2(0.0, 2.0), @@ -157,13 +157,13 @@ defineSuite([ expect(area).toEqual(WindingOrder.CLOCKWISE); }); - it("computeWindingOrder2D throws without positions", function() { + it('computeWindingOrder2D throws without positions', function() { expect(function() { PolygonPipeline.computeWindingOrder2D(); }).toThrow(); }); - it("computeWindingOrder2D throws without three positions", function() { + it('computeWindingOrder2D throws without three positions', function() { expect(function() { PolygonPipeline.computeWindingOrder2D([Cartesian3.ZERO, Cartesian3.ZERO]); }).toThrow(); @@ -171,19 +171,19 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("earClip2D triangulates a triangle", function() { + it('earClip2D triangulates a triangle', function() { var indices = PolygonPipeline.earClip2D([new Cartesian2(0.0, 0.0), new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0)]); expect(indices).toEqualArray([0, 1, 2]); }); - it("earClip2D triangulates a square", function() { + it('earClip2D triangulates a square', function() { var indices = PolygonPipeline.earClip2D([new Cartesian2(0.0, 0.0), new Cartesian2(1.0, 0.0), new Cartesian2(1.0, 1.0), new Cartesian2(0.0, 1.0)]); expect(indices).toEqualArray([0, 1, 2, 0, 2, 3]); }); - it("earClip2D triangulates simple concave", function() { + it('earClip2D triangulates simple concave', function() { var positions = [new Cartesian2(0.0, 0.0), new Cartesian2(2.0, 0.0), new Cartesian2(2.0, 2.0), new Cartesian2(1.0, 0.25), new Cartesian2(0.0, 2.0)]; var indices = PolygonPipeline.earClip2D(positions); @@ -191,7 +191,7 @@ defineSuite([ expect(indices).toEqualArray([1, 2, 3, 3, 4, 0, 0, 1, 3]); }); - it("earClip2D triangulates complex concave", function() { + it('earClip2D triangulates complex concave', function() { var positions = [new Cartesian2(0.0, 0.0), new Cartesian2(2.0, 0.0), new Cartesian2(2.0, 1.0), new Cartesian2(0.1, 1.5), new Cartesian2(2.0, 2.0), new Cartesian2(0.0, 2.0), new Cartesian2(0.0, 1.0), new Cartesian2(1.9, 0.5)]; @@ -200,13 +200,13 @@ defineSuite([ expect(indices).toEqualArray([3, 4, 5, 3, 5, 6, 3, 6, 7, 7, 0, 1, 7, 1, 2, 2, 3, 7]); }); - it("earClip2D throws without positions", function() { + it('earClip2D throws without positions', function() { expect(function() { PolygonPipeline.earClip2D(); }).toThrow(); }); - it("earClip2D throws without three positions", function() { + it('earClip2D throws without three positions', function() { expect(function() { PolygonPipeline.earClip2D([Cartesian2.ZERO, Cartesian2.ZERO]); }).toThrow(); @@ -214,37 +214,37 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("computeSubdivision throws without positions", function() { + it('computeSubdivision throws without positions', function() { expect(function() { PolygonPipeline.computeSubdivision(); }).toThrow(); }); - it("computeSubdivision throws without indices", function() { + it('computeSubdivision throws without indices', function() { expect(function() { PolygonPipeline.computeSubdivision([]); }).toThrow(); }); - it("computeSubdivision throws with less than 3 indices", function() { + it('computeSubdivision throws with less than 3 indices', function() { expect(function() { PolygonPipeline.computeSubdivision([], [1, 2]); }).toThrow(); }); - it("computeSubdivision throws without a multiple of 3 indices", function() { + it('computeSubdivision throws without a multiple of 3 indices', function() { expect(function() { PolygonPipeline.computeSubdivision([], [1, 2, 3, 4]); }).toThrow(); }); - it("computeSubdivision throws with negative granularity", function() { + it('computeSubdivision throws with negative granularity', function() { expect(function() { PolygonPipeline.computeSubdivision([], [1, 2, 3], -1.0); }).toThrow(); }); - it("computeSubdivision", function() { + it('computeSubdivision', function() { var positions = [ new Cartesian3(0.0, 0.0, 90.0), new Cartesian3(0.0, 90.0, 0.0), @@ -268,7 +268,7 @@ defineSuite([ expect(subdivision.indexLists[0].values[2]).toEqual(2); }); - it("scaleToGeodeticHeight throws without ellipsoid", function() { + it('scaleToGeodeticHeight throws without ellipsoid', function() { expect(function() { PolygonPipeline.scaleToGeodeticHeight(); }).toThrow(); diff --git a/Specs/Core/PolylinePipelineSpec.js b/Specs/Core/PolylinePipelineSpec.js index 76591e2e692..efe15196c42 100644 --- a/Specs/Core/PolylinePipelineSpec.js +++ b/Specs/Core/PolylinePipelineSpec.js @@ -10,7 +10,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("wrapLongitude", function() { + it('wrapLongitude', function() { var ellipsoid = Ellipsoid.WGS84; var p1 = new Cartographic2(-75.163789, 39.952335); // Philadelphia, PA var p2 = new Cartographic2(-80.2264393, 25.7889689); // Miami, FL diff --git a/Specs/Core/QuaternionSpec.js b/Specs/Core/QuaternionSpec.js index 969d7fd2464..546371f2f52 100644 --- a/Specs/Core/QuaternionSpec.js +++ b/Specs/Core/QuaternionSpec.js @@ -14,7 +14,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("construct0", function() { + it('construct0', function() { var q = new Quaternion(); expect(q.x).toEqual(0.0); expect(q.y).toEqual(0.0); @@ -22,7 +22,7 @@ defineSuite([ expect(q.w).toEqual(0.0); }); - it("construct1", function() { + it('construct1', function() { var q = new Quaternion(0.0, 1.0, 2.0, 1.0); expect(q.x).toEqual(0.0); expect(q.y).toEqual(1.0); @@ -30,7 +30,7 @@ defineSuite([ expect(q.w).toEqual(1.0); }); - it("construct2", function() { + it('construct2', function() { var q = new Quaternion(0.0, 1.0, 2.0, 3.0); expect(q.x).toEqual(0.0); expect(q.y).toEqual(1.0); @@ -38,13 +38,13 @@ defineSuite([ expect(q.w).toEqual(3.0); }); - it("clone", function() { + it('clone', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0); var r = q.clone(); expect(q.equals(r)).toEqual(true); }); - it("ZERO", function() { + it('ZERO', function() { var q = Quaternion.ZERO; expect(q.x).toEqual(0.0); expect(q.y).toEqual(0.0); @@ -52,7 +52,7 @@ defineSuite([ expect(q.w).toEqual(0.0); }); - it("IDENTITY", function() { + it('IDENTITY', function() { var q = Quaternion.IDENTITY; expect(q.x).toEqual(0.0); expect(q.y).toEqual(0.0); @@ -60,22 +60,22 @@ defineSuite([ expect(q.w).toEqual(1.0); }); - it("conjugate", function() { + it('conjugate', function() { var q = new Quaternion(1.0, 1.0, 1.0, 1.0).conjugate(); expect(q.equals(new Quaternion(-1.0, -1.0, -1.0, 1.0))).toEqual(true); }); - it("normSquared", function() { + it('normSquared', function() { var q = new Quaternion(2.0, 3.0, 4.0, 5.0); expect(q.normSquared()).toEqual(54.0); }); - it("norm", function() { + it('norm', function() { var q = new Quaternion(2.0, 3.0, 4.0, 5.0); expect(q.norm()).toEqual(Math.sqrt(54.0)); }); - it("normalize", function() { + it('normalize', function() { var q = new Quaternion(0.0, 2.0, 0.0, 0.0).normalize(); expect(q.x).toEqual(0.0); expect(q.y).toEqual(1.0); @@ -83,7 +83,7 @@ defineSuite([ expect(q.w).toEqual(0.0); }); - it("inverse", function() { + it('inverse', function() { var q = new Quaternion(2.0, 3.0, 4.0, 5.0); var normSquared = q.normSquared(); expect(q.inverse().equals(new Quaternion( @@ -93,7 +93,7 @@ defineSuite([ 5.0 / normSquared))).toEqual(true); }); - it("unitInverseEqualsConjugate", function() { + it('unitInverseEqualsConjugate', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(1.0, 1.0, 1.0).normalize().multiplyWithScalar(s); @@ -102,42 +102,42 @@ defineSuite([ expect(q.inverse().equals(q.conjugate())).toEqual(true); }); - it("add", function() { + it('add', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0).add(new Quaternion(5.0, 6.0, 7.0, 8.0)); expect(q.equals(new Quaternion(6.0, 8.0, 10.0, 12.0))).toEqual(true); }); - it("subtract", function() { + it('subtract', function() { var q = new Quaternion(5.0, 6.0, 7.0, 8.0).subtract(new Quaternion(1.0, 2.0, 3.0, 4.0)); expect(q.equals(new Quaternion(4.0, 4.0, 4.0, 4.0))).toEqual(true); }); - it("negate", function() { + it('negate', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0).negate(); expect(q.equals(new Quaternion(-1.0, -2.0, -3.0, -4.0))).toEqual(true); }); - it("dot", function() { + it('dot', function() { var s = new Quaternion(2.0, 3.0, 4.0, 5.0).dot(new Quaternion(6.0, 7.0, 8.0, 9.0)); expect(s).toEqual(2.0 * 6.0 + 3.0 * 7.0 + 4.0 * 8.0 + 5.0 * 9.0); }); - it("multiply", function() { + it('multiply', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0).multiply(new Quaternion(1.0, 2.0, 3.0, 4.0)); expect(q.equals(new Quaternion(8.0, 16.0, 24.0, 2.0))).toEqual(true); }); - it("multiplyWithScalar", function() { + it('multiplyWithScalar', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0).multiplyWithScalar(2.0); expect(q.equals(new Quaternion(2.0, 4.0, 6.0, 8.0))).toEqual(true); }); - it("divideByScalar", function() { + it('divideByScalar', function() { var q = new Quaternion(2.0, 4.0, 6.0, 8.0).divideByScalar(2.0); expect(q.equals(new Quaternion(1.0, 2.0, 3.0, 4.0))).toEqual(true); }); - it("rotate", function() { + it('rotate', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(0.0, 0.0, 1.0).multiplyWithScalar(s); @@ -147,7 +147,7 @@ defineSuite([ expect(q.rotate(xAxis).equalsEpsilon(yAxis, CesiumMath.EPSILON15)).toEqual(true); }); - it("getAxis", function() { + it('getAxis', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(0.0, 0.0, 1.0).multiplyWithScalar(s); @@ -157,7 +157,7 @@ defineSuite([ expect(q.getAxis().equals(Cartesian3.ZERO)).toEqual(true); }); - it("getAngle", function() { + it('getAngle', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(0.0, 0.0, 1.0).multiplyWithScalar(s); @@ -167,7 +167,7 @@ defineSuite([ expect(q.getAngle() === 0.0).toEqual(true); }); - it("toRotationMatrix", function() { + it('toRotationMatrix', function() { var sPiOver4 = Math.sin(CesiumMath.PI_OVER_FOUR); var cPiOver4 = Math.cos(CesiumMath.PI_OVER_FOUR); var sPiOver2 = Math.sin(CesiumMath.PI_OVER_TWO); @@ -179,7 +179,7 @@ defineSuite([ expect(q.toRotationMatrix().equalsEpsilon(rotation, CesiumMath.EPSILON15)).toEqual(true); }); - it("lerp", function() { + it('lerp', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0); var r = new Quaternion(5.0, 6.0, 7.0, 8.0); var t = 0.75; @@ -189,7 +189,7 @@ defineSuite([ expect(q.lerp(t, r).equals(s)).toEqual(true); }); - it("slerp", function() { + it('slerp', function() { var q = new Quaternion(0.0, 0.0, 0.0, 1.0).normalize(); var cartesian1 = new Cartesian3(0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR)); var r = new Quaternion(cartesian1.x, cartesian1.y, cartesian1.z, Math.cos(CesiumMath.PI_OVER_FOUR)); @@ -200,7 +200,7 @@ defineSuite([ expect(q.slerp(0.5, r).equalsEpsilon(s, CesiumMath.EPSILON15)).toEqual(true); }); - it("slerp (2)", function() { + it('slerp (2)', function() { var q = new Quaternion(0.0, 0.0, 0.0, -1.0).normalize(); var cartesian1 = new Cartesian3(0.0, 0.0, Math.sin(CesiumMath.PI_OVER_FOUR)); var r = new Quaternion(cartesian1.x, cartesian1.y, cartesian1.z, Math.cos(CesiumMath.PI_OVER_FOUR)); @@ -208,7 +208,7 @@ defineSuite([ expect(q.slerp(1.0, r).equalsEpsilon(new Quaternion(0.0, 0.0, -Math.sqrt(2) / 2.0, -Math.sqrt(2) / 2.0), CesiumMath.EPSILON10)).toEqual(true); }); - it("log", function() { + it('log', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(0.0, 0.0, 1.0).multiplyWithScalar(s); @@ -216,7 +216,7 @@ defineSuite([ expect(q.log().equals(new Cartesian3(0.0, 0.0, CesiumMath.PI_OVER_FOUR))); }); - it("power", function() { + it('power', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(0.0, 0.0, 1.0).multiplyWithScalar(s); @@ -226,18 +226,18 @@ defineSuite([ expect(u.equalsEpsilon(v, CesiumMath.EPSILON15)).toEqual(true); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Quaternion(1.0, 1.0, 2.0, 1.0).equalsEpsilon(new Quaternion(1.0, 1.0, 2.0, 1.0), 0.0)).toEqual(true); expect(new Quaternion(1.0, 1.0, 2.0, 1.0).equalsEpsilon(new Quaternion(1.0, 1.0, 2.0, 2.0), 1.0)).toEqual(true); expect(new Quaternion(1.0, 1.0, 2.0, 1.0).equalsEpsilon(new Quaternion(1.0, 1.0, 2.0, 3.0), 1.0)).toEqual(false); }); - it("toString", function() { + it('toString', function() { var q = new Quaternion(1.0, 2.0, 3.0, 4.0); - expect(q.toString()).toEqual("(1, 2, 3, 4)"); + expect(q.toString()).toEqual('(1, 2, 3, 4)'); }); - it("fromAxisAngle", function() { + it('fromAxisAngle', function() { var axis = new Cartesian3(0.0, 0.0, 1.0); var theta = CesiumMath.PI_OVER_TWO; @@ -250,7 +250,7 @@ defineSuite([ expect(r.equals(q)).toEqual(true); }); - it("fromRotationMatrix (1)", function() { + it('fromRotationMatrix (1)', function() { var theta = CesiumMath.PI_OVER_TWO; var sHalfTheta = Math.sin(theta / 2.0); @@ -268,7 +268,7 @@ defineSuite([ expect(Quaternion.fromRotationMatrix(zRotation).equalsEpsilon(q, CesiumMath.EPSILON15)).toEqual(true); }); - it("fromRotationMatrix (2)", function() { + it('fromRotationMatrix (2)', function() { var theta = CesiumMath.PI_OVER_TWO; var sHalfTheta = Math.sin(theta / 2.0); @@ -286,7 +286,7 @@ defineSuite([ expect(Quaternion.fromRotationMatrix(yRotation).equalsEpsilon(q, CesiumMath.EPSILON15)).toEqual(true); }); - it("fromRotationMatrix (3)", function() { + it('fromRotationMatrix (3)', function() { var theta = CesiumMath.PI_OVER_TWO; var sHalfTheta = Math.sin(theta / 2.0); @@ -304,7 +304,7 @@ defineSuite([ expect(Quaternion.fromRotationMatrix(xRotation).equalsEpsilon(q, CesiumMath.EPSILON15)).toEqual(true); }); - it("fromRotationMatrix (4)", function() { + it('fromRotationMatrix (4)', function() { var theta = CesiumMath.PI_OVER_TWO; var sHalfTheta = Math.sin(theta / 2.0); @@ -338,7 +338,7 @@ defineSuite([ expect(Quaternion.fromRotationMatrix(xRotation).equalsEpsilon(q, CesiumMath.EPSILON15)).toEqual(true); }); - it("fromRotationMatrix (5)", function() { + it('fromRotationMatrix (5)', function() { var rotation = new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); @@ -346,7 +346,7 @@ defineSuite([ expect(Quaternion.fromRotationMatrix(rotation).equalsEpsilon(q, CesiumMath.EPSILON15)).toEqual(true); }); - it("exp", function() { + it('exp', function() { var s = Math.sin(CesiumMath.PI_OVER_FOUR); var c = Math.cos(CesiumMath.PI_OVER_FOUR); var cartesian = new Cartesian3(0.0, 0.0, 1.0).multiplyWithScalar(s); @@ -354,7 +354,7 @@ defineSuite([ expect(Quaternion.exp(new Cartesian3(0.0, 0.0, CesiumMath.PI_OVER_FOUR)).equals(q)).toEqual(true); }); - it("matrixAndQuaternionfromAxisAngle", function() { + it('matrixAndQuaternionfromAxisAngle', function() { var axis = new Cartesian3(1.0, 2.0, 3.0); var angle = 2.0 * CesiumMath.PI_OVER_THREE; var m = Matrix3.fromAxisAngle(axis, angle); diff --git a/Specs/Core/RectangleSpec.js b/Specs/Core/RectangleSpec.js index 531e3c5beb6..69139dc8c82 100644 --- a/Specs/Core/RectangleSpec.js +++ b/Specs/Core/RectangleSpec.js @@ -18,7 +18,7 @@ defineSuite([ new Cartesian2(-3, 3) ]; - it("default constructs", function() { + it('default constructs', function() { var r = new Rectangle(); expect(r.x).toEqual(0.0); expect(r.y).toEqual(0.0); @@ -26,7 +26,7 @@ defineSuite([ expect(r.height).toEqual(0.0); }); - it("constructs", function() { + it('constructs', function() { var r = new Rectangle(1.0, 2.0, 3.0, 4.0); expect(r.x).toEqual(1.0); expect(r.y).toEqual(2.0); @@ -34,7 +34,7 @@ defineSuite([ expect(r.height).toEqual(4.0); }); - it("clones", function() { + it('clones', function() { var r = new Rectangle(1.0, 2.0, 3.0, 4.0); var r2 = r.clone(); r.x = 0.0; @@ -43,26 +43,26 @@ defineSuite([ expect(r2.x).toEqual(1.0); }); - it("equals (1)", function() { + it('equals (1)', function() { expect(new Rectangle(1.0, 2.0, 3.0, 4.0).equals(new Rectangle(1.0, 2.0, 3.0, 4.0))).toEqual(true); }); - it("equals (2)", function() { + it('equals (2)', function() { expect(new Rectangle(1.0, 2.0, 3.0, 4.0).equals(new Rectangle(1.0, 2.0, 3.0, 0.0))).toEqual(false); }); - it("equalsEpsilon", function() { + it('equalsEpsilon', function() { expect(new Rectangle(1.0, 2.0, 3.0, 4.0).equalsEpsilon(new Rectangle(1.0, 2.0, 3.0, 4.0), 0.0)).toEqual(true); expect(new Rectangle(1.0, 2.0, 3.0, 4.0).equalsEpsilon(new Rectangle(2.0, 2.0, 3.0, 4.0), 1.0)).toEqual(true); expect(new Rectangle(1.0, 2.0, 3.0, 4.0).equalsEpsilon(new Rectangle(3.0, 2.0, 3.0, 4.0), 1.0)).toEqual(false); }); - it("converts to a string", function() { + it('converts to a string', function() { var r = new Rectangle(1, 2, 3, 4); - expect(r.toString()).toEqual("(1, 2, 3, 4)"); + expect(r.toString()).toEqual('(1, 2, 3, 4)'); }); - it("rectangleRectangleIntersect", function() { + it('rectangleRectangleIntersect', function() { var rect1 = new Rectangle(0, 0, 4, 4); var rect2 = new Rectangle(2, 2, 4, 4); var rect3 = new Rectangle(5, 5, 4, 4); @@ -70,7 +70,7 @@ defineSuite([ expect(Rectangle.rectangleRectangleIntersect(rect1, rect3)).toEqual(false); }); - it("create axis aligned bounding rectangle", function() { + it('create axis aligned bounding rectangle', function() { var rectangle = Rectangle.createAxisAlignedBoundingRectangle(positions); expect(rectangle.x).toEqual(-3); expect(rectangle.y).toEqual(-3); @@ -78,7 +78,7 @@ defineSuite([ expect(rectangle.height).toEqual(6); }); - it("creates the axis aligned bounding rectangle for a single position", function() { + it('creates the axis aligned bounding rectangle for a single position', function() { var rectangle = Rectangle.createAxisAlignedBoundingRectangle([{ x : 1, y : 2 @@ -90,13 +90,13 @@ defineSuite([ expect(rectangle.height).toEqual(0); }); - it("throws an exception creating an axis aligned bounding rectangle with positions of length zero", function() { + it('throws an exception creating an axis aligned bounding rectangle with positions of length zero', function() { expect(function() { return Rectangle.createAxisAlignedBoundingRectangle([]); }).toThrow(); }); - it("throws an exception when creating an axis aligned bounding rectangle without any positions", function() { + it('throws an exception when creating an axis aligned bounding rectangle without any positions', function() { expect(function() { return Rectangle.createAxisAlignedBoundingRectangle(undefined); }).toThrow(); diff --git a/Specs/Core/ShapesSpec.js b/Specs/Core/ShapesSpec.js index 3bbbdf812aa..ebf3182eefb 100755 --- a/Specs/Core/ShapesSpec.js +++ b/Specs/Core/ShapesSpec.js @@ -12,7 +12,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("computeCircleBoundary computes a closed loop", function() { + it('computeCircleBoundary computes a closed loop', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); var positions = Shapes.computeCircleBoundary(ellipsoid, center, 1.0); @@ -20,7 +20,7 @@ defineSuite([ expect(positions[0].equals(positions[positions.length - 1])).toEqual(true); }); - it("computeCircleBoundary uses custom granularity", function() { + it('computeCircleBoundary uses custom granularity', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); var positions = Shapes.computeCircleBoundary(ellipsoid, center, 1.0, CesiumMath.toRadians(60)); @@ -28,20 +28,20 @@ defineSuite([ expect(positions.length).toEqual(10); }); - it("computeCircleBoundary throws without an ellipsoid", function() { + it('computeCircleBoundary throws without an ellipsoid', function() { expect(function() { Shapes.computeCircleBoundary(); }).toThrow(); }); - it("computeCircleBoundary throws without a center", function() { + it('computeCircleBoundary throws without a center', function() { var ellipsoid = Ellipsoid.WGS84; expect(function() { Shapes.computeCircleBoundary(ellipsoid); }).toThrow(); }); - it("computeCircleBoundary throws without a radius", function() { + it('computeCircleBoundary throws without a radius', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); expect(function() { @@ -49,7 +49,7 @@ defineSuite([ }).toThrow(); }); - it("computeCircleBoundary throws with a negative radius", function() { + it('computeCircleBoundary throws with a negative radius', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); expect(function() { @@ -57,7 +57,7 @@ defineSuite([ }).toThrow(); }); - it("computeCircleBoundary throws with a negative granularity", function() { + it('computeCircleBoundary throws with a negative granularity', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); expect(function() { @@ -65,7 +65,7 @@ defineSuite([ }).toThrow(); }); - it("computeEllipseBoundary computes a closed loop", function() { + it('computeEllipseBoundary computes a closed loop', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); var positions = Shapes.computeEllipseBoundary(ellipsoid, center, 5.0, 1.0); @@ -73,27 +73,27 @@ defineSuite([ expect(positions[0].equals(positions[positions.length - 1])).toEqual(true); }); - it("computeEllipseBoundary can swap the semi major and minor axes", function() { + it('computeEllipseBoundary can swap the semi major and minor axes', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); var points = Shapes.computeEllipseBoundary(ellipsoid, center, 1.0, 5.0); expect(points.length).toBeGreaterThan(0); }); - it("computeEllipseBoundary throws without an ellipsoid", function() { + it('computeEllipseBoundary throws without an ellipsoid', function() { expect(function() { Shapes.computeEllipseBoundary(); }).toThrow(); }); - it("computeEllipseBoundary throws without a center", function() { + it('computeEllipseBoundary throws without a center', function() { var ellipsoid = Ellipsoid.WGS84; expect(function() { Shapes.computeEllipseBoundary(ellipsoid); }).toThrow(); }); - it("computeEllipseBoundary throws without a semi-major axis", function() { + it('computeEllipseBoundary throws without a semi-major axis', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); expect(function() { @@ -101,7 +101,7 @@ defineSuite([ }).toThrow(); }); - it("computeEllipseBoundary with a negative axis length", function() { + it('computeEllipseBoundary with a negative axis length', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); expect(function() { @@ -112,7 +112,7 @@ defineSuite([ }).toThrow(); }); - it("computeEllipseBoundary throws with a negative granularity", function() { + it('computeEllipseBoundary throws with a negative granularity', function() { var ellipsoid = Ellipsoid.WGS84; var center = ellipsoid.toCartesian(Cartographic3.ZERO); expect(function() { diff --git a/Specs/Core/SunPositionSpec.js b/Specs/Core/SunPositionSpec.js index 43bdc3e6c79..d472641da80 100644 --- a/Specs/Core/SunPositionSpec.js +++ b/Specs/Core/SunPositionSpec.js @@ -12,246 +12,246 @@ defineSuite([ "use strict"; /*global it,expect*/ - var date1 = new Date("January 15, 2012"); + var date1 = new Date('January 15, 2012'); date1.setUTCHours(12, 0, 0, 0); var julianDate1 = JulianDate.fromDate(date1); - var date2 = new Date("February 15, 2012"); + var date2 = new Date('February 15, 2012'); date2.setUTCHours(12, 0, 0, 0); var julianDate2 = JulianDate.fromDate(date2); - var date3 = new Date("March 3, 2011"); + var date3 = new Date('March 3, 2011'); date3.setUTCHours(12, 0, 0, 0); var julianDate3 = JulianDate.fromDate(date3); - var date4 = new Date("April 15, 2012"); + var date4 = new Date('April 15, 2012'); date4.setUTCHours(12, 0, 0, 0); var julianDate4 = JulianDate.fromDate(date4); - var date5 = new Date("May 15, 2012"); + var date5 = new Date('May 15, 2012'); date5.setUTCHours(12, 0, 0, 0); var julianDate5 = JulianDate.fromDate(date5); - var date6 = new Date("June 22, 2011"); + var date6 = new Date('June 22, 2011'); date6.setUTCHours(16, 0, 0, 0); var julianDate6 = JulianDate.fromDate(date6); - var date7 = new Date("July 6, 2012"); + var date7 = new Date('July 6, 2012'); date7.setUTCHours(12, 0, 0, 0); var julianDate7 = JulianDate.fromDate(date7); - var date8 = new Date("August 29, 2012"); + var date8 = new Date('August 29, 2012'); date8.setUTCHours(12, 0, 0, 0); var julianDate8 = JulianDate.fromDate(date8); - var date9 = new Date("September 22, 2011"); + var date9 = new Date('September 22, 2011'); date9.setUTCHours(2, 0, 0, 0); var julianDate9 = JulianDate.fromDate(date9); - var date10 = new Date("October 1, 2012"); + var date10 = new Date('October 1, 2012'); date10.setUTCHours(12, 0, 0, 0); var julianDate10 = JulianDate.fromDate(date10); - var date11 = new Date("November 24, 2012"); + var date11 = new Date('November 24, 2012'); date11.setUTCHours(12, 0, 0, 0); var julianDate11 = JulianDate.fromDate(date11); - var date12 = new Date("December 3, 2011"); + var date12 = new Date('December 3, 2011'); date12.setUTCHours(21, 0, 0, 0); var julianDate12 = JulianDate.fromDate(date12); var AU_TO_METERS = 149597870700.0; var earthsRadius = 4.2634965 * CesiumMath.EPSILON5 * AU_TO_METERS; - it("can correctly compute the distance from the earth to the sun (1)", function() { + it('can correctly compute the distance from the earth to the sun (1)', function() { var sunPos = SunPosition.compute(julianDate1); expect(sunPos.distance).toEqualEpsilon(147148431117.98, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (2)", function() { + it('can correctly compute the distance from the earth to the sun (2)', function() { var sunPos = SunPosition.compute(julianDate2); expect(sunPos.distance).toEqualEpsilon(147753960797.35, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (3)", function() { + it('can correctly compute the distance from the earth to the sun (3)', function() { var sunPos = SunPosition.compute(julianDate3); expect(sunPos.distance).toEqualEpsilon(148297002100.02, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (4)", function() { + it('can correctly compute the distance from the earth to the sun (4)', function() { var sunPos = SunPosition.compute(julianDate4); expect(sunPos.distance).toEqualEpsilon(150111025763.77, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (5)", function() { + it('can correctly compute the distance from the earth to the sun (5)', function() { var sunPos = SunPosition.compute(julianDate5); expect(sunPos.distance).toEqualEpsilon(151244858657.05, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (6)", function() { + it('can correctly compute the distance from the earth to the sun (6)', function() { var sunPos = SunPosition.compute(julianDate6); expect(sunPos.distance).toEqualEpsilon(152038567856.43, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (7)", function() { + it('can correctly compute the distance from the earth to the sun (7)', function() { var sunPos = SunPosition.compute(julianDate7); expect(sunPos.distance).toEqualEpsilon(152091959910.50, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (8)", function() { + it('can correctly compute the distance from the earth to the sun (8)', function() { var sunPos = SunPosition.compute(julianDate8); expect(sunPos.distance).toEqualEpsilon(151056458099.59, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (9)", function() { + it('can correctly compute the distance from the earth to the sun (9)', function() { var sunPos = SunPosition.compute(julianDate9); expect(sunPos.distance).toEqualEpsilon(150184436627.52, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (10)", function() { + it('can correctly compute the distance from the earth to the sun (10)', function() { var sunPos = SunPosition.compute(julianDate10); expect(sunPos.distance).toEqualEpsilon(149744103802.39, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (11)", function() { + it('can correctly compute the distance from the earth to the sun (11)', function() { var sunPos = SunPosition.compute(julianDate11); expect(sunPos.distance).toEqualEpsilon(147676653136.92, earthsRadius); }); - it("can correctly compute the distance from the earth to the sun (12)", function() { + it('can correctly compute the distance from the earth to the sun (12)', function() { var sunPos = SunPosition.compute(julianDate12); expect(sunPos.distance).toEqualEpsilon(147462128000.55, earthsRadius); }); - it("can correctly compute the sun's latitude (1)", function() { + it('can correctly compute latitude (1)', function() { var sunPos = SunPosition.compute(julianDate1); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(-21.18), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (2)", function() { + it('can correctly compute latitude (2)', function() { var sunPos = SunPosition.compute(julianDate2); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(-12.78), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (3)", function() { + it('can correctly compute latitude (3)', function() { var sunPos = SunPosition.compute(julianDate3); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(-6.85), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (4)", function() { + it('can correctly compute latitude (4)', function() { var sunPos = SunPosition.compute(julianDate4); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(10.01), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (5)", function() { + it('can correctly compute latitude (5)', function() { var sunPos = SunPosition.compute(julianDate5); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(19.03), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (6)", function() { + it('can correctly compute latitude (6)', function() { var sunPos = SunPosition.compute(julianDate6); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(23.44), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (7)", function() { + it('can correctly compute latitude (7)', function() { var sunPos = SunPosition.compute(julianDate7); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(22.61), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (8)", function() { + it('can correctly compute latitude (8)', function() { var sunPos = SunPosition.compute(julianDate8); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(9.11), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (9)", function() { + it('can correctly compute latitude (9)', function() { var sunPos = SunPosition.compute(julianDate9); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(0.50), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (10)", function() { + it('can correctly compute latitude (10)', function() { var sunPos = SunPosition.compute(julianDate10); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(-3.45), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (11)", function() { + it('can correctly compute latitude (11)', function() { var sunPos = SunPosition.compute(julianDate11); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(-20.68), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's latitude (12)", function() { + it('can correctly compute latitude (12)', function() { var sunPos = SunPosition.compute(julianDate12); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(-22.14), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (1)", function() { + it('can correctly compute longitude (1)', function() { var sunPos = SunPosition.compute(julianDate1); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(2.30), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (2)", function() { + it('can correctly compute longitude (2)', function() { var sunPos = SunPosition.compute(julianDate2); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(3.53), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (3)", function() { + it('can correctly compute longitude (3)', function() { var sunPos = SunPosition.compute(julianDate3); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(3.0), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (4)", function() { + it('can correctly compute longitude (4)', function() { var sunPos = SunPosition.compute(julianDate4); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-0.02), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (5)", function() { + it('can correctly compute longitude (5)', function() { var sunPos = SunPosition.compute(julianDate5); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-0.92), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (6)", function() { + it('can correctly compute longitude (6)', function() { var sunPos = SunPosition.compute(julianDate6); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-59.51), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (7)", function() { + it('can correctly compute longitude (7)', function() { var sunPos = SunPosition.compute(julianDate7); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(1.21), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (8)", function() { + it('can correctly compute longitude (8)', function() { var sunPos = SunPosition.compute(julianDate8); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(0.20), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (9)", function() { + it('can correctly compute longitude (9)', function() { var sunPos = SunPosition.compute(julianDate9); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(148.24), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (10)", function() { + it('can correctly compute longitude (10)', function() { var sunPos = SunPosition.compute(julianDate10); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-2.62), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (11)", function() { + it('can correctly compute longitude (11)', function() { var sunPos = SunPosition.compute(julianDate11); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-3.29), CesiumMath.toRadians(1.0)); }); - it("can correctly compute the sun's longitude (12)", function() { + it('can correctly compute longitude (12)', function() { var sunPos = SunPosition.compute(julianDate12); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-137.55), CesiumMath.toRadians(1.0)); }); - it("can compute the sun's position during a leap year", function() { - var julianDate = JulianDate.fromDate(new Date("April 1, 2012 16:00:00 UTC")); + it('can compute position during a leap year', function() { + var julianDate = JulianDate.fromDate(new Date('April 1, 2012 16:00:00 UTC')); var sunPos = SunPosition.compute(julianDate); expect(sunPos.distance).toEqualEpsilon(149517419153.09, earthsRadius); expect(sunPos.cartographicPosition.longitude).toEqualEpsilon(CesiumMath.toRadians(-59.08), CesiumMath.toRadians(1.0)); expect(sunPos.cartographicPosition.latitude).toEqualEpsilon(CesiumMath.toRadians(4.87), CesiumMath.toRadians(1.0)); }); - it("has matching cartographic and cartesian positions (1)", function() { + it('has matching cartographic and cartesian positions (1)', function() { var ellipsoid = Ellipsoid.WGS84; var sunPos = SunPosition.compute(julianDate6); var position = sunPos.position.normalize(); @@ -260,7 +260,7 @@ defineSuite([ expect((cartesianPos).equalsEpsilon(position, CesiumMath.EPSILON2)).toEqual(true); }); - it("has matching cartographic and cartesian positions (2)", function() { + it('has matching cartographic and cartesian positions (2)', function() { var ellipsoid = Ellipsoid.WGS84; var sunPos = SunPosition.compute(julianDate3); var position = sunPos.position.normalize(); @@ -269,7 +269,7 @@ defineSuite([ expect((cartesianPos).equalsEpsilon(position, CesiumMath.EPSILON2)).toEqual(true); }); - it("has matching cartographic and cartesian positions (3)", function() { + it('has matching cartographic and cartesian positions (3)', function() { var ellipsoid = Ellipsoid.WGS84; var sunPos = SunPosition.compute(julianDate3); var position = sunPos.position.normalize(); @@ -278,7 +278,7 @@ defineSuite([ expect((cartesianPos).equalsEpsilon(position, CesiumMath.EPSILON2)).toEqual(true); }); - it("has matching cartographic and cartesian positions (4)", function() { + it('has matching cartographic and cartesian positions (4)', function() { var ellipsoid = Ellipsoid.WGS84; var sunPos = SunPosition.compute(julianDate12); var position = sunPos.position.normalize(); @@ -287,11 +287,11 @@ defineSuite([ expect((cartesianPos).equalsEpsilon(position, CesiumMath.EPSILON2)).toEqual(true); }); - it("has the sun rising in the east and setting in the west", function() { + it('has the sun rising in the east and setting in the west', function() { //Julian dates for 24 hours, starting from July 6th 2011 @ 01:00 UTC var timesOfDay = []; for ( var i = 1; i < 25; i++) { - var date = new Date("July 6, 2011"); + var date = new Date('July 6, 2011'); date.setUTCHours(i, 0, 0, 0); timesOfDay.push(JulianDate.fromDate(date)); } diff --git a/Specs/Core/TimeStandardSpec.js b/Specs/Core/TimeStandardSpec.js index 1648e2b8eb7..f58eb3caa28 100644 --- a/Specs/Core/TimeStandardSpec.js +++ b/Specs/Core/TimeStandardSpec.js @@ -3,8 +3,8 @@ defineSuite(['Core/TimeStandard', 'Core/JulianDate'], function(TimeStandard, Jul "use strict"; /*global it,expect*/ - it("can convert from UTC to TAI", function() { - var date = new Date("July 11, 2011 12:00:00 UTC"); + it('can convert from UTC to TAI', function() { + var date = new Date('July 11, 2011 12:00:00 UTC'); var julianDateUtc = JulianDate.fromDate(date, TimeStandard.UTC); var julianDateTai = TimeStandard.convertUtcToTai(julianDateUtc); @@ -13,8 +13,8 @@ defineSuite(['Core/TimeStandard', 'Core/JulianDate'], function(TimeStandard, Jul expect(julianDateUtc.equals(julianDateTai)).toEqual(true); }); - it("can convert from TAI to UTC", function() { - var date = new Date("July 11, 2011 12:00:00 UTC"); + it('can convert from TAI to UTC', function() { + var date = new Date('July 11, 2011 12:00:00 UTC'); var julianDateUtc = JulianDate.fromDate(date, TimeStandard.UTC); var julianDateTai = TimeStandard.convertUtcToTai(julianDateUtc); var julianDateUtc2 = TimeStandard.convertTaiToUtc(julianDateTai); @@ -24,49 +24,49 @@ defineSuite(['Core/TimeStandard', 'Core/JulianDate'], function(TimeStandard, Jul expect(julianDateUtc2.getSecondsOfDay()).toEqual(julianDateTai.getSecondsOfDay() - 34); }); - it("returns the TAI date if convertUtcToTai is passed a TAI date", function() { + it('returns the TAI date if convertUtcToTai is passed a TAI date', function() { var julianDate = JulianDate.fromDate(new Date(), TimeStandard.TAI); var julianDateTai = TimeStandard.convertUtcToTai(julianDate); expect(julianDate.equals(julianDateTai)).toEqual(true); }); - it("returns the UTC date if convertTaiToUtc is passed a UTC date", function() { + it('returns the UTC date if convertTaiToUtc is passed a UTC date', function() { var julianDate = JulianDate.fromDate(new Date(), TimeStandard.UTC); var julianDateUtc = TimeStandard.convertTaiToUtc(julianDate); expect(julianDate.equals(julianDateUtc)).toEqual(true); }); - it("converting from a TAI leap second is undefined", function() { + it('converting from a TAI leap second is undefined', function() { var julianDate = new JulianDate(2454832, 43233, TimeStandard.TAI); var julianDateTai = TimeStandard.convertTaiToUtc(julianDate); expect(julianDateTai).toEqual(undefined); }); - it("throws an exception when converting from UTC to TAI with undefined JulianDate", function() { + it('throws an exception when converting from UTC to TAI with undefined JulianDate', function() { expect(function() { return TimeStandard.convertUtcToTai(); }).toThrow(); }); - it("throws an exception when converting from UTC to TAI with null JulianDate", function() { + it('throws an exception when converting from UTC to TAI with null JulianDate', function() { expect(function() { return TimeStandard.convertUtcToTai(null); }).toThrow(); }); - it("throws an exception when converting from TAI to UTC with undefined JulianDate", function() { + it('throws an exception when converting from TAI to UTC with undefined JulianDate', function() { expect(function() { return TimeStandard.convertTaiToUtc(); }).toThrow(); }); - it("throws an exception when converting from TAI to UTC with null JulianDate", function() { + it('throws an exception when converting from TAI to UTC with null JulianDate', function() { expect(function() { return TimeStandard.convertTaiToUtc(null); }).toThrow(); }); - it("convertUtcToTai throws an exception if time standard is not UTC", function() { + it('convertUtcToTai throws an exception if time standard is not UTC', function() { var julianDate = new JulianDate(2454832, 43233); julianDate._timeStandard = 404; expect(function() { @@ -74,7 +74,7 @@ defineSuite(['Core/TimeStandard', 'Core/JulianDate'], function(TimeStandard, Jul }).toThrow(); }); - it("convertTaiToUtc throws an exception if time standard is not TAI", function() { + it('convertTaiToUtc throws an exception if time standard is not TAI', function() { var julianDate = new JulianDate(2454832, 43233); julianDate._timeStandard = 404; expect(function() { diff --git a/Specs/Core/TipsifySpec.js b/Specs/Core/TipsifySpec.js index 9a5d4286fda..be8bbc75a19 100644 --- a/Specs/Core/TipsifySpec.js +++ b/Specs/Core/TipsifySpec.js @@ -6,19 +6,19 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("can calculate the ACMR", function() { + it('can calculate the ACMR', function() { //Hexagon formed from 6 triangles, 7 vertices expect(Tipsify.calculateACMR({indices : [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 1, 6], maximumIndex : 6, cacheSize : 3})).toEqual(2); }); - it("can calculate the ACMR without a specified maximum index", function() { + it('can calculate the ACMR without a specified maximum index', function() { expect(Tipsify.calculateACMR({indices : [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 1, 6], cacheSize : 3})).toEqual(2); }); - it("throws when calculating ACMR (1 of 4)", function() { + it('throws when calculating ACMR (1 of 4)', function() { expect(function() { Tipsify.calculateACMR({indices : null, maximumIndex : 1, @@ -26,7 +26,7 @@ defineSuite([ }).toThrow(); }); - it("throws when calculating ACMR (2 of 4)", function() { + it('throws when calculating ACMR (2 of 4)', function() { expect(function() { Tipsify.calculateACMR({indices : [1, 2, 3, 4], maximumIndex : 1, @@ -34,7 +34,7 @@ defineSuite([ }).toThrow(); }); - it("throws when calculating ACMR (3 of 4)", function() { + it('throws when calculating ACMR (3 of 4)', function() { expect(function() { Tipsify.calculateACMR({indices : [0, 1, 2], maximumIndex : -1, @@ -42,7 +42,7 @@ defineSuite([ }).toThrow(); }); - it("throws when calculating ACMR (4 of 4)", function() { + it('throws when calculating ACMR (4 of 4)', function() { expect(function() { Tipsify.calculateACMR({indices : [0, 1, 2], maximumIndex : 2, @@ -50,7 +50,7 @@ defineSuite([ }).toThrow(); }); - it("throws when executing Tipsify (1 of 5)", function() { + it('throws when executing Tipsify (1 of 5)', function() { expect(function() { Tipsify.tipsify({indices : null, maximumIndex : 1, @@ -58,7 +58,7 @@ defineSuite([ }).toThrow(); }); - it("throws when executing Tipsify (2 of 5)", function() { + it('throws when executing Tipsify (2 of 5)', function() { expect(function() { Tipsify.tipsify({indices : [1, 2, 3, 4], maximumIndex : 1, @@ -66,7 +66,7 @@ defineSuite([ }).toThrow(); }); - it("throws when executing Tipsify (3 of 5)", function () { + it('throws when executing Tipsify (3 of 5)', function () { expect(function() { Tipsify.tipsify({indices : [1, 2, 3], maximumIndex : -1, @@ -74,7 +74,7 @@ defineSuite([ }).toThrow(); }); - it("throws when executing Tipsify (4 of 5)", function() { + it('throws when executing Tipsify (4 of 5)', function() { expect(function() { Tipsify.tipsify({indices : [0, 1, 2], maximumIndex : 2, @@ -82,13 +82,13 @@ defineSuite([ }).toThrow(); }); - it("throws when executing Tipsify (5 of 5)", function() { + it('throws when executing Tipsify (5 of 5)', function() { expect(function() { Tipsify.tipsify(); }).toThrow(); }); - it("can lower ACMR using the Tipsify algorithm", function() { + it('can lower ACMR using the Tipsify algorithm', function() { var indices = [0, 1, 7, 1, 7, 8, 1, 2, 8, 2, 8, 9, 2, 3, 9, 3, 9, 10, 3, 4, 10, 4, 10, 11, 4, 5, 11, 5, 11, 12, 6, 13, 14, 6, 7, 14, 7, 14, 15, 7, 8, 15, 8, 15, 16, 8, 9, 16, 9, 16, 17, 9, 10, 17, 10, 17, 18, 10, 11, 18, 11, 18, 19, 11, 12, 19, 12, 19, 20, 13, 21, 22, 13, 14, 22, 14, 22, 23, 14, 15, 23, 15, 23, 24, 15, 16, 24, 16, 24, 25, 16, 17, 25, 17, 25, 26, 17, 18, 26, 18, 26, 27, 18, 19, 27, 19, 27, 28, 19, 20, 28]; @@ -104,7 +104,7 @@ defineSuite([ expect(acmrAfter).toBeLessThan(acmrBefore); }); - it("can Tipsify without knowing the maximum index", function() { + it('can Tipsify without knowing the maximum index', function() { var indices = [0, 1, 7, 1, 7, 8, 1, 2, 8, 2, 8, 9, 2, 3, 9, 3, 9, 10, 3, 4, 10, 4, 10, 11, 4, 5, 11, 5, 11, 12, 6, 13, 14, 6, 7, 14, 7, 14, 15, 7, 8, 15, 8, 15, 16, 8, 9, 16, 9, 16, 17, 9, 10, 17, 10, 17, 18, 10, 11, 18, 11, 18, 19, 11, 12, 19, 12, 19, 20, 13, 21, 22, 13, 14, 22, 14, 22, 23, 14, 15, 23, 15, 23, 24, 15, 16, 24, 16, 24, 25, 16, 17, 25, 17, 25, 26, 17, 18, 26, 18, 26, 27, 18, 19, 27, 19, 27, 28, 19, 20, 28]; diff --git a/Specs/Core/TransformsSpec.js b/Specs/Core/TransformsSpec.js index 2e3c819a165..c49411b643e 100644 --- a/Specs/Core/TransformsSpec.js +++ b/Specs/Core/TransformsSpec.js @@ -18,7 +18,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("creates an east-north-up-to-fixed-frame matrix", function() { + it('creates an east-north-up-to-fixed-frame matrix', function() { var m = Transforms.eastNorthUpToFixedFrame(new Cartesian3(1.0, 0.0, 0.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Y)).toEqual(true); // east @@ -27,7 +27,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(1.0, 0.0, 0.0, 1.0))).toEqual(true); // translation }); - it("creates an east-north-up-to-fixed-frame matrix at altitude", function() { + it('creates an east-north-up-to-fixed-frame matrix at altitude', function() { var m = Transforms.eastNorthUpToFixedFrame(new Cartesian3(2.0, 0.0, 0.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Y)).toEqual(true); // east @@ -36,7 +36,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(2.0, 0.0, 0.0, 1.0))).toEqual(true); // translation }); - it("creates an east-north-up-to-fixed-frame matrix 2", function() { + it('creates an east-north-up-to-fixed-frame matrix 2', function() { var m = Transforms.eastNorthUpToFixedFrame(new Cartesian3(-1.0, 0.0, 0.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Y.negate())).toEqual(true); // east @@ -45,7 +45,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(-1.0, 0.0, 0.0, 1.0))).toEqual(true); // translation }); - it("creates an east-north-up-to-fixed-frame matrix at north pole", function() { + it('creates an east-north-up-to-fixed-frame matrix at north pole', function() { var m = Transforms.eastNorthUpToFixedFrame(new Cartesian3(0.0, 0.0, 1.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Y)).toEqual(true); // east @@ -54,7 +54,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(0.0, 0.0, 1.0, 1.0))).toEqual(true); // translation }); - it("creates an east-north-up-to-fixed-frame matrix at south pole", function() { + it('creates an east-north-up-to-fixed-frame matrix at south pole', function() { var m = Transforms.eastNorthUpToFixedFrame(new Cartesian3(0.0, 0.0, -1.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Y)).toEqual(true); // east @@ -63,7 +63,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(0.0, 0.0, -1.0, 1.0))).toEqual(true); // translation }); - it("creates an north-east-down-to-fixed-frame matrix", function() { + it('creates an north-east-down-to-fixed-frame matrix', function() { var m = Transforms.northEastDownToFixedFrame(new Cartesian3(1.0, 0.0, 0.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Z)).toEqual(true); // north @@ -72,7 +72,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(1.0, 0.0, 0.0, 1.0))).toEqual(true); // translation }); - it("creates an north-east-down-to-fixed-frame matrix at altitude", function() { + it('creates an north-east-down-to-fixed-frame matrix at altitude', function() { var m = Transforms.northEastDownToFixedFrame(new Cartesian3(2.0, 0.0, 0.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Z)).toEqual(true); // north @@ -81,7 +81,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(2.0, 0.0, 0.0, 1.0))).toEqual(true); // translation }); - it("creates an north-east-down-to-fixed-frame matrix 2", function() { + it('creates an north-east-down-to-fixed-frame matrix 2', function() { var m = Transforms.northEastDownToFixedFrame(new Cartesian3(-1.0, 0.0, 0.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_Z)).toEqual(true); // north @@ -90,7 +90,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(-1.0, 0.0, 0.0, 1.0))).toEqual(true); // translation }); - it("creates an north-east-down-to-fixed-frame matrix at north pole", function() { + it('creates an north-east-down-to-fixed-frame matrix at north pole', function() { var m = Transforms.northEastDownToFixedFrame(new Cartesian3(0.0, 0.0, 1.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_X.negate())).toEqual(true); // north @@ -99,7 +99,7 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(0.0, 0.0, 1.0, 1.0))).toEqual(true); // translation }); - it("creates an north-east-down-to-fixed-frame matrix at south pole", function() { + it('creates an north-east-down-to-fixed-frame matrix at south pole', function() { var m = Transforms.northEastDownToFixedFrame(new Cartesian3(0.0, 0.0, -1.0), Ellipsoid.UNIT_SPHERE); expect(m.getColumn0().equals(Cartesian4.UNIT_X)).toEqual(true); // north @@ -108,37 +108,37 @@ defineSuite([ expect(m.getColumn3().equals(new Cartesian4(0.0, 0.0, -1.0, 1.0))).toEqual(true); // translation }); - it("creates an east-north-up-to-fixed-frame matrix without a position throws", function() { + it('creates an east-north-up-to-fixed-frame matrix without a position throws', function() { expect(function() { Transforms.eastNorthUpToFixedFrame(); }).toThrow(); }); - it("creates an north-east-down-to-fixed-fram matrix without a position throws", function() { + it('creates an north-east-down-to-fixed-fram matrix without a position throws', function() { expect(function() { Transforms.northEastDownToFixedFrame(); }).toThrow(); }); - it("transform point to window coordinates without a model-view-projection matrix throws", function() { + it('transform point to window coordinates without a model-view-projection matrix throws', function() { expect(function() { Transforms.pointToWindowCoordinates(); }).toThrow(); }); - it("transform point to window coordinates without a viewport transformation throws", function() { + it('transform point to window coordinates without a viewport transformation throws', function() { expect(function() { Transforms.pointToWindowCoordinates(Matrix4.IDENTITY); }).toThrow(); }); - it("transform point to window coordinates without a point throws", function() { + it('transform point to window coordinates without a point throws', function() { expect(function() { Transforms.pointToWindowCoordinates(Matrix4.IDENTITY, Matrix4.IDENTITY); }).toThrow(); }); - it("transform point to window coordinates center", function() { + it('transform point to window coordinates center', function() { var width = 1024.0; var height = 768.0; var perspective = Matrix4.createPerspectiveFieldOfView(CesiumMath.toRadians(60.0), width / height, 1.0, 10.0); @@ -153,7 +153,7 @@ defineSuite([ expect(Transforms.pointToWindowCoordinates(mvpMatrix, vpTransform, Cartesian3.ZERO)).toEqual(expected); }); - it("transform point to window coordinates lower left", function() { + it('transform point to window coordinates lower left', function() { var width = 1024.0; var height = 768.0; var perspective = Matrix4.createPerspectiveFieldOfView(CesiumMath.toRadians(60.0), width / height, 1.0, 10.0); @@ -173,7 +173,7 @@ defineSuite([ expect(actual.equalsEpsilon(expected, CesiumMath.EPSILON12)).toEqual(true); }); - it("transform point to window coordinates upper right", function() { + it('transform point to window coordinates upper right', function() { var width = 1024.0; var height = 768.0; var perspective = Matrix4.createPerspectiveFieldOfView(CesiumMath.toRadians(60.0), width / height, 1.0, 10.0); diff --git a/Specs/Core/TridiagonalSystemSolverSpec.js b/Specs/Core/TridiagonalSystemSolverSpec.js index 7a77b54bc1f..08d90e6470c 100644 --- a/Specs/Core/TridiagonalSystemSolverSpec.js +++ b/Specs/Core/TridiagonalSystemSolverSpec.js @@ -10,49 +10,49 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("solve throws exception without lower diagonal", function() { + it('solve throws exception without lower diagonal', function() { expect(function() { TridiagonalSystemSolver.solve(); }).toThrow(); }); - it("solve throws exception without diagonal", function() { + it('solve throws exception without diagonal', function() { expect(function() { TridiagonalSystemSolver.solve([]); }).toThrow(); }); - it("solve throws exception without upper diagonal", function() { + it('solve throws exception without upper diagonal', function() { expect(function() { TridiagonalSystemSolver.solve([], []); }).toThrow(); }); - it("solve throws exception without rhs vector", function() { + it('solve throws exception without rhs vector', function() { expect(function() { TridiagonalSystemSolver.solve([], [], []); }).toThrow(); }); - it("solve throws exception when rhs vector length is not equal to diagonal length", function() { + it('solve throws exception when rhs vector length is not equal to diagonal length', function() { expect(function() { TridiagonalSystemSolver.solve([], [], [], [1]); }).toThrow(); }); - it("solve throws exception when lower diagonal length is not equal to upper diagonal length", function() { + it('solve throws exception when lower diagonal length is not equal to upper diagonal length', function() { expect(function() { TridiagonalSystemSolver.solve([1], [1], [], [1]); }).toThrow(); }); - it("solve throws exception when lower/upper diagonal length is not one less than diagonal length", function() { + it('solve throws exception when lower/upper diagonal length is not one less than diagonal length', function() { expect(function() { TridiagonalSystemSolver.solve([1], [1], [1], [1]); }).toThrow(); }); - it("solve three unknowns", function() { + it('solve three unknowns', function() { var l = [1.0, 1.0]; var d = [-2.175, -2.15, -2.125]; var u = [1.0, 1.0]; @@ -69,7 +69,7 @@ defineSuite([ expect(actual[2].equalsEpsilon(expected[2], CesiumMath.EPSILON4)).toEqual(true); }); - it("solve nine unknowns", function() { + it('solve nine unknowns', function() { var l = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]; var d = [-2.0304, -2.0288, -2.0272, -2.0256, -2.0240, -2.0224, -2.0208, -2.0192, -2.0176]; var u = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]; diff --git a/Specs/Core/binarySearchSpec.js b/Specs/Core/binarySearchSpec.js index eecfe4559c0..becb0a7c06a 100644 --- a/Specs/Core/binarySearchSpec.js +++ b/Specs/Core/binarySearchSpec.js @@ -3,7 +3,7 @@ defineSuite(['Core/binarySearch'], function(binarySearch) { "use strict"; /*global it,expect*/ - it("can perform a binary search (1)", function() { + it('can perform a binary search (1)', function() { var array = [0, 1, 2, 3, 4, 5, 6, 7]; var toFind = 2; var index = binarySearch(array, toFind, function(a, b) { @@ -12,7 +12,7 @@ defineSuite(['Core/binarySearch'], function(binarySearch) { expect(index).toEqual(2); }); - it("can perform a binary search (2)", function() { + it('can perform a binary search (2)', function() { var array = [0, 1, 2, 3, 4, 5, 6, 7]; var toFind = 7; var index = binarySearch(array, toFind, function(a, b) { @@ -21,7 +21,7 @@ defineSuite(['Core/binarySearch'], function(binarySearch) { expect(index).toEqual(7); }); - it("can perform a binary search (3)", function() { + it('can perform a binary search (3)', function() { var array = [0, 1, 2, 3, 4, 5, 6, 7]; var toFind = 10; var index = binarySearch(array, toFind, function(a, b) { @@ -30,19 +30,19 @@ defineSuite(['Core/binarySearch'], function(binarySearch) { expect(index < 0).toEqual(true); }); - it("throws an exception if array is missing", function() { + it('throws an exception if array is missing', function() { expect(function() { binarySearch(); }).toThrow(); }); - it("throws an exception if itemToFind is missing", function() { + it('throws an exception if itemToFind is missing', function() { expect(function() { binarySearch([0, 1, 2]); }).toThrow(); }); - it("throws an exception if comparator is missing", function() { + it('throws an exception if comparator is missing', function() { expect(function() { binarySearch([0, 1, 2], 1); }).toThrow(); diff --git a/Specs/Core/combineSpec.js b/Specs/Core/combineSpec.js index 167126d16e3..fbe59a9239e 100644 --- a/Specs/Core/combineSpec.js +++ b/Specs/Core/combineSpec.js @@ -6,7 +6,7 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("combine throws with duplicate member", function() { + it('combine throws with duplicate member', function() { expect(function() { combine({ x : 1, @@ -18,7 +18,7 @@ defineSuite([ }).toThrow(); }); - it("combine", function() { + it('combine', function() { var obj1 = { x : 1, y : 2 diff --git a/Specs/Core/createGuidSpec.js b/Specs/Core/createGuidSpec.js index 137091705c4..c49cc130132 100644 --- a/Specs/Core/createGuidSpec.js +++ b/Specs/Core/createGuidSpec.js @@ -3,7 +3,7 @@ defineSuite(['Core/createGuid'], function(createGuid) { "use strict"; /*global it,expect*/ - it("creates GUIDs", function() { + it('creates GUIDs', function() { var isGuidRegex = /^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/; //Create three GUIDs diff --git a/Specs/Core/isLeapYearSpec.js b/Specs/Core/isLeapYearSpec.js index 71bbc71a9be..f057772472a 100644 --- a/Specs/Core/isLeapYearSpec.js +++ b/Specs/Core/isLeapYearSpec.js @@ -3,7 +3,7 @@ defineSuite(['Core/isLeapYear'], function(isLeapYear) { "use strict"; /*global it,expect*/ - it("Check for valid leap years", function() { + it('Check for valid leap years', function() { expect(isLeapYear(2000)).toEqual(true); expect(isLeapYear(2004)).toEqual(true); expect(isLeapYear(2003)).toEqual(false); @@ -13,21 +13,21 @@ defineSuite(['Core/isLeapYear'], function(isLeapYear) { expect(isLeapYear(-2000)).toEqual(true); }); - it("Fail with null value", function() { + it('Fail with null value', function() { expect(function() { isLeapYear(null); }).toThrow(); }); - it("Fail with undefined value", function() { + it('Fail with undefined value', function() { expect(function() { isLeapYear(undefined); }).toThrow(); }); - it("Fail with non-numerical value", function() { + it('Fail with non-numerical value', function() { expect(function() { - isLeapYear("asd"); + isLeapYear('asd'); }).toThrow(); }); }); \ No newline at end of file diff --git a/Specs/Core/pointInsideTriangle2DSpec.js b/Specs/Core/pointInsideTriangle2DSpec.js index 0a5353608d3..ccbd85a6ca9 100644 --- a/Specs/Core/pointInsideTriangle2DSpec.js +++ b/Specs/Core/pointInsideTriangle2DSpec.js @@ -8,49 +8,49 @@ defineSuite([ "use strict"; /*global it,expect*/ - it("pointInsideTriangle2D has point inside", function() { + it('pointInsideTriangle2D has point inside', function() { expect(pointInsideTriangle2D(new Cartesian2(0.25, 0.25), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0))).toEqual(true); }); - it("pointInsideTriangle2D has point outside", function() { + it('pointInsideTriangle2D has point outside', function() { expect(pointInsideTriangle2D(new Cartesian2(1.0, 1.0), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0))).toEqual(false); }); - it("pointInsideTriangle2D has point outside (2)", function() { + it('pointInsideTriangle2D has point outside (2)', function() { expect(pointInsideTriangle2D(new Cartesian2(0.5, -0.5), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0))).toEqual(false); }); - it("pointInsideTriangle2D has point outside (3)", function() { + it('pointInsideTriangle2D has point outside (3)', function() { expect(pointInsideTriangle2D(new Cartesian2(-0.5, 0.5), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0))).toEqual(false); }); - it("pointInsideTriangle2D has point on corner", function() { + it('pointInsideTriangle2D has point on corner', function() { expect(pointInsideTriangle2D(Cartesian2.ZERO, Cartesian2.ZERO, new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0))).toEqual(false); }); - it("pointInsideTriangle2D has point inside on edge", function() { + it('pointInsideTriangle2D has point inside on edge', function() { expect(pointInsideTriangle2D(new Cartesian2(0.5, 0.0), Cartesian2.ZERO, new Cartesian2(1.0, 0.0), new Cartesian2(0.0, 1.0))).toEqual(false); }); - it("throws without point", function() { + it('throws without point', function() { expect(function() { pointInsideTriangle2D(); }).toThrow(); }); - it("throws without p0", function() { + it('throws without p0', function() { expect(function() { pointInsideTriangle2D(new Cartesian2()); }).toThrow(); }); - it("throws without p1", function() { + it('throws without p1', function() { expect(function() { pointInsideTriangle2D(new Cartesian2(), new Cartesian2()); }).toThrow(); }); - it("throws without p2", function() { + it('throws without p2', function() { expect(function() { pointInsideTriangle2D(new Cartesian2(), new Cartesian2(), new Cartesian2()); }).toThrow(); diff --git a/Specs/Core/shallowEqualsSpec.js b/Specs/Core/shallowEqualsSpec.js index 379c722db2c..546e69b59dd 100755 --- a/Specs/Core/shallowEqualsSpec.js +++ b/Specs/Core/shallowEqualsSpec.js @@ -3,27 +3,27 @@ defineSuite(['Core/shallowEquals'], function(shallowEquals) { "use strict"; /*global it,expect*/ - it("returns false if left is undefined", function() { + it('returns false if left is undefined', function() { expect(shallowEquals(undefined, { a : 0 })).toEqual(false); }); - it("return false if right is undefined", function() { + it('return false if right is undefined', function() { expect(shallowEquals({ a : 0 }, undefined)).toEqual(false); }); - it("returns false if left and right are falsy", function() { + it('returns false if left and right are falsy', function() { expect(shallowEquals(undefined, null)).toEqual(false); }); - it("return true if left and right are undefined", function() { + it('return true if left and right are undefined', function() { expect(shallowEquals(undefined, undefined)).toEqual(true); }); - it("returns true if left and right are equal", function() { + it('returns true if left and right are equal', function() { expect(shallowEquals({ a : 0, b : 1 @@ -33,7 +33,7 @@ defineSuite(['Core/shallowEquals'], function(shallowEquals) { })).toEqual(true); }); - it("returns false if left and right are not equal", function() { + it('returns false if left and right are not equal', function() { expect(shallowEquals({ a : 0, b : 1 diff --git a/Specs/Renderer/AutomaticUniformSpec.js b/Specs/Renderer/AutomaticUniformSpec.js index 284f45ef110..ae4f54e46d7 100644 --- a/Specs/Renderer/AutomaticUniformSpec.js +++ b/Specs/Renderer/AutomaticUniformSpec.js @@ -5,7 +5,7 @@ defineSuite([ 'Core/Matrix4', 'Core/PrimitiveType', 'Renderer/BufferUsage' - ], "Renderer/AutomaticUniforms", function( + ], 'Renderer/AutomaticUniforms', function( createContext, destroyContext, Matrix4, @@ -25,7 +25,7 @@ defineSuite([ }); function verifyDraw(fs) { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var sp = context.createShaderProgram(vs, fs); var va = context.createVertexArray(); @@ -49,65 +49,65 @@ defineSuite([ va = va.destroy(); } - it("can declare automatic uniforms", function() { + it('can declare automatic uniforms', function() { var fs = - "uniform ivec4 agi_viewport; " + - "void main() { " + - " gl_FragColor = vec4((agi_viewport.x == 0) && (agi_viewport.y == 0) && (agi_viewport.z == 1) && (agi_viewport.w == 1)); " + - "}"; + 'uniform ivec4 agi_viewport; ' + + 'void main() { ' + + ' gl_FragColor = vec4((agi_viewport.x == 0) && (agi_viewport.y == 0) && (agi_viewport.z == 1) && (agi_viewport.w == 1)); ' + + '}'; verifyDraw(fs); }); - it("has agi_viewport", function() { + it('has agi_viewport', function() { var fs = - "void main() { " + - " gl_FragColor = vec4((agi_viewport.x == 0) && (agi_viewport.y == 0) && (agi_viewport.z == 1) && (agi_viewport.w == 1)); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4((agi_viewport.x == 0) && (agi_viewport.y == 0) && (agi_viewport.z == 1) && (agi_viewport.w == 1)); ' + + '}'; verifyDraw(fs); }); - it("has agi_viewportOrthographic", function() { + it('has agi_viewportOrthographic', function() { var fs = - "void main() { " + - " bool b0 = (agi_viewportOrthographic[0][0] != 0.0) && (agi_viewportOrthographic[1][0] == 0.0) && (agi_viewportOrthographic[2][0] == 0.0) && (agi_viewportOrthographic[3][0] != 0.0); " + - " bool b1 = (agi_viewportOrthographic[0][1] == 0.0) && (agi_viewportOrthographic[1][1] != 0.0) && (agi_viewportOrthographic[2][1] == 0.0) && (agi_viewportOrthographic[3][1] != 0.0); " + - " bool b2 = (agi_viewportOrthographic[0][2] == 0.0) && (agi_viewportOrthographic[1][2] == 0.0) && (agi_viewportOrthographic[2][2] != 0.0) && (agi_viewportOrthographic[3][2] != 0.0); " + - " bool b3 = (agi_viewportOrthographic[0][3] == 0.0) && (agi_viewportOrthographic[1][3] == 0.0) && (agi_viewportOrthographic[2][3] == 0.0) && (agi_viewportOrthographic[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_viewportOrthographic[0][0] != 0.0) && (agi_viewportOrthographic[1][0] == 0.0) && (agi_viewportOrthographic[2][0] == 0.0) && (agi_viewportOrthographic[3][0] != 0.0); ' + + ' bool b1 = (agi_viewportOrthographic[0][1] == 0.0) && (agi_viewportOrthographic[1][1] != 0.0) && (agi_viewportOrthographic[2][1] == 0.0) && (agi_viewportOrthographic[3][1] != 0.0); ' + + ' bool b2 = (agi_viewportOrthographic[0][2] == 0.0) && (agi_viewportOrthographic[1][2] == 0.0) && (agi_viewportOrthographic[2][2] != 0.0) && (agi_viewportOrthographic[3][2] != 0.0); ' + + ' bool b3 = (agi_viewportOrthographic[0][3] == 0.0) && (agi_viewportOrthographic[1][3] == 0.0) && (agi_viewportOrthographic[2][3] == 0.0) && (agi_viewportOrthographic[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_viewportTransformation", function() { + it('has agi_viewportTransformation', function() { var fs = - "void main() { " + - " bool b0 = (agi_viewportTransformation[0][0] != 0.0) && (agi_viewportTransformation[1][0] == 0.0) && (agi_viewportTransformation[2][0] == 0.0) && (agi_viewportTransformation[3][0] != 0.0); " + - " bool b1 = (agi_viewportTransformation[0][1] == 0.0) && (agi_viewportTransformation[1][1] != 0.0) && (agi_viewportTransformation[2][1] == 0.0) && (agi_viewportTransformation[3][1] != 0.0); " + - " bool b2 = (agi_viewportTransformation[0][2] == 0.0) && (agi_viewportTransformation[1][2] == 0.0) && (agi_viewportTransformation[2][2] != 0.0) && (agi_viewportTransformation[3][2] != 0.0); " + - " bool b3 = (agi_viewportTransformation[0][3] == 0.0) && (agi_viewportTransformation[1][3] == 0.0) && (agi_viewportTransformation[2][3] == 0.0) && (agi_viewportTransformation[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_viewportTransformation[0][0] != 0.0) && (agi_viewportTransformation[1][0] == 0.0) && (agi_viewportTransformation[2][0] == 0.0) && (agi_viewportTransformation[3][0] != 0.0); ' + + ' bool b1 = (agi_viewportTransformation[0][1] == 0.0) && (agi_viewportTransformation[1][1] != 0.0) && (agi_viewportTransformation[2][1] == 0.0) && (agi_viewportTransformation[3][1] != 0.0); ' + + ' bool b2 = (agi_viewportTransformation[0][2] == 0.0) && (agi_viewportTransformation[1][2] == 0.0) && (agi_viewportTransformation[2][2] != 0.0) && (agi_viewportTransformation[3][2] != 0.0); ' + + ' bool b3 = (agi_viewportTransformation[0][3] == 0.0) && (agi_viewportTransformation[1][3] == 0.0) && (agi_viewportTransformation[2][3] == 0.0) && (agi_viewportTransformation[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_model", function() { + it('has agi_model', function() { var us = context.getUniformState(); us.setModel(new Matrix4( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0)); var fs = - "void main() { " + - " bool b0 = (agi_model[0][0] == 1.0) && (agi_model[1][0] == 2.0) && (agi_model[2][0] == 3.0) && (agi_model[3][0] == 4.0); " + - " bool b1 = (agi_model[0][1] == 5.0) && (agi_model[1][1] == 6.0) && (agi_model[2][1] == 7.0) && (agi_model[3][1] == 8.0); " + - " bool b2 = (agi_model[0][2] == 9.0) && (agi_model[1][2] == 10.0) && (agi_model[2][2] == 11.0) && (agi_model[3][2] == 12.0); " + - " bool b3 = (agi_model[0][3] == 13.0) && (agi_model[1][3] == 14.0) && (agi_model[2][3] == 15.0) && (agi_model[3][3] == 16.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_model[0][0] == 1.0) && (agi_model[1][0] == 2.0) && (agi_model[2][0] == 3.0) && (agi_model[3][0] == 4.0); ' + + ' bool b1 = (agi_model[0][1] == 5.0) && (agi_model[1][1] == 6.0) && (agi_model[2][1] == 7.0) && (agi_model[3][1] == 8.0); ' + + ' bool b2 = (agi_model[0][2] == 9.0) && (agi_model[1][2] == 10.0) && (agi_model[2][2] == 11.0) && (agi_model[3][2] == 12.0); ' + + ' bool b3 = (agi_model[0][3] == 13.0) && (agi_model[1][3] == 14.0) && (agi_model[2][3] == 15.0) && (agi_model[3][3] == 16.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_view", function() { + it('has agi_view', function() { var us = context.getUniformState(); us.setView(new Matrix4( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, @@ -115,17 +115,17 @@ defineSuite([ 13.0, 14.0, 15.0, 16.0)); var fs = - "void main() { " + - " bool b0 = (agi_view[0][0] == 1.0) && (agi_view[1][0] == 2.0) && (agi_view[2][0] == 3.0) && (agi_view[3][0] == 4.0); " + - " bool b1 = (agi_view[0][1] == 5.0) && (agi_view[1][1] == 6.0) && (agi_view[2][1] == 7.0) && (agi_view[3][1] == 8.0); " + - " bool b2 = (agi_view[0][2] == 9.0) && (agi_view[1][2] == 10.0) && (agi_view[2][2] == 11.0) && (agi_view[3][2] == 12.0); " + - " bool b3 = (agi_view[0][3] == 13.0) && (agi_view[1][3] == 14.0) && (agi_view[2][3] == 15.0) && (agi_view[3][3] == 16.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_view[0][0] == 1.0) && (agi_view[1][0] == 2.0) && (agi_view[2][0] == 3.0) && (agi_view[3][0] == 4.0); ' + + ' bool b1 = (agi_view[0][1] == 5.0) && (agi_view[1][1] == 6.0) && (agi_view[2][1] == 7.0) && (agi_view[3][1] == 8.0); ' + + ' bool b2 = (agi_view[0][2] == 9.0) && (agi_view[1][2] == 10.0) && (agi_view[2][2] == 11.0) && (agi_view[3][2] == 12.0); ' + + ' bool b3 = (agi_view[0][3] == 13.0) && (agi_view[1][3] == 14.0) && (agi_view[2][3] == 15.0) && (agi_view[3][3] == 16.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_inverseView", function() { + it('has agi_inverseView', function() { var us = context.getUniformState(); us.setView(new Matrix4(1.0, 0.0, 0.0, 7.0, 0.0, 1.0, 0.0, 8.0, @@ -133,17 +133,17 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " gl_FragColor = vec4(" + - " (agi_inverseView[0][0] == 1.0) && (agi_inverseView[1][0] == 0.0) && (agi_inverseView[2][0] == 0.0) && " + - " (agi_inverseView[0][1] == 0.0) && (agi_inverseView[1][1] == 1.0) && (agi_inverseView[2][1] == 0.0) && " + - " (agi_inverseView[0][2] == 0.0) && (agi_inverseView[1][2] == 0.0) && (agi_inverseView[2][2] == 1.0) " + - " ); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4(' + + ' (agi_inverseView[0][0] == 1.0) && (agi_inverseView[1][0] == 0.0) && (agi_inverseView[2][0] == 0.0) && ' + + ' (agi_inverseView[0][1] == 0.0) && (agi_inverseView[1][1] == 1.0) && (agi_inverseView[2][1] == 0.0) && ' + + ' (agi_inverseView[0][2] == 0.0) && (agi_inverseView[1][2] == 0.0) && (agi_inverseView[2][2] == 1.0) ' + + ' ); ' + + '}'; verifyDraw(fs); }); - it("has agi_projection", function() { + it('has agi_projection', function() { var us = context.getUniformState(); us.setProjection(new Matrix4( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, @@ -151,17 +151,17 @@ defineSuite([ 13.0, 14.0, 15.0, 16.0)); var fs = - "void main() { " + - " bool b0 = (agi_projection[0][0] == 1.0) && (agi_projection[1][0] == 2.0) && (agi_projection[2][0] == 3.0) && (agi_projection[3][0] == 4.0); " + - " bool b1 = (agi_projection[0][1] == 5.0) && (agi_projection[1][1] == 6.0) && (agi_projection[2][1] == 7.0) && (agi_projection[3][1] == 8.0); " + - " bool b2 = (agi_projection[0][2] == 9.0) && (agi_projection[1][2] == 10.0) && (agi_projection[2][2] == 11.0) && (agi_projection[3][2] == 12.0); " + - " bool b3 = (agi_projection[0][3] == 13.0) && (agi_projection[1][3] == 14.0) && (agi_projection[2][3] == 15.0) && (agi_projection[3][3] == 16.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_projection[0][0] == 1.0) && (agi_projection[1][0] == 2.0) && (agi_projection[2][0] == 3.0) && (agi_projection[3][0] == 4.0); ' + + ' bool b1 = (agi_projection[0][1] == 5.0) && (agi_projection[1][1] == 6.0) && (agi_projection[2][1] == 7.0) && (agi_projection[3][1] == 8.0); ' + + ' bool b2 = (agi_projection[0][2] == 9.0) && (agi_projection[1][2] == 10.0) && (agi_projection[2][2] == 11.0) && (agi_projection[3][2] == 12.0); ' + + ' bool b3 = (agi_projection[0][3] == 13.0) && (agi_projection[1][3] == 14.0) && (agi_projection[2][3] == 15.0) && (agi_projection[3][3] == 16.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_inverseProjection", function() { + it('has agi_inverseProjection', function() { var us = context.getUniformState(); us.setProjection(new Matrix4(1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 2.0, @@ -169,17 +169,17 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " bool b0 = (agi_inverseProjection[0][0] == 1.0) && (agi_inverseProjection[1][0] == 0.0) && (agi_inverseProjection[2][0] == 0.0) && (agi_inverseProjection[3][0] == -1.0); " + - " bool b1 = (agi_inverseProjection[0][1] == 0.0) && (agi_inverseProjection[1][1] == 1.0) && (agi_inverseProjection[2][1] == 0.0) && (agi_inverseProjection[3][1] == -2.0); " + - " bool b2 = (agi_inverseProjection[0][2] == 0.0) && (agi_inverseProjection[1][2] == 0.0) && (agi_inverseProjection[2][2] == 1.0) && (agi_inverseProjection[3][2] == -3.0); " + - " bool b3 = (agi_inverseProjection[0][3] == 0.0) && (agi_inverseProjection[1][3] == 0.0) && (agi_inverseProjection[2][3] == 0.0) && (agi_inverseProjection[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_inverseProjection[0][0] == 1.0) && (agi_inverseProjection[1][0] == 0.0) && (agi_inverseProjection[2][0] == 0.0) && (agi_inverseProjection[3][0] == -1.0); ' + + ' bool b1 = (agi_inverseProjection[0][1] == 0.0) && (agi_inverseProjection[1][1] == 1.0) && (agi_inverseProjection[2][1] == 0.0) && (agi_inverseProjection[3][1] == -2.0); ' + + ' bool b2 = (agi_inverseProjection[0][2] == 0.0) && (agi_inverseProjection[1][2] == 0.0) && (agi_inverseProjection[2][2] == 1.0) && (agi_inverseProjection[3][2] == -3.0); ' + + ' bool b3 = (agi_inverseProjection[0][3] == 0.0) && (agi_inverseProjection[1][3] == 0.0) && (agi_inverseProjection[2][3] == 0.0) && (agi_inverseProjection[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_infiniteProjection", function() { + it('has agi_infiniteProjection', function() { var us = context.getUniformState(); us.setInfiniteProjection(new Matrix4( 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, @@ -187,17 +187,17 @@ defineSuite([ 13.0, 14.0, 15.0, 16.0)); var fs = - "void main() { " + - " bool b0 = (agi_infiniteProjection[0][0] == 1.0) && (agi_infiniteProjection[1][0] == 2.0) && (agi_infiniteProjection[2][0] == 3.0) && (agi_infiniteProjection[3][0] == 4.0); " + - " bool b1 = (agi_infiniteProjection[0][1] == 5.0) && (agi_infiniteProjection[1][1] == 6.0) && (agi_infiniteProjection[2][1] == 7.0) && (agi_infiniteProjection[3][1] == 8.0); " + - " bool b2 = (agi_infiniteProjection[0][2] == 9.0) && (agi_infiniteProjection[1][2] == 10.0) && (agi_infiniteProjection[2][2] == 11.0) && (agi_infiniteProjection[3][2] == 12.0); " + - " bool b3 = (agi_infiniteProjection[0][3] == 13.0) && (agi_infiniteProjection[1][3] == 14.0) && (agi_infiniteProjection[2][3] == 15.0) && (agi_infiniteProjection[3][3] == 16.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_infiniteProjection[0][0] == 1.0) && (agi_infiniteProjection[1][0] == 2.0) && (agi_infiniteProjection[2][0] == 3.0) && (agi_infiniteProjection[3][0] == 4.0); ' + + ' bool b1 = (agi_infiniteProjection[0][1] == 5.0) && (agi_infiniteProjection[1][1] == 6.0) && (agi_infiniteProjection[2][1] == 7.0) && (agi_infiniteProjection[3][1] == 8.0); ' + + ' bool b2 = (agi_infiniteProjection[0][2] == 9.0) && (agi_infiniteProjection[1][2] == 10.0) && (agi_infiniteProjection[2][2] == 11.0) && (agi_infiniteProjection[3][2] == 12.0); ' + + ' bool b3 = (agi_infiniteProjection[0][3] == 13.0) && (agi_infiniteProjection[1][3] == 14.0) && (agi_infiniteProjection[2][3] == 15.0) && (agi_infiniteProjection[3][3] == 16.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_modelView", function() { + it('has agi_modelView', function() { var us = context.getUniformState(); us.setModel(new Matrix4(2.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, @@ -209,17 +209,17 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " bool b0 = (agi_modelView[0][0] == 2.0) && (agi_modelView[1][0] == 0.0) && (agi_modelView[2][0] == 0.0) && (agi_modelView[3][0] == 1.0); " + - " bool b1 = (agi_modelView[0][1] == 0.0) && (agi_modelView[1][1] == 2.0) && (agi_modelView[2][1] == 0.0) && (agi_modelView[3][1] == 1.0); " + - " bool b2 = (agi_modelView[0][2] == 0.0) && (agi_modelView[1][2] == 0.0) && (agi_modelView[2][2] == 2.0) && (agi_modelView[3][2] == 1.0); " + - " bool b3 = (agi_modelView[0][3] == 0.0) && (agi_modelView[1][3] == 0.0) && (agi_modelView[2][3] == 0.0) && (agi_modelView[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_modelView[0][0] == 2.0) && (agi_modelView[1][0] == 0.0) && (agi_modelView[2][0] == 0.0) && (agi_modelView[3][0] == 1.0); ' + + ' bool b1 = (agi_modelView[0][1] == 0.0) && (agi_modelView[1][1] == 2.0) && (agi_modelView[2][1] == 0.0) && (agi_modelView[3][1] == 1.0); ' + + ' bool b2 = (agi_modelView[0][2] == 0.0) && (agi_modelView[1][2] == 0.0) && (agi_modelView[2][2] == 2.0) && (agi_modelView[3][2] == 1.0); ' + + ' bool b3 = (agi_modelView[0][3] == 0.0) && (agi_modelView[1][3] == 0.0) && (agi_modelView[2][3] == 0.0) && (agi_modelView[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_inverseModelView", function() { + it('has agi_inverseModelView', function() { var us = context.getUniformState(); us.setModel(new Matrix4(1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 2.0, @@ -231,17 +231,17 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " bool b0 = (agi_inverseModelView[0][0] == 1.0) && (agi_inverseModelView[1][0] == 0.0) && (agi_inverseModelView[2][0] == 0.0) && (agi_inverseModelView[3][0] == -1.0); " + - " bool b1 = (agi_inverseModelView[0][1] == 0.0) && (agi_inverseModelView[1][1] == 1.0) && (agi_inverseModelView[2][1] == 0.0) && (agi_inverseModelView[3][1] == -2.0); " + - " bool b2 = (agi_inverseModelView[0][2] == 0.0) && (agi_inverseModelView[1][2] == 0.0) && (agi_inverseModelView[2][2] == 1.0) && (agi_inverseModelView[3][2] == -3.0); " + - " bool b3 = (agi_inverseModelView[0][3] == 0.0) && (agi_inverseModelView[1][3] == 0.0) && (agi_inverseModelView[2][3] == 0.0) && (agi_inverseModelView[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_inverseModelView[0][0] == 1.0) && (agi_inverseModelView[1][0] == 0.0) && (agi_inverseModelView[2][0] == 0.0) && (agi_inverseModelView[3][0] == -1.0); ' + + ' bool b1 = (agi_inverseModelView[0][1] == 0.0) && (agi_inverseModelView[1][1] == 1.0) && (agi_inverseModelView[2][1] == 0.0) && (agi_inverseModelView[3][1] == -2.0); ' + + ' bool b2 = (agi_inverseModelView[0][2] == 0.0) && (agi_inverseModelView[1][2] == 0.0) && (agi_inverseModelView[2][2] == 1.0) && (agi_inverseModelView[3][2] == -3.0); ' + + ' bool b3 = (agi_inverseModelView[0][3] == 0.0) && (agi_inverseModelView[1][3] == 0.0) && (agi_inverseModelView[2][3] == 0.0) && (agi_inverseModelView[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_viewProjection", function() { + it('has agi_viewProjection', function() { var us = context.getUniformState(); us.setView(new Matrix4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 8.0, @@ -253,18 +253,18 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " bool b0 = (agi_viewProjection[0][0] == 1.0) && (agi_viewProjection[1][0] == 0.0) && (agi_viewProjection[2][0] == 0.0) && (agi_viewProjection[3][0] == 0.0); " + - " bool b1 = (agi_viewProjection[0][1] == 0.0) && (agi_viewProjection[1][1] == 1.0) && (agi_viewProjection[2][1] == 0.0) && (agi_viewProjection[3][1] == 8.0); " + - " bool b2 = (agi_viewProjection[0][2] == 0.0) && (agi_viewProjection[1][2] == 0.0) && (agi_viewProjection[2][2] == 1.0) && (agi_viewProjection[3][2] == 9.0); " + - " bool b3 = (agi_viewProjection[0][3] == 0.0) && (agi_viewProjection[1][3] == 0.0) && (agi_viewProjection[2][3] == 0.0) && (agi_viewProjection[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_viewProjection[0][0] == 1.0) && (agi_viewProjection[1][0] == 0.0) && (agi_viewProjection[2][0] == 0.0) && (agi_viewProjection[3][0] == 0.0); ' + + ' bool b1 = (agi_viewProjection[0][1] == 0.0) && (agi_viewProjection[1][1] == 1.0) && (agi_viewProjection[2][1] == 0.0) && (agi_viewProjection[3][1] == 8.0); ' + + ' bool b2 = (agi_viewProjection[0][2] == 0.0) && (agi_viewProjection[1][2] == 0.0) && (agi_viewProjection[2][2] == 1.0) && (agi_viewProjection[3][2] == 9.0); ' + + ' bool b3 = (agi_viewProjection[0][3] == 0.0) && (agi_viewProjection[1][3] == 0.0) && (agi_viewProjection[2][3] == 0.0) && (agi_viewProjection[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_modelViewProjection", function() { + it('has agi_modelViewProjection', function() { var us = context.getUniformState(); us.setModel(new Matrix4(1.0, 0.0, 0.0, 7.0, 0.0, 1.0, 0.0, 0.0, @@ -280,18 +280,18 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " bool b0 = (agi_modelViewProjection[0][0] == 1.0) && (agi_modelViewProjection[1][0] == 0.0) && (agi_modelViewProjection[2][0] == 0.0) && (agi_modelViewProjection[3][0] == 7.0); " + - " bool b1 = (agi_modelViewProjection[0][1] == 0.0) && (agi_modelViewProjection[1][1] == 1.0) && (agi_modelViewProjection[2][1] == 0.0) && (agi_modelViewProjection[3][1] == 8.0); " + - " bool b2 = (agi_modelViewProjection[0][2] == 0.0) && (agi_modelViewProjection[1][2] == 0.0) && (agi_modelViewProjection[2][2] == 1.0) && (agi_modelViewProjection[3][2] == 9.0); " + - " bool b3 = (agi_modelViewProjection[0][3] == 0.0) && (agi_modelViewProjection[1][3] == 0.0) && (agi_modelViewProjection[2][3] == 0.0) && (agi_modelViewProjection[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_modelViewProjection[0][0] == 1.0) && (agi_modelViewProjection[1][0] == 0.0) && (agi_modelViewProjection[2][0] == 0.0) && (agi_modelViewProjection[3][0] == 7.0); ' + + ' bool b1 = (agi_modelViewProjection[0][1] == 0.0) && (agi_modelViewProjection[1][1] == 1.0) && (agi_modelViewProjection[2][1] == 0.0) && (agi_modelViewProjection[3][1] == 8.0); ' + + ' bool b2 = (agi_modelViewProjection[0][2] == 0.0) && (agi_modelViewProjection[1][2] == 0.0) && (agi_modelViewProjection[2][2] == 1.0) && (agi_modelViewProjection[3][2] == 9.0); ' + + ' bool b3 = (agi_modelViewProjection[0][3] == 0.0) && (agi_modelViewProjection[1][3] == 0.0) && (agi_modelViewProjection[2][3] == 0.0) && (agi_modelViewProjection[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_modelViewInfiniteProjection", function() { + it('has agi_modelViewInfiniteProjection', function() { var us = context.getUniformState(); us.setModel(new Matrix4(1.0, 0.0, 0.0, 7.0, 0.0, 1.0, 0.0, 0.0, @@ -307,18 +307,18 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " bool b0 = (agi_modelViewInfiniteProjection[0][0] == 1.0) && (agi_modelViewInfiniteProjection[1][0] == 0.0) && (agi_modelViewInfiniteProjection[2][0] == 0.0) && (agi_modelViewInfiniteProjection[3][0] == 7.0); " + - " bool b1 = (agi_modelViewInfiniteProjection[0][1] == 0.0) && (agi_modelViewInfiniteProjection[1][1] == 1.0) && (agi_modelViewInfiniteProjection[2][1] == 0.0) && (agi_modelViewInfiniteProjection[3][1] == 8.0); " + - " bool b2 = (agi_modelViewInfiniteProjection[0][2] == 0.0) && (agi_modelViewInfiniteProjection[1][2] == 0.0) && (agi_modelViewInfiniteProjection[2][2] == 1.0) && (agi_modelViewInfiniteProjection[3][2] == 9.0); " + - " bool b3 = (agi_modelViewInfiniteProjection[0][3] == 0.0) && (agi_modelViewInfiniteProjection[1][3] == 0.0) && (agi_modelViewInfiniteProjection[2][3] == 0.0) && (agi_modelViewInfiniteProjection[3][3] == 1.0); " + - " gl_FragColor = vec4(b0 && b1 && b2 && b3); " + - "}"; + 'void main() { ' + + ' bool b0 = (agi_modelViewInfiniteProjection[0][0] == 1.0) && (agi_modelViewInfiniteProjection[1][0] == 0.0) && (agi_modelViewInfiniteProjection[2][0] == 0.0) && (agi_modelViewInfiniteProjection[3][0] == 7.0); ' + + ' bool b1 = (agi_modelViewInfiniteProjection[0][1] == 0.0) && (agi_modelViewInfiniteProjection[1][1] == 1.0) && (agi_modelViewInfiniteProjection[2][1] == 0.0) && (agi_modelViewInfiniteProjection[3][1] == 8.0); ' + + ' bool b2 = (agi_modelViewInfiniteProjection[0][2] == 0.0) && (agi_modelViewInfiniteProjection[1][2] == 0.0) && (agi_modelViewInfiniteProjection[2][2] == 1.0) && (agi_modelViewInfiniteProjection[3][2] == 9.0); ' + + ' bool b3 = (agi_modelViewInfiniteProjection[0][3] == 0.0) && (agi_modelViewInfiniteProjection[1][3] == 0.0) && (agi_modelViewInfiniteProjection[2][3] == 0.0) && (agi_modelViewInfiniteProjection[3][3] == 1.0); ' + + ' gl_FragColor = vec4(b0 && b1 && b2 && b3); ' + + '}'; verifyDraw(fs); }); - it("has agi_normal", function() { + it('has agi_normal', function() { var us = context.getUniformState(); us.setModel(new Matrix4(1.0, 0.0, 0.0, 7.0, 0.0, 1.0, 0.0, 8.0, @@ -326,45 +326,45 @@ defineSuite([ 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " gl_FragColor = vec4(" + - " (agi_normal[0][0] == 1.0) && (agi_normal[1][0] == 0.0) && (agi_normal[2][0] == 0.0) && " + - " (agi_normal[0][1] == 0.0) && (agi_normal[1][1] == 1.0) && (agi_normal[2][1] == 0.0) && " + - " (agi_normal[0][2] == 0.0) && (agi_normal[1][2] == 0.0) && (agi_normal[2][2] == 1.0) " + - " ); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4(' + + ' (agi_normal[0][0] == 1.0) && (agi_normal[1][0] == 0.0) && (agi_normal[2][0] == 0.0) && ' + + ' (agi_normal[0][1] == 0.0) && (agi_normal[1][1] == 1.0) && (agi_normal[2][1] == 0.0) && ' + + ' (agi_normal[0][2] == 0.0) && (agi_normal[1][2] == 0.0) && (agi_normal[2][2] == 1.0) ' + + ' ); ' + + '}'; verifyDraw(fs); }); - it("has agi_inverseNormal", function() { + it('has agi_inverseNormal', function() { var us = context.getUniformState(); us.setModel(new Matrix4(1.0, 0.0, 0.0, 7.0, 0.0, 1.0, 0.0, 8.0, 0.0, 0.0, 1.0, 9.0, 0.0, 0.0, 0.0, 1.0)); var fs = - "void main() { " + - " gl_FragColor = vec4(" + - " (agi_inverseNormal[0][0] == 1.0) && (agi_inverseNormal[1][0] == 0.0) && (agi_inverseNormal[2][0] == 0.0) && " + - " (agi_inverseNormal[0][1] == 0.0) && (agi_inverseNormal[1][1] == 1.0) && (agi_inverseNormal[2][1] == 0.0) && " + - " (agi_inverseNormal[0][2] == 0.0) && (agi_inverseNormal[1][2] == 0.0) && (agi_inverseNormal[2][2] == 1.0) " + - " ); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4(' + + ' (agi_inverseNormal[0][0] == 1.0) && (agi_inverseNormal[1][0] == 0.0) && (agi_inverseNormal[2][0] == 0.0) && ' + + ' (agi_inverseNormal[0][1] == 0.0) && (agi_inverseNormal[1][1] == 1.0) && (agi_inverseNormal[2][1] == 0.0) && ' + + ' (agi_inverseNormal[0][2] == 0.0) && (agi_inverseNormal[1][2] == 0.0) && (agi_inverseNormal[2][2] == 1.0) ' + + ' ); ' + + '}'; verifyDraw(fs); }); - it("has agi_sunDirectionEC", function() { - var fs = "void main() { gl_FragColor = vec4(agi_sunDirectionEC != vec3(0.0)); }"; + it('has agi_sunDirectionEC', function() { + var fs = 'void main() { gl_FragColor = vec4(agi_sunDirectionEC != vec3(0.0)); }'; verifyDraw(fs); }); - it("has agi_sunDirectionWC", function() { - var fs = "void main() { gl_FragColor = vec4(agi_sunDirectionWC != vec3(0.0)); }"; + it('has agi_sunDirectionWC', function() { + var fs = 'void main() { gl_FragColor = vec4(agi_sunDirectionWC != vec3(0.0)); }'; verifyDraw(fs); }); - it("has agi_viewerPositionWC", function() { - var fs = "void main() { gl_FragColor = vec4(agi_viewerPositionWC == vec3(0.0)); }"; + it('has agi_viewerPositionWC', function() { + var fs = 'void main() { gl_FragColor = vec4(agi_viewerPositionWC == vec3(0.0)); }'; verifyDraw(fs); }); }); \ No newline at end of file diff --git a/Specs/Renderer/BufferSpec.js b/Specs/Renderer/BufferSpec.js index 29377fdf0f8..5ed9f44fb64 100644 --- a/Specs/Renderer/BufferSpec.js +++ b/Specs/Renderer/BufferSpec.js @@ -5,7 +5,7 @@ defineSuite([ 'Core/Matrix4', 'Core/IndexDatatype', 'Renderer/BufferUsage' - ], "Renderer/Buffer", function( + ], 'Renderer/Buffer', function( createContext, destroyContext, Matrix4, @@ -29,14 +29,14 @@ defineSuite([ destroyContext(context); }); - it("creates vertex buffer", function() { + it('creates vertex buffer', function() { buffer = context.createVertexBuffer(16, BufferUsage.STATIC_DRAW); expect(buffer.getSizeInBytes()).toEqual(16); expect(buffer.getUsage()).toEqual(BufferUsage.STATIC_DRAW); }); - it("copies array to a vertex buffer", function() { + it('copies array to a vertex buffer', function() { var sizeInBytes = 3 * Float32Array.BYTES_PER_ELEMENT; var vertices = new ArrayBuffer(sizeInBytes); var positions = new Float32Array(vertices); @@ -48,7 +48,7 @@ defineSuite([ buffer.copyFromArrayView(vertices); }); - it("creates index buffer", function() { + it('creates index buffer', function() { buffer = context.createIndexBuffer(6, BufferUsage.STREAM_DRAW, IndexDatatype.UNSIGNED_SHORT); expect(buffer.getSizeInBytes()).toEqual(6); @@ -59,7 +59,7 @@ defineSuite([ expect(buffer.getNumberOfIndices()).toEqual(3); }); - it("copies array to an index buffer", function() { + it('copies array to an index buffer', function() { var sizeInBytes = 3 * Uint16Array.BYTES_PER_ELEMENT; var elements = new ArrayBuffer(sizeInBytes); var indices = new Uint16Array(elements); @@ -71,33 +71,33 @@ defineSuite([ buffer.copyFromArrayView(elements); }); - it("destroys", function() { + it('destroys', function() { var b = context.createIndexBuffer(3, BufferUsage.STATIC_DRAW, IndexDatatype.UNSIGNED_BYTE); expect(b.isDestroyed()).toEqual(false); b.destroy(); expect(b.isDestroyed()).toEqual(true); }); - it("fails to create", function() { + it('fails to create', function() { expect(function() { buffer = context.createVertexBuffer(0, BufferUsage.STATIC_DRAW); }).toThrow(); }); - it("fails to create again", function() { + it('fails to create again', function() { expect(function() { buffer = context.createVertexBuffer(4, 0); }).toThrow(); }); - it("fails to provide an array view", function() { + it('fails to provide an array view', function() { buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); expect(function() { buffer.copyFromArrayView(); }).toThrow(); }); - it("fails to copy a large array view", function() { + it('fails to copy a large array view', function() { buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var elements = new ArrayBuffer(3); @@ -106,7 +106,7 @@ defineSuite([ }).toThrow(); }); - it("fails to destroy", function() { + it('fails to destroy', function() { var b = context.createIndexBuffer(3, BufferUsage.STATIC_DRAW, IndexDatatype.UNSIGNED_BYTE); b.destroy(); diff --git a/Specs/Renderer/BuiltinFunctionsSpec.js b/Specs/Renderer/BuiltinFunctionsSpec.js index c6cc93ef1fc..6417d79ee93 100644 --- a/Specs/Renderer/BuiltinFunctionsSpec.js +++ b/Specs/Renderer/BuiltinFunctionsSpec.js @@ -6,7 +6,7 @@ defineSuite([ 'Core/Matrix4', 'Core/PrimitiveType', 'Renderer/BufferUsage' - ], "Renderer/BuiltinFunctions", function( + ], 'Renderer/BuiltinFunctions', function( createContext, destroyContext, CesiumMath, @@ -27,7 +27,7 @@ defineSuite([ }); var verifyDraw = function(fs) { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var sp = context.createShaderProgram(vs, fs); var va = context.createVertexArray(); @@ -51,75 +51,75 @@ defineSuite([ va = va.destroy(); }; - it("has agi_tranpose (2x2)", function() { + it('has agi_tranpose (2x2)', function() { var fs = - "void main() { " + - " mat2 m = mat2(1.0, 2.0, 3.0, 4.0); " + - " mat2 mt = mat2(1.0, 3.0, 2.0, 4.0); " + - " gl_FragColor = vec4(agi_transpose(m) == mt); " + - "}"; + 'void main() { ' + + ' mat2 m = mat2(1.0, 2.0, 3.0, 4.0); ' + + ' mat2 mt = mat2(1.0, 3.0, 2.0, 4.0); ' + + ' gl_FragColor = vec4(agi_transpose(m) == mt); ' + + '}'; verifyDraw(fs); }); - it("has agi_tranpose (3x3)", function() { + it('has agi_tranpose (3x3)', function() { var fs = - "void main() { " + - " mat3 m = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); " + - " mat3 mt = mat3(1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0); " + - " gl_FragColor = vec4(agi_transpose(m) == mt); " + - "}"; + 'void main() { ' + + ' mat3 m = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); ' + + ' mat3 mt = mat3(1.0, 4.0, 7.0, 2.0, 5.0, 8.0, 3.0, 6.0, 9.0); ' + + ' gl_FragColor = vec4(agi_transpose(m) == mt); ' + + '}'; verifyDraw(fs); }); - it("has agi_tranpose (4x4)", function() { + it('has agi_tranpose (4x4)', function() { var fs = - "void main() { " + - " mat4 m = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0);" + - " mat4 mt = mat4(1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0);" + - " gl_FragColor = vec4(agi_transpose(m) == mt); " + - "}"; + 'void main() { ' + + ' mat4 m = mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0);' + + ' mat4 mt = mat4(1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0);' + + ' gl_FragColor = vec4(agi_transpose(m) == mt); ' + + '}'; verifyDraw(fs); }); - it("has agi_eyeToWindowCoordinates", function() { + it('has agi_eyeToWindowCoordinates', function() { var vp = context.getViewport(); var perspective = Matrix4.createPerspectiveFieldOfView(CesiumMath.toRadians(60.0), vp.width / vp.height, 1.0, 10.0); context.getUniformState().setProjection(perspective); var fs = - "void main() { " + - " float z = agi_projection[3][2] / agi_projection[2][2];" + - " float x = z / agi_projection[0][0];" + - " float y = z / agi_projection[1][1];" + - " vec4 pointEC = vec4(x, y, z, 1.0);" + - " vec2 fragCoord = vec2(0.0, 0.0);" + - " vec4 actual = agi_eyeToWindowCoordinates(pointEC);" + - " vec2 diff = actual.xy - fragCoord;" + - " gl_FragColor = vec4(all(lessThan(diff, vec2(agi_epsilon6))));" + - "}"; + 'void main() { ' + + ' float z = agi_projection[3][2] / agi_projection[2][2];' + + ' float x = z / agi_projection[0][0];' + + ' float y = z / agi_projection[1][1];' + + ' vec4 pointEC = vec4(x, y, z, 1.0);' + + ' vec2 fragCoord = vec2(0.0, 0.0);' + + ' vec4 actual = agi_eyeToWindowCoordinates(pointEC);' + + ' vec2 diff = actual.xy - fragCoord;' + + ' gl_FragColor = vec4(all(lessThan(diff, vec2(agi_epsilon6))));' + + '}'; verifyDraw(fs); }); - it("has agi_windowToEyeCoordinates", function() { + it('has agi_windowToEyeCoordinates', function() { var vp = context.getViewport(); var perspective = Matrix4.createPerspectiveFieldOfView(CesiumMath.toRadians(60.0), vp.width / vp.height, 1.0, 10.0); context.getUniformState().setProjection(perspective); var fs = - "void main() { " + - " float z = agi_projection[3][2] / agi_projection[2][2];" + - " float x = z / agi_projection[0][0];" + - " float y = z / agi_projection[1][1];" + - " vec3 pointEC = vec3(x, y, z);" + - " vec4 fragCoord = vec4(0.0, 0.0, 0.0, -z);" + - " vec4 actual = agi_windowToEyeCoordinates(fragCoord);" + - " vec3 diff = actual.xyz - pointEC;" + - " gl_FragColor = vec4(all(lessThan(diff, vec3(agi_epsilon6))));" + - "}"; + 'void main() { ' + + ' float z = agi_projection[3][2] / agi_projection[2][2];' + + ' float x = z / agi_projection[0][0];' + + ' float y = z / agi_projection[1][1];' + + ' vec3 pointEC = vec3(x, y, z);' + + ' vec4 fragCoord = vec4(0.0, 0.0, 0.0, -z);' + + ' vec4 actual = agi_windowToEyeCoordinates(fragCoord);' + + ' vec3 diff = actual.xyz - pointEC;' + + ' gl_FragColor = vec4(all(lessThan(diff, vec3(agi_epsilon6))));' + + '}'; verifyDraw(fs); }); diff --git a/Specs/Renderer/ClearSpec.js b/Specs/Renderer/ClearSpec.js index 661972417cc..2a2c95a650a 100644 --- a/Specs/Renderer/ClearSpec.js +++ b/Specs/Renderer/ClearSpec.js @@ -2,7 +2,7 @@ defineSuite([ '../Specs/createContext', '../Specs/destroyContext' - ], "Renderer/Clear", function( + ], 'Renderer/Clear', function( createContext, destroyContext) { "use strict"; @@ -18,12 +18,12 @@ defineSuite([ destroyContext(context); }); - it("clear0", function() { + it('clear0', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("clear1", function() { + it('clear1', function() { context.clear(context.createClearState({ color : { red : 1.0, @@ -35,7 +35,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("clear2", function() { + it('clear2', function() { context.clear(context.createClearState({ color : { red : 1.0, @@ -53,7 +53,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 255, 0]); }); - it("clear3", function() { + it('clear3', function() { context.clear(context.createClearState({ color : { red : 1.0, @@ -103,7 +103,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("clears a framebuffer color attachment", function() { + it('clears a framebuffer color attachment', function() { var colorTexture = context.createTexture2D({ width : 1, height : 1 @@ -129,7 +129,7 @@ defineSuite([ framebuffer = framebuffer.destroy(); }); - it("clears with dithering", function() { + it('clears with dithering', function() { context.clear(context.createClearState({ color : { red : 1.0, @@ -153,7 +153,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("fails to read pixels (width)", function() { + it('fails to read pixels (width)', function() { expect(function() { expect(context.readPixels({ width : -1 @@ -161,7 +161,7 @@ defineSuite([ }).toThrow(); }); - it("fails to read pixels (height)", function() { + it('fails to read pixels (height)', function() { expect(function() { expect(context.readPixels({ height : -1 diff --git a/Specs/Renderer/ClearStateSpec.js b/Specs/Renderer/ClearStateSpec.js index 8020bed6c75..ee88c1ac3c0 100644 --- a/Specs/Renderer/ClearStateSpec.js +++ b/Specs/Renderer/ClearStateSpec.js @@ -2,7 +2,7 @@ defineSuite([ '../Specs/createContext', '../Specs/destroyContext' - ], "Renderer/ClearState", function( + ], 'Renderer/ClearState', function( createContext, destroyContext) { "use strict"; @@ -18,7 +18,7 @@ defineSuite([ destroyContext(context); }); - it("creates with defaults", function() { + it('creates with defaults', function() { var defaultCS = { scissorTest : { enabled : false, @@ -74,7 +74,7 @@ defineSuite([ expect(cs.stencil).toEqual(defaultCS.stencil); }); - it("creates with all clear states", function() { + it('creates with all clear states', function() { var c = { scissorTest : { enabled : true, @@ -130,7 +130,7 @@ defineSuite([ expect(cs.stencil).toEqual(c.stencil); }); - it("creates with some clear states", function() { + it('creates with some clear states', function() { var c = { scissorTest : { enabled : true @@ -162,7 +162,7 @@ defineSuite([ expect(cs.stencil).toEqual(defaultCS.stencil); }); - it("fails to create (negative scissorTest.rectangle.width)", function() { + it('fails to create (negative scissorTest.rectangle.width)', function() { expect(function() { context.createClearState({ scissorTest : { @@ -177,7 +177,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (negative scissorTest.rectangle.height)", function() { + it('fails to create (negative scissorTest.rectangle.height)', function() { expect(function() { context.createClearState({ scissorTest : { diff --git a/Specs/Renderer/ConstructiveSolidGeometrySpec.js b/Specs/Renderer/ConstructiveSolidGeometrySpec.js index 9abca286748..bb750d6c347 100644 --- a/Specs/Renderer/ConstructiveSolidGeometrySpec.js +++ b/Specs/Renderer/ConstructiveSolidGeometrySpec.js @@ -5,7 +5,7 @@ defineSuite([ '../Specs/renderFragment', 'Shaders/Ray', 'Shaders/ConstructiveSolidGeometry' - ], "Renderer/ConstructiveSolidGeometry", function( + ], 'Renderer/ConstructiveSolidGeometry', function( createContext, destroyContext, renderFragment, @@ -27,11 +27,11 @@ defineSuite([ renderFragment = (function(renderFragment) { return function(context, fs) { var fsSource = - "#line 0\n" + + '#line 0\n' + ShadersRay + - "#line 0\n" + + '#line 0\n' + ShadersConstructiveSolidGeometry + - "#line 0\n" + + '#line 0\n' + fs; return renderFragment(context, fsSource); }; @@ -39,606 +39,606 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("agi_quadraticRealPolynomialRealRoots: negative b", function() { + it('agi_quadraticRealPolynomialRealRoots: negative b', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -4.0, -6.0);" + // 2(x+1)(x-3) - " gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -1.0) && (r.root1 == 3.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -4.0, -6.0);' + // 2(x+1)(x-3) + ' gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -1.0) && (r.root1 == 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: positive b", function() { + it('agi_quadraticRealPolynomialRealRoots: positive b', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, 4.0, -6.0);" + // 2(x+1)(x-3) - " gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -3.0) && (r.root1 == 1.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, 4.0, -6.0);' + // 2(x+1)(x-3) + ' gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -3.0) && (r.root1 == 1.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: marginally negative radical case", function() { + it('agi_quadraticRealPolynomialRealRoots: marginally negative radical case', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -3.999999999999999, 2.0);" + // 2(x-1)(x-1) - " gl_FragColor = vec4((r.numberOfRoots == 2) && agi_equalsEpsilon(r.root0, 1.0) && agi_equalsEpsilon(r.root1, 1.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -3.999999999999999, 2.0);' + // 2(x-1)(x-1) + ' gl_FragColor = vec4((r.numberOfRoots == 2) && agi_equalsEpsilon(r.root0, 1.0) && agi_equalsEpsilon(r.root1, 1.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: complex roots", function() { + it('agi_quadraticRealPolynomialRealRoots: complex roots', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -4.0, 6.0);" + // f(x) = 2x^2 - 4x + 6 - " gl_FragColor = vec4(r.numberOfRoots == 0); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -4.0, 6.0);' + // f(x) = 2x^2 - 4x + 6 + ' gl_FragColor = vec4(r.numberOfRoots == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: intractable", function() { + it('agi_quadraticRealPolynomialRealRoots: intractable', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(0.0, 0.0, -3.0);" + // f(x) = -3 - " gl_FragColor = vec4(r.numberOfRoots == 0); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(0.0, 0.0, -3.0);' + // f(x) = -3 + ' gl_FragColor = vec4(r.numberOfRoots == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: linear", function() { + it('agi_quadraticRealPolynomialRealRoots: linear', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(0.0, 2.0, 8.0);" + // f(x) = 2x + 8 - " gl_FragColor = vec4((r.numberOfRoots == 1) && (r.root0 == -4.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(0.0, 2.0, 8.0);' + // f(x) = 2x + 8 + ' gl_FragColor = vec4((r.numberOfRoots == 1) && (r.root0 == -4.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: 2nd order monomial", function() { + it('agi_quadraticRealPolynomialRealRoots: 2nd order monomial', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(3.0, 0.0, 0.0);" + // f(x) = 3x^2 - " gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == 0.0) && (r.root1 == 0.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(3.0, 0.0, 0.0);' + // f(x) = 3x^2 + ' gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == 0.0) && (r.root1 == 0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: parabolic complex roots", function() { + it('agi_quadraticRealPolynomialRealRoots: parabolic complex roots', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(3.0, 0.0, 18.0);" + // f(x) = 2x^2 + 18 - " gl_FragColor = vec4(r.numberOfRoots == 0); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(3.0, 0.0, 18.0);' + // f(x) = 2x^2 + 18 + ' gl_FragColor = vec4(r.numberOfRoots == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: parabolic real roots", function() { + it('agi_quadraticRealPolynomialRealRoots: parabolic real roots', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, 0.0, -18.0);" + // f(x) = 2x^2 - 18 - " gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -3.0) && (r.root1 == 3.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, 0.0, -18.0);' + // f(x) = 2x^2 - 18 + ' gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -3.0) && (r.root1 == 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: zero and negative root", function() { + it('agi_quadraticRealPolynomialRealRoots: zero and negative root', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, 6.0, 0.0);" + // f(x) = 2x^2 + 6x - " gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -3.0) && (r.root1 == 0.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, 6.0, 0.0);' + // f(x) = 2x^2 + 6x + ' gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == -3.0) && (r.root1 == 0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_quadraticRealPolynomialRealRoots: zero and positive root", function() { + it('agi_quadraticRealPolynomialRealRoots: zero and positive root', function() { var fs = - "void main() { " + - " agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -6.0, 0.0);" + // f(x) = 2x^2 - 6x - " gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == 0.0) && (r.root1 == 3.0)); " + - "}"; + 'void main() { ' + + ' agi_quadraticRoots r = agi_quadraticRealPolynomialRealRoots(2.0, -6.0, 0.0);' + // f(x) = 2x^2 - 6x + ' gl_FragColor = vec4((r.numberOfRoots == 2) && (r.root0 == 0.0) && (r.root1 == 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_raySphereIntersectionInterval: fails to intersect (1)", function() { + it('agi_raySphereIntersectionInterval: fails to intersect (1)', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(0.0), vec3(-1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(-1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: fails to intersect (2)", function() { + it('agi_raySphereIntersectionInterval: fails to intersect (2)', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(0.0, 2.0, 0.0), vec3(1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(0.0, 2.0, 0.0), vec3(1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: fails to intersect (3)", function() { + it('agi_raySphereIntersectionInterval: fails to intersect (3)', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(0.0), normalize(vec3(1.0, 2.0, 0.0)));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(0.0), normalize(vec3(1.0, 2.0, 0.0)));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: fails to intersect (4)", function() { + it('agi_raySphereIntersectionInterval: fails to intersect (4)', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(0.0), vec3(-1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 0.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(-1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 0.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: outside ray intersects", function() { + it('agi_raySphereIntersectionInterval: outside ray intersects', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(i == agi_raySegment(1.0, 3.0)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(i == agi_raySegment(1.0, 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: outside ray intersects at tangent", function() { + it('agi_raySphereIntersectionInterval: outside ray intersects at tangent', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(0.0, 1.0, 0.0), vec3(1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(i == agi_raySegment(2.0, 2.0)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(0.0, 1.0, 0.0), vec3(1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(i == agi_raySegment(2.0, 2.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: inside ray intersects 0", function() { + it('agi_raySphereIntersectionInterval: inside ray intersects 0', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(2.0, 0.0, 0.0), vec3(1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(i == agi_raySegment(0.0, 1.0)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(2.0, 0.0, 0.0), vec3(1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(i == agi_raySegment(0.0, 1.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_raySphereIntersectionInterval: inside ray intersects 1", function() { + it('agi_raySphereIntersectionInterval: inside ray intersects 1', function() { var fs = - "void main() { " + - " agi_ray ray = agi_ray(vec3(2.0, 0.0, 0.0), vec3(-1.0, 0.0, 0.0));" + - " agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); " + - " agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);" + - " gl_FragColor = vec4(i == agi_raySegment(0.0, 1.0)); " + - "}"; + 'void main() { ' + + ' agi_ray ray = agi_ray(vec3(2.0, 0.0, 0.0), vec3(-1.0, 0.0, 0.0));' + + ' agi_sphere sphere = agi_sphere(vec3(2.0, 0.0, 0.0), 1.0); ' + + ' agi_raySegment i = agi_raySphereIntersectionInterval(ray, sphere);' + + ' gl_FragColor = vec4(i == agi_raySegment(0.0, 1.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_sphereNormal: 0", function() { + it('agi_sphereNormal: 0', function() { var fs = - "void main() { " + - " vec3 normal = agi_sphereNormal(agi_sphere(vec3(0.0), 1.0), vec3(1.0, 0.0, 0.0));" + - " gl_FragColor = vec4(normal == vec3(1.0, 0.0, 0.0)); " + - "}"; + 'void main() { ' + + ' vec3 normal = agi_sphereNormal(agi_sphere(vec3(0.0), 1.0), vec3(1.0, 0.0, 0.0));' + + ' gl_FragColor = vec4(normal == vec3(1.0, 0.0, 0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_sphereNormal: 1", function() { + it('agi_sphereNormal: 1', function() { var fs = - "void main() { " + - " vec3 normal = agi_sphereNormal(agi_sphere(vec3(0.0, 1.0, 0.0), 1.0), vec3(0.0, 2.0, 0.0));" + - " gl_FragColor = vec4(normal == vec3(0.0, 1.0, 0.0)); " + - "}"; + 'void main() { ' + + ' vec3 normal = agi_sphereNormal(agi_sphere(vec3(0.0, 1.0, 0.0), 1.0), vec3(0.0, 2.0, 0.0));' + + ' gl_FragColor = vec4(normal == vec3(0.0, 1.0, 0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_ellipsoidContainsPoint: doesn't contain point 0", function() { + it('agi_ellipsoidContainsPoint: does not contain point 0', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(4.0, 0.0, 0.0);" + - " gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(4.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: doesn't contain point 1", function() { + it('agi_ellipsoidContainsPoint: does not contain point 1', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(-4.0, 0.0, 0.0);" + - " gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(-4.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: doesn't contain point 2", function() { + it('agi_ellipsoidContainsPoint: does not contain point 2', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(0.0, 0.0, 2.0);" + - " gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(0.0, 0.0, 2.0);' + + ' gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: doesn't contain point 3", function() { - var fs = "void main() {" + "agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - "vec3 point = vec3(0.0, 0.0, -2.0);" + "gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); }"; + it('agi_ellipsoidContainsPoint: does not contain point 3', function() { + var fs = 'void main() {' + 'agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + 'vec3 point = vec3(0.0, 0.0, -2.0);' + 'gl_FragColor = vec4(!agi_ellipsoidContainsPoint(ellipsoid, point)); }'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: contains point 0", function() { + it('agi_ellipsoidContainsPoint: contains point 0', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(2.0, 0.0, 0.0);" + - " gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(2.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: contains point 1", function() { + it('agi_ellipsoidContainsPoint: contains point 1', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(-2.0, 0.0, 0.0);" + - " gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(-2.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: contains point 2", function() { + it('agi_ellipsoidContainsPoint: contains point 2', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(0.0, 1.0, 0.0);" + - " gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(0.0, 1.0, 0.0);' + + ' gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_ellipsoidContainsPoint: contains point 3", function() { + it('agi_ellipsoidContainsPoint: contains point 3', function() { var fs = - "void main() {" + - " agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));" + // center, radii - " vec3 point = vec3(0.0, -1.0, 0.0);" + - " gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); " + - "}"; + 'void main() {' + + ' agi_ellipsoid ellipsoid = agi_ellipsoidNew(vec3(0.0), vec3(3.0, 2.0, 1.0));' + // center, radii + ' vec3 point = vec3(0.0, -1.0, 0.0);' + + ' gl_FragColor = vec4(agi_ellipsoidContainsPoint(ellipsoid, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_coneContainsPoint: doesn't contain point 0", function() { + it('agi_coneContainsPoint: does not contain point 0', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(1.0, 0.0, 0.0);" + - " gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(1.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_coneContainsPoint: doesn't contain point 1", function() { + it('agi_coneContainsPoint: does not contain point 1', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(-1.0, 0.0, 0.0);" + - " gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(-1.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_coneContainsPoint: doesn't contain point 2", function() { + it('agi_coneContainsPoint: does not contain point 2', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(0.0, 0.0, -1.0);" + - " gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(0.0, 0.0, -1.0);' + + ' gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_coneContainsPoint: doesn't contain point 2", function() { + it('agi_coneContainsPoint: does not contain point 2', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(120.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(0.0, 0.0, -1.0);" + - " gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(120.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(0.0, 0.0, -1.0);' + + ' gl_FragColor = vec4(!agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_coneContainsPoint: contains point 0", function() { + it('agi_coneContainsPoint: contains point 0', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 2.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(0.0, 0.0, 3.0);" + - " gl_FragColor = vec4(agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 2.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(0.0, 0.0, 3.0);' + + ' gl_FragColor = vec4(agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_coneContainsPoint: contains point 1", function() { + it('agi_coneContainsPoint: contains point 1', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(1.0, 0.0, 2.0);" + - " gl_FragColor = vec4(agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(1.0, 0.0, 2.0);' + + ' gl_FragColor = vec4(agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_coneContainsPoint: contains point 2", function() { + it('agi_coneContainsPoint: contains point 2', function() { var fs = - "void main() {" + - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(120.0));" + // vertex, axis, halfAperture - " vec3 point = vec3(1.0, 0.0, 0.0);" + - " gl_FragColor = vec4(agi_coneContainsPoint(cone, point)); " + - "}"; + 'void main() {' + + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(120.0));' + // vertex, axis, halfAperture + ' vec3 point = vec3(1.0, 0.0, 0.0);' + + ' gl_FragColor = vec4(agi_coneContainsPoint(cone, point)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_rayConeIntersectionInterval: half aperture of 0.0", function() { + it('agi_rayConeIntersectionInterval: half aperture of 0.0', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0, 0.0, -1.0), vec3(0.0, 0.0, -1.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(0.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4(result.count == 0); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0, 0.0, -1.0), vec3(0.0, 0.0, -1.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(0.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4(result.count == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); // Fails on AMD with or without ANGLE - xit("agi_rayConeIntersectionInterval: half aperture of 90.0", function() { + xit('agi_rayConeIntersectionInterval: half aperture of 90.0', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(0.0, 0.0, 1.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(90.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) " + - " && agi_equalsEpsilon(1.0, result.intervals[0].start, agi_epsilon6) " + - " && (result.intervals[0].stop == agi_infinity)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(0.0, 0.0, 1.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(90.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) ' + + ' && agi_equalsEpsilon(1.0, result.intervals[0].start, agi_epsilon6) ' + + ' && (result.intervals[0].stop == agi_infinity)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: half aperture of 180.0", function() { + it('agi_rayConeIntersectionInterval: half aperture of 180.0', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0, 0.0, -1.0), vec3(0.0, 0.0, -1.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(180.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) " + - " && agi_equalsEpsilon(0.0, result.intervals[0].start) " + - " && (result.intervals[0].stop == agi_infinity)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0, 0.0, -1.0), vec3(0.0, 0.0, -1.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(180.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) ' + + ' && agi_equalsEpsilon(0.0, result.intervals[0].start) ' + + ' && (result.intervals[0].stop == agi_infinity)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: ray misses cone 0", function() { + it('agi_rayConeIntersectionInterval: ray misses cone 0', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0, 0.0, -1.0), vec3(0.0, 0.0, -1.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4(result.count == 0); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0, 0.0, -1.0), vec3(0.0, 0.0, -1.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4(result.count == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: ray misses cone 1", function() { + it('agi_rayConeIntersectionInterval: ray misses cone 1', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), radians(45.0) );" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4(result.count == 0); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), radians(45.0) );' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4(result.count == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: outside ray intersects 0 - on cone's surface", function() { + it('agi_rayConeIntersectionInterval: outside ray intersects 0 - on cone surface', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(4.0, 1.0, 2.0), normalize(vec3(-1.0, 0.0, 1.0)));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(1.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4(" + - " (result.count == 1) && " + - " agi_equalsEpsilon(cos(cone.halfAperture), dot(normalize(agi_pointAlongRay(ray, result.intervals[0].start) - cone.vertex), cone.axis))); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(4.0, 1.0, 2.0), normalize(vec3(-1.0, 0.0, 1.0)));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(1.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4(' + + ' (result.count == 1) && ' + + ' agi_equalsEpsilon(cos(cone.halfAperture), dot(normalize(agi_pointAlongRay(ray, result.intervals[0].start) - cone.vertex), cone.axis))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: outside ray intersects 0 - normal is perpendicular to cone's surface", function() { + it('agi_rayConeIntersectionInterval: outside ray intersects 0 - normal is perpendicular to cone surface', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(4.0, 1.0, 2.0), normalize(vec3(-1.0, 0.0, 1.0)));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(1.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4(" + - " (result.count == 1) && " + - " agi_equalsEpsilon(dot(agi_coneNormal(cone, agi_pointAlongRay(ray, result.intervals[0].start)), agi_pointAlongRay(ray, result.intervals[0].start) - cone.vertex), 0.0, agi_epsilon6)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(4.0, 1.0, 2.0), normalize(vec3(-1.0, 0.0, 1.0)));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(1.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4(' + + ' (result.count == 1) && ' + + ' agi_equalsEpsilon(dot(agi_coneNormal(cone, agi_pointAlongRay(ray, result.intervals[0].start)), agi_pointAlongRay(ray, result.intervals[0].start) - cone.vertex), 0.0, agi_epsilon6)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: outside ray intersects 1", function() { + it('agi_rayConeIntersectionInterval: outside ray intersects 1', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) && agi_equalsEpsilon(1.0, result.intervals[0].start)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) && agi_equalsEpsilon(1.0, result.intervals[0].start)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: outside ray intersects 2", function() { + it('agi_rayConeIntersectionInterval: outside ray intersects 2', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(2.0, 1.0, 0.0), vec3(0.0, -1.0, 0.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) && agi_equalsEpsilon(result.intervals[0].start, 1.0, agi_epsilon6) && agi_equalsEpsilon(result.intervals[0].stop, 3.0, agi_epsilon6)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(2.0, 1.0, 0.0), vec3(0.0, -1.0, 0.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) && agi_equalsEpsilon(result.intervals[0].start, 1.0, agi_epsilon6) && agi_equalsEpsilon(result.intervals[0].stop, 3.0, agi_epsilon6)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: outside ray intersects at vertex", function() { + it('agi_rayConeIntersectionInterval: outside ray intersects at vertex', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(-1.0, 0.0, 0.0), vec3(1.0, 0.0, 0.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) && (result.intervals[0] == agi_raySegment(1.0, 1.0))); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(-1.0, 0.0, 0.0), vec3(1.0, 0.0, 0.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0), vec3(0.0, 0.0, 1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) && (result.intervals[0] == agi_raySegment(1.0, 1.0))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: inside ray intersects at vertex", function() { + it('agi_rayConeIntersectionInterval: inside ray intersects at vertex', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) && (result.intervals[0] == agi_raySegment(0.0, 1.0))); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) && (result.intervals[0] == agi_raySegment(0.0, 1.0))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayConeIntersectionInterval: inside ray intersects 1", function() { + it('agi_rayConeIntersectionInterval: inside ray intersects 1', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));" + // origin, direction - " agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0), radians(45.0));" + // vertex, axis, halfAperture - " agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);" + - " gl_FragColor = vec4((result.count == 1) && agi_equalsEpsilon(result.intervals[0].start, 0.0, agi_epsilon6) && agi_equalsEpsilon(result.intervals[0].stop, 1.0, agi_epsilon6)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));' + // origin, direction + ' agi_cone cone = agi_coneNew(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, -1.0), radians(45.0));' + // vertex, axis, halfAperture + ' agi_raySegmentCollection result = agi_rayConeIntersectionInterval(ray, cone);' + + ' gl_FragColor = vec4((result.count == 1) && agi_equalsEpsilon(result.intervals[0].start, 0.0, agi_epsilon6) && agi_equalsEpsilon(result.intervals[0].stop, 1.0, agi_epsilon6)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_rayHalfspaceIntersectionInterval: ray origin outside and directed away", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin outside and directed away', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0, 0.0, 1.0), vec3(0.0, 0.0, 1.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin outside and directed parallel", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin outside and directed parallel', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin outside and directed inward", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin outside and directed inward', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(1.0, 1.0, 1.0), vec3(0.0, 0.0, -1.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_equalsEpsilon(i.start, 1.0) && agi_equalsEpsilon(i.stop, agi_infinity)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(1.0, 1.0, 1.0), vec3(0.0, 0.0, -1.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_equalsEpsilon(i.start, 1.0) && agi_equalsEpsilon(i.stop, agi_infinity)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin on surface and directed away", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin on surface and directed away', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin on surface and directed parallel", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin on surface and directed parallel', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_isEmpty(i)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_isEmpty(i)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin on surface and directed inward", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin on surface and directed inward', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(1.0, 1.0, 0.0), vec3(0.0, 0.0, -1.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, agi_infinity)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(1.0, 1.0, 0.0), vec3(0.0, 0.0, -1.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, agi_infinity)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin inside and directed outward", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin inside and directed outward', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(0.0, 0.0, 1.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, 1.0)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(0.0, 0.0, 1.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, 1.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin inside and directed parallel", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin inside and directed parallel', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(1.0, 0.0, 0.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, agi_infinity)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(1.0, 0.0, 0.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, agi_infinity)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_rayHalfspaceIntersectionInterval: ray origin inside and directed inward", function() { + it('agi_rayHalfspaceIntersectionInterval: ray origin inside and directed inward', function() { var fs = - "void main() {" + - " agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(0.0, 0.0, -1.0));" + // origin, direction - " agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));" + // center, normal - " agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);" + - " gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, agi_infinity)); " + - "}"; + 'void main() {' + + ' agi_ray ray = agi_ray(vec3(1.0, 1.0, -1.0), vec3(0.0, 0.0, -1.0));' + // origin, direction + ' agi_halfspace halfspace = agi_halfspace(vec3(0.0), vec3(0.0, 0.0, 1.0));' + // center, normal + ' agi_raySegment i = agi_rayHalfspaceIntersectionInterval(ray, halfspace);' + + ' gl_FragColor = vec4(agi_equalsEpsilon(i.start, 0.0) && agi_equalsEpsilon(i.stop, agi_infinity)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); }); \ No newline at end of file diff --git a/Specs/Renderer/ContextSpec.js b/Specs/Renderer/ContextSpec.js index fdf805d9ad1..1d94b4d741d 100644 --- a/Specs/Renderer/ContextSpec.js +++ b/Specs/Renderer/ContextSpec.js @@ -22,11 +22,11 @@ defineSuite([ context = !context.isDestroyed() && destroyContext(context); }); - it("getCanvas", function() { + it('getCanvas', function() { expect(context.getCanvas()).not.toBeNull(); }); - it("gets and sets its viewport", function() { + it('gets and sets its viewport', function() { var canvas = context.getCanvas(); var viewport = context.getViewport(); expect(viewport.x).toEqual(0); @@ -48,123 +48,123 @@ defineSuite([ expect(v.height).toEqual(4); }); - it("getVersion", function() { - expect(context.getVersion()).toMatch("WebGL"); + it('getVersion', function() { + expect(context.getVersion()).toMatch('WebGL'); }); - it("getShadingLanguageVersion", function() { - expect(context.getShadingLanguageVersion()).toMatch("WebGL GLSL ES"); + it('getShadingLanguageVersion', function() { + expect(context.getShadingLanguageVersion()).toMatch('WebGL GLSL ES'); }); - it("getVendor", function() { + it('getVendor', function() { expect(context.getVendor()).not.toBeNull(); }); - it("getRenderer", function() { + it('getRenderer', function() { expect(context.getRenderer()).not.toBeNull(); }); - it("getRedBits", function() { + it('getRedBits', function() { expect(context.getRedBits()).toEqual(8); }); - it("getGreenBits", function() { + it('getGreenBits', function() { expect(context.getGreenBits()).toEqual(8); }); - it("getBlueBits", function() { + it('getBlueBits', function() { expect(context.getBlueBits()).toEqual(8); }); - it("getAlphaBits", function() { + it('getAlphaBits', function() { expect(context.getAlphaBits()).toEqual(8); }); - it("getDepthBits", function() { + it('getDepthBits', function() { expect(context.getDepthBits()).toBeGreaterThanOrEqualTo(16); }); - it("getStencilBits", function() { + it('getStencilBits', function() { expect(context.getStencilBits()).toBeGreaterThanOrEqualTo(0); }); - it("getMaximumCombinedTextureImageUnits", function() { + it('getMaximumCombinedTextureImageUnits', function() { expect(context.getMaximumCombinedTextureImageUnits()).toBeGreaterThanOrEqualTo(8); }); - it("getMaximumCubeMapSize", function() { + it('getMaximumCubeMapSize', function() { expect(context.getMaximumCubeMapSize()).toBeGreaterThanOrEqualTo(16); }); - it("getMaximumFragmentUniformVectors", function() { + it('getMaximumFragmentUniformVectors', function() { expect(context.getMaximumFragmentUniformVectors()).toBeGreaterThanOrEqualTo(16); }); - it("getMaximumTextureImageUnits", function() { + it('getMaximumTextureImageUnits', function() { expect(context.getMaximumTextureImageUnits()).toBeGreaterThanOrEqualTo(8); }); - it("getMaximumRenderbufferSize", function() { + it('getMaximumRenderbufferSize', function() { expect(context.getMaximumRenderbufferSize()).toBeGreaterThanOrEqualTo(1); }); - it("getMaximumTextureSize", function() { + it('getMaximumTextureSize', function() { expect(context.getMaximumTextureSize()).toBeGreaterThanOrEqualTo(64); }); - it("getMaximumVaryingVectors", function() { + it('getMaximumVaryingVectors', function() { expect(context.getMaximumVaryingVectors()).toBeGreaterThanOrEqualTo(8); }); - it("getMaximumVertexAttributes", function() { + it('getMaximumVertexAttributes', function() { expect(context.getMaximumVertexAttributes()).toBeGreaterThanOrEqualTo(8); }); - it("getMaximumVertexTextureImageUnits", function() { + it('getMaximumVertexTextureImageUnits', function() { expect(context.getMaximumVertexTextureImageUnits()).toBeGreaterThanOrEqualTo(0); }); - it("getMaximumVertexUniformVectors", function() { + it('getMaximumVertexUniformVectors', function() { expect(context.getMaximumVertexUniformVectors()).toBeGreaterThanOrEqualTo(1); }); - it("getMinimumAliasedLineWidth", function() { + it('getMinimumAliasedLineWidth', function() { expect(context.getMinimumAliasedLineWidth()).toBeLessThanOrEqualTo(1); }); - it("getMaximumAliasedLineWidth", function() { + it('getMaximumAliasedLineWidth', function() { expect(context.getMaximumAliasedLineWidth()).toBeGreaterThanOrEqualTo(1); }); - it("getMinimumAliasedPointSize", function() { + it('getMinimumAliasedPointSize', function() { expect(context.getMinimumAliasedPointSize()).toBeLessThanOrEqualTo(1); }); - it("getMaximumAliasedPointSize", function() { + it('getMaximumAliasedPointSize', function() { expect(context.getMaximumAliasedPointSize()).toBeGreaterThanOrEqualTo(1); }); - it("getMaximumViewportWidth", function() { + it('getMaximumViewportWidth', function() { expect(context.getMaximumViewportWidth()).toBeGreaterThan(0); }); - it("getMaximumViewportHeight", function() { + it('getMaximumViewportHeight', function() { expect(context.getMaximumViewportHeight()).toBeGreaterThan(0); }); - it("gets the standard derivatives extension", function() { + it('gets the standard derivatives extension', function() { var fs = - "#ifdef GL_OES_standard_derivatives\n" + - " #extension GL_OES_standard_derivatives : enable\n" + - "#endif\n" + - "void main()\n" + - "{\n" + - "#ifdef GL_OES_standard_derivatives\n" + - " gl_FragColor = vec4(dFdx(1.0), dFdy(1.0), 1.0, 1.0);\n" + - "#else\n" + - " gl_FragColor = vec4(1.0);\n" + - "#endif\n" + - "}"; + '#ifdef GL_OES_standard_derivatives\n' + + ' #extension GL_OES_standard_derivatives : enable\n' + + '#endif\n' + + 'void main()\n' + + '{\n' + + '#ifdef GL_OES_standard_derivatives\n' + + ' gl_FragColor = vec4(dFdx(1.0), dFdy(1.0), 1.0, 1.0);\n' + + '#else\n' + + ' gl_FragColor = vec4(1.0);\n' + + '#endif\n' + + '}'; var pixel = renderFragment(context, fs); @@ -175,11 +175,11 @@ defineSuite([ } }); - it("gets texture filter anisotropic", function() { + it('gets texture filter anisotropic', function() { expect(context.getTextureFilterAnisotropic()).toBeDefined(); }); - it("gets maximum texture filter anisotropy", function() { + it('gets maximum texture filter anisotropy', function() { if(context.getTextureFilterAnisotropic()) { expect(context.getMaximumTextureFilterAnisotropy() >= 2.0).toEqual(true); } else { @@ -187,7 +187,7 @@ defineSuite([ } }); - it("sets shader program validation", function() { + it('sets shader program validation', function() { context.setValidateShaderProgram(false); expect(context.getValidateShaderProgram()).toEqual(false); @@ -195,7 +195,7 @@ defineSuite([ expect(context.getValidateShaderProgram()).toEqual(true); }); - it("sets framebuffer validation", function() { + it('sets framebuffer validation', function() { context.setValidateFramebuffer(false); expect(context.getValidateFramebuffer()).toEqual(false); @@ -203,7 +203,7 @@ defineSuite([ expect(context.getValidateFramebuffer()).toEqual(true); }); - it("sets logging shader compilation", function() { + it('sets logging shader compilation', function() { context.setLogShaderCompilation(false); expect(context.getLogShaderCompilation()).toEqual(false); @@ -211,7 +211,7 @@ defineSuite([ expect(context.getLogShaderCompilation()).toEqual(true); }); - it("sets throws on WebGL errors", function() { + it('sets throws on WebGL errors', function() { context.setThrowOnWebGLError(false); expect(context.getThrowOnWebGLError()).toEqual(false); @@ -219,7 +219,7 @@ defineSuite([ expect(context.getThrowOnWebGLError()).toEqual(true); }); - it("fails to set the viewport (undefined viewport properties)", function() { + it('fails to set the viewport (undefined viewport properties)', function() { expect(function() { context.setViewport({ x : 0, @@ -228,7 +228,7 @@ defineSuite([ }).toThrow(); }); - it("fails to set the viewport (negative width)", function() { + it('fails to set the viewport (negative width)', function() { expect(function() { context.setViewport({ x : 0, @@ -239,7 +239,7 @@ defineSuite([ }).toThrow(); }); - it("fails to set the viewport (negative height)", function() { + it('fails to set the viewport (negative height)', function() { expect(function() { context.setViewport({ x : 0, @@ -250,7 +250,7 @@ defineSuite([ }).toThrow(); }); - it("fails to set the viewport (large width)", function() { + it('fails to set the viewport (large width)', function() { expect(function() { context.setViewport({ x : 0, @@ -261,7 +261,7 @@ defineSuite([ }).toThrow(); }); - it("fails to set the viewport (large height)", function() { + it('fails to set the viewport (large height)', function() { expect(function() { context.setViewport({ x : 0, @@ -272,19 +272,19 @@ defineSuite([ }).toThrow(); }); - it("fails to construct (null canvas)", function() { + it('fails to construct (null canvas)', function() { expect(function() { return new Context(); }).toThrow(); }); - it("continueDraw throws without arguments", function() { + it('continueDraw throws without arguments', function() { expect(function() { context.continueDraw(); }).toThrow(); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(context.isDestroyed()).toEqual(false); context.destroy(); expect(context.isDestroyed()).toEqual(true); diff --git a/Specs/Renderer/CubeMapSpec.js b/Specs/Renderer/CubeMapSpec.js index 43b960bb9dc..5754f7460d0 100644 --- a/Specs/Renderer/CubeMapSpec.js +++ b/Specs/Renderer/CubeMapSpec.js @@ -10,7 +10,7 @@ defineSuite([ 'Renderer/TextureWrap', 'Renderer/TextureMinificationFilter', 'Renderer/TextureMagnificationFilter' - ], "Renderer/CubeMap", function( + ], 'Renderer/CubeMap', function( createContext, destroyContext, Cartesian3, @@ -54,25 +54,25 @@ defineSuite([ destroyContext(context); }); - it("initializem suite", function() { + it('initializem suite', function() { greenImage = new Image(); - greenImage.src = "./Data/Images/Green.png"; + greenImage.src = './Data/Images/Green.png'; blueImage = new Image(); - blueImage.src = "./Data/Images/Blue.png"; + blueImage.src = './Data/Images/Blue.png'; blueAlphaImage = new Image(); - blueAlphaImage.src = "./Data/Images/BlueAlpha.png"; + blueAlphaImage.src = './Data/Images/BlueAlpha.png'; blueOverRedImage = new Image(); - blueOverRedImage.src = "./Data/Images/BlueOverRed.png"; + blueOverRedImage.src = './Data/Images/BlueOverRed.png'; waitsFor(function() { return greenImage.complete && blueImage.complete && blueAlphaImage.complete && blueOverRedImage.complete; - }, "Load .png file(s) for texture test.", 3000); + }, 'Load .png file(s) for texture test.', 3000); }); - it("creates with defaults", function() { + it('creates with defaults', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -85,7 +85,7 @@ defineSuite([ // TODO: creates from the framebuffer // TODO: copies from the framebuffer - it("gets the default sampler", function() { + it('gets the default sampler', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -98,7 +98,7 @@ defineSuite([ expect(sampler.magnificationFilter).toEqual(TextureMagnificationFilter.LINEAR); }); - it("sets a sampler", function() { + it('sets a sampler', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -119,7 +119,7 @@ defineSuite([ expect(s.magnificationFilter).toEqual(sampler.magnificationFilter); }); - it("gets width and height", function() { + it('gets width and height', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -129,7 +129,7 @@ defineSuite([ expect(cubeMap.getHeight()).toEqual(16); }); - it("draws with a cube map", function() { + it('draws with a cube map', function() { cubeMap = context.createCubeMap({ source : { positiveX : blueImage, @@ -141,11 +141,11 @@ defineSuite([ } }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_texture;" + - "uniform mediump vec3 u_direction;" + - "void main() { gl_FragColor = textureCube(u_texture, u_direction); }"; + 'uniform samplerCube u_texture;' + + 'uniform mediump vec3 u_direction;' + + 'void main() { gl_FragColor = textureCube(u_texture, u_direction); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -194,7 +194,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("draws with a cube map with premultiplied alpha", function() { + it('draws with a cube map with premultiplied alpha', function() { cubeMap = context.createCubeMap({ source : { positiveX : blueAlphaImage, @@ -208,11 +208,11 @@ defineSuite([ }); expect(cubeMap.getPreMultiplyAlpha()).toEqual(true); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_texture;" + - "uniform mediump vec3 u_direction;" + - "void main() { gl_FragColor = textureCube(u_texture, u_direction); }"; + 'uniform samplerCube u_texture;' + + 'uniform mediump vec3 u_direction;' + + 'void main() { gl_FragColor = textureCube(u_texture, u_direction); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -261,7 +261,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 127, 127]); }); - it("creates a cube map with typed arrays", function() { + it('creates a cube map with typed arrays', function() { cubeMap = context.createCubeMap({ source : { positiveX : { @@ -297,11 +297,11 @@ defineSuite([ } }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_texture;" + - "uniform mediump vec3 u_direction;" + - "void main() { gl_FragColor = textureCube(u_texture, u_direction); }"; + 'uniform samplerCube u_texture;' + + 'uniform mediump vec3 u_direction;' + + 'void main() { gl_FragColor = textureCube(u_texture, u_direction); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -344,7 +344,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 0, 0]); }); - it("creates a cube map with typed arrays and images", function() { + it('creates a cube map with typed arrays and images', function() { cubeMap = context.createCubeMap({ source : { positiveX : blueImage, @@ -372,11 +372,11 @@ defineSuite([ } }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_texture;" + - "uniform mediump vec3 u_direction;" + - "void main() { gl_FragColor = textureCube(u_texture, u_direction); }"; + 'uniform samplerCube u_texture;' + + 'uniform mediump vec3 u_direction;' + + 'void main() { gl_FragColor = textureCube(u_texture, u_direction); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -419,7 +419,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 0, 0]); }); - it("copies to a cube map", function() { + it('copies to a cube map', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -431,11 +431,11 @@ defineSuite([ cubeMap.getPositiveZ().copyFrom(blueImage); cubeMap.getNegativeZ().copyFrom(greenImage); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_cubeMap;" + - "uniform mediump vec3 u_direction;" + - "void main() { gl_FragColor = textureCube(u_cubeMap, u_direction); }"; + 'uniform samplerCube u_cubeMap;' + + 'uniform mediump vec3 u_direction;' + + 'void main() { gl_FragColor = textureCube(u_cubeMap, u_direction); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -484,7 +484,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("copies from a typed array", function() { + it('copies from a typed array', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -520,11 +520,11 @@ defineSuite([ arrayBufferView : new Uint8Array([255, 255, 0, 0]) }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_cubeMap;" + - "uniform mediump vec3 u_direction;" + - "void main() { gl_FragColor = textureCube(u_cubeMap, u_direction); }"; + 'uniform samplerCube u_cubeMap;' + + 'uniform mediump vec3 u_direction;' + + 'void main() { gl_FragColor = textureCube(u_cubeMap, u_direction); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -567,7 +567,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 0, 0]); }); - it("draws with a cube map and a texture", function() { + it('draws with a cube map and a texture', function() { cubeMap = context.createCubeMap({ source : { positiveX : greenImage, @@ -583,11 +583,11 @@ defineSuite([ source : blueImage }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_cubeMap;" + - "uniform sampler2D u_texture;" + - "void main() { gl_FragColor = textureCube(u_cubeMap, vec3(1.0, 0.0, 0.0)) + texture2D(u_texture, vec2(0.0)); }"; + 'uniform samplerCube u_cubeMap;' + + 'uniform sampler2D u_texture;' + + 'void main() { gl_FragColor = textureCube(u_cubeMap, vec3(1.0, 0.0, 0.0)) + texture2D(u_texture, vec2(0.0)); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -611,7 +611,7 @@ defineSuite([ }); // Fails on firefox. Should be fixed soon: https://bugzilla.mozilla.org/show_bug.cgi?id=685156 - xit("generates mipmaps", function() { + xit('generates mipmaps', function() { cubeMap = context.createCubeMap({ source : { positiveX : blueImage, @@ -628,10 +628,10 @@ defineSuite([ minificationFilter : TextureMinificationFilter.NEAREST_MIPMAP_LINEAR })); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform samplerCube u_cubeMap;" + - "void main() { gl_FragColor = textureCube(u_cubeMap, vec3(1.0, 0.0, 0.0)); }"; + 'uniform samplerCube u_cubeMap;' + + 'void main() { gl_FragColor = textureCube(u_cubeMap, vec3(1.0, 0.0, 0.0)); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -651,7 +651,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("destroys", function() { + it('destroys', function() { var c = context.createCubeMap({ width : 16, height : 16 @@ -662,19 +662,19 @@ defineSuite([ expect(c.isDestroyed()).toEqual(true); }); - it("fails to create (description)", function() { + it('fails to create (description)', function() { expect(function() { cubeMap = context.createCubeMap(); }).toThrow(); }); - it("fails to create (source)", function() { + it('fails to create (source)', function() { expect(function() { cubeMap = context.createCubeMap({}); }).toThrow(); }); - it("fails to create (width, no height)", function() { + it('fails to create (width, no height)', function() { expect(function() { cubeMap = context.createCubeMap({ width : 16 @@ -682,7 +682,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (width != height)", function() { + it('fails to create (width != height)', function() { expect(function() { cubeMap = context.createCubeMap({ width : 16, @@ -691,7 +691,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (small width)", function() { + it('fails to create (small width)', function() { expect(function() { cubeMap = context.createCubeMap({ width : 0, @@ -700,7 +700,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (large width)", function() { + it('fails to create (large width)', function() { expect(function() { cubeMap = context.createCubeMap({ width : context.getMaximumCubeMapSize() + 1, @@ -709,28 +709,28 @@ defineSuite([ }).toThrow(); }); - it("fails to create (PixelFormat)", function() { + it('fails to create (PixelFormat)', function() { expect(function() { cubeMap = context.createCubeMap({ width : 16, height : 16, - pixelFormat : "invalid PixelFormat" + pixelFormat : 'invalid PixelFormat' }); }).toThrow(); }); - it("fails to create (pixelDatatype)", function() { + it('fails to create (pixelDatatype)', function() { expect(function() { cubeMap = context.createCubeMap({ width : 16, height : 16, pixelFormat : PixelFormat.RGBA, - pixelDatatype : "invalid pixelDatatype" + pixelDatatype : 'invalid pixelDatatype' }); }).toThrow(); }); - it("fails to create (source)", function() { + it('fails to create (source)', function() { expect(function() { cubeMap = context.createCubeMap({ source : {} @@ -738,7 +738,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (source width and height)", function() { + it('fails to create (source width and height)', function() { expect(function() { cubeMap = context.createCubeMap({ source : { @@ -753,7 +753,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (source)", function() { + it('fails to copy from an image (source)', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -764,7 +764,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (xOffset)", function() { + it('fails to copy from an image (xOffset)', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -776,7 +776,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (yOffset)", function() { + it('fails to copy from an image (yOffset)', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -788,7 +788,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (width)", function() { + it('fails to copy from an image (width)', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -801,7 +801,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (height)", function() { + it('fails to copy from an image (height)', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 @@ -814,7 +814,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (xOffset)", function() { + it('fails to copy from the frame buffer (xOffset)', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -825,7 +825,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (yOffset)", function() { + it('fails to copy from the frame buffer (yOffset)', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -836,7 +836,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (framebufferXOffset)", function() { + it('fails to copy from the frame buffer (framebufferXOffset)', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -847,7 +847,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (framebufferYOffset)", function() { + it('fails to copy from the frame buffer (framebufferYOffset)', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -858,7 +858,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (width)", function() { + it('fails to copy from the frame buffer (width)', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -869,7 +869,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (height)", function() { + it('fails to copy from the frame buffer (height)', function() { cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -880,7 +880,7 @@ defineSuite([ }).toThrow(); }); - it("fails to generate mipmaps (width)", function() { + it('fails to generate mipmaps (width)', function() { cubeMap = context.createCubeMap({ width : 3, height : 3 @@ -891,18 +891,18 @@ defineSuite([ }).toThrow(); }); - it("fails to generate mipmaps (hint)", function() { + it('fails to generate mipmaps (hint)', function() { cubeMap = context.createCubeMap({ width : 16, height : 16 }); expect(function() { - cubeMap.generateMipmap("invalid hint"); + cubeMap.generateMipmap('invalid hint'); }).toThrow(); }); - it("fails to destroy", function() { + it('fails to destroy', function() { var c = context.createCubeMap({ width : 16, height : 16 diff --git a/Specs/Renderer/DrawSpec.js b/Specs/Renderer/DrawSpec.js index 3fa9a895a70..2134ce9f899 100644 --- a/Specs/Renderer/DrawSpec.js +++ b/Specs/Renderer/DrawSpec.js @@ -12,7 +12,7 @@ defineSuite([ 'Renderer/DepthFunction', 'Renderer/StencilFunction', 'Renderer/StencilOperation' - ], "Renderer/Draw", function( + ], 'Renderer/Draw', function( createContext, destroyContext, IndexDatatype, @@ -48,9 +48,9 @@ defineSuite([ destroyContext(context); }); - it("draws a white point", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws a white point', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -71,9 +71,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws a white point with an index buffer", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws a white point with an index buffer', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -98,17 +98,17 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws a red point with two vertex buffers", function() { + it('draws a red point with two vertex buffers', function() { var vs = - "attribute vec4 position;" + - "attribute mediump float intensity;" + - "varying mediump float fs_intensity;" + - "void main() {" + - " gl_PointSize = 1.0; " + - " gl_Position = position;" + - " fs_intensity = intensity;" + - "}"; - var fs = "varying mediump float fs_intensity; void main() { gl_FragColor = vec4(fs_intensity, 0.0, 0.0, 1.0); }"; + 'attribute vec4 position;' + + 'attribute mediump float intensity;' + + 'varying mediump float fs_intensity;' + + 'void main() {' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = position;' + + ' fs_intensity = intensity;' + + '}'; + var fs = 'varying mediump float fs_intensity; void main() { gl_FragColor = vec4(fs_intensity, 0.0, 0.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -134,17 +134,17 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 0, 255]); }); - it("draws a red point with one interleaved vertex buffers", function() { + it('draws a red point with one interleaved vertex buffers', function() { var vs = - "attribute vec4 position;" + - "attribute mediump float intensity;" + - "varying mediump float fs_intensity;" + - "void main() {" + - " gl_PointSize = 1.0; " + - " gl_Position = position;" + - " fs_intensity = intensity;" + - "}"; - var fs = "varying mediump float fs_intensity; void main() { gl_FragColor = vec4(fs_intensity, 0.0, 0.0, 1.0); }"; + 'attribute vec4 position;' + + 'attribute mediump float intensity;' + + 'varying mediump float fs_intensity;' + + 'void main() {' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = position;' + + ' fs_intensity = intensity;' + + '}'; + var fs = 'varying mediump float fs_intensity; void main() { gl_FragColor = vec4(fs_intensity, 0.0, 0.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); var stride = 5 * Float32Array.BYTES_PER_ELEMENT; @@ -177,9 +177,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 0, 255]); }); - it("draws with stencil test", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with stencil test', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -232,9 +232,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with color mask", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with color mask', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -281,9 +281,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 255, 0]); }); - it("draws with additive blending", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(0.5); }"; + it('draws with additive blending', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(0.5); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -323,9 +323,9 @@ defineSuite([ expect(context.readPixels()).toEqualArrayEpsilon([254, 254, 254, 254], 1); }); - it("draws with alpha blending", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 0.5); }"; + it('draws with alpha blending', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 0.5); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -347,7 +347,7 @@ defineSuite([ blending : { enabled : true, equationRgb : BlendEquation.ADD, - equationAlpha : BlendEquation.SUBTRACT, // Doesn't actually matter + equationAlpha : BlendEquation.SUBTRACT, // does not actually matter functionSourceRgb : BlendFunction.SOURCE_ALPHA, functionSourceAlpha : BlendFunction.ONE, // Don't blend alpha functionDestinationRgb : BlendFunction.ONE_MINUS_SOURCE_ALPHA, @@ -365,9 +365,9 @@ defineSuite([ expect(context.readPixels()).toEqualArrayEpsilon([191, 191, 191, 127], 2); }); - it("draws with blend color", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); }"; + it('draws with blend color', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -409,9 +409,9 @@ defineSuite([ expect(context.readPixels()).toEqualArrayEpsilon([128, 128, 128, 255], 1); }); - it("draws with culling", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with culling', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -454,9 +454,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with front face winding order", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with front face winding order', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -501,9 +501,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with the depth test", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with the depth test', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -556,9 +556,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("draws with depth range", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(gl_DepthRange.near, gl_DepthRange.far, 0.0, 1.0); }"; + it('draws with depth range', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(gl_DepthRange.near, gl_DepthRange.far, 0.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -585,9 +585,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([64, 191, 0, 255]); }); - it("draws with line width", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with line width', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -616,9 +616,9 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("draws with polygon offset", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with polygon offset', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -646,9 +646,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with sample coverage", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with sample coverage', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -688,9 +688,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with stencil test (front)", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with stencil test (front)', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -754,9 +754,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with stencil test (back)", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with stencil test (back)', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -822,9 +822,9 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("draws with an offset and count", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('draws with an offset and count', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -857,13 +857,13 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("fails to draw (missing drawArguments)", function() { + it('fails to draw (missing drawArguments)', function() { expect(function() { context.draw(); }).toThrow(); }); - it("fails to draw (missing shaderProgram)", function() { + it('fails to draw (missing shaderProgram)', function() { expect(function() { context.draw({ primitiveType : PrimitiveType.POINTS @@ -871,9 +871,9 @@ defineSuite([ }).toThrow(); }); - it("fails to draw (missing primitiveType)", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('fails to draw (missing primitiveType)', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); expect(function() { @@ -883,22 +883,22 @@ defineSuite([ }).toThrow(); }); - it("fails to draw (primitiveType)", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('fails to draw (primitiveType)', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); expect(function() { context.draw({ - primitiveType : "invalid value", + primitiveType : 'invalid value', shaderProgram : sp }); }).toThrow(); }); - it("fails to draw (missing vertexArray)", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('fails to draw (missing vertexArray)', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); expect(function() { @@ -909,9 +909,9 @@ defineSuite([ }).toThrow(); }); - it("fails to draw (negative offset)", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('fails to draw (negative offset)', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); expect(function() { diff --git a/Specs/Renderer/FramebufferSpec.js b/Specs/Renderer/FramebufferSpec.js index c351aa2992a..4bc90816749 100644 --- a/Specs/Renderer/FramebufferSpec.js +++ b/Specs/Renderer/FramebufferSpec.js @@ -9,7 +9,7 @@ defineSuite([ 'Renderer/RenderbufferFormat', 'Renderer/StencilFunction', 'Renderer/StencilOperation' - ], "Renderer/Framebuffer", function( + ], 'Renderer/Framebuffer', function( createContext, destroyContext, Cartesian4, @@ -47,7 +47,7 @@ defineSuite([ destroyContext(context); }); - it("has a color attachment", function() { + it('has a color attachment', function() { var colorTexture = context.createTexture2D({ width : 1, height : 1 @@ -58,7 +58,7 @@ defineSuite([ expect(framebuffer.getColorTexture()).toEqual(colorTexture); }); - it("has a depth attachment", function() { + it('has a depth attachment', function() { var renderbuffer = context.createRenderbuffer({ format : RenderbufferFormat.DEPTH_COMPONENT16 }); @@ -68,7 +68,7 @@ defineSuite([ expect(framebuffer.getDepthRenderbuffer()).toEqual(renderbuffer); }); - it("has a stencil attachment", function() { + it('has a stencil attachment', function() { var renderbuffer = context.createRenderbuffer({ format : RenderbufferFormat.Stencil8 }); @@ -78,7 +78,7 @@ defineSuite([ expect(framebuffer.getStencilRenderbuffer()).toEqual(renderbuffer); }); - it("has a depth-stencil attachment", function() { + it('has a depth-stencil attachment', function() { var renderbuffer = context.createRenderbuffer({ format : RenderbufferFormat.DEPTH_STENCIL }); @@ -88,7 +88,7 @@ defineSuite([ expect(framebuffer.getDepthStencilRenderbuffer()).toEqual(renderbuffer); }); - it("clears a color attachment", function() { + it('clears a color attachment', function() { // 1 of 4. Clear default color buffer to black. context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -116,8 +116,8 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); // 4 of 4. Render green to default color buffer by reading from previous color attachment - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "uniform sampler2D u_texture; void main() { gl_FragColor = texture2D(u_texture, vec2(0.0)); }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'uniform sampler2D u_texture; void main() { gl_FragColor = texture2D(u_texture, vec2(0.0)); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -138,7 +138,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("clears a cube map face color attachment", function() { + it('clears a cube map face color attachment', function() { var cubeMap = context.createCubeMap({ width : 1, height : 1 @@ -169,8 +169,8 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); // 4 of 4. Render green to default color buffer by reading from previous color attachment - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "uniform samplerCube u_cubeMap; void main() { gl_FragColor = textureCube(u_cubeMap, vec3(1.0, 0.0, 0.0)); }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'uniform samplerCube u_cubeMap; void main() { gl_FragColor = textureCube(u_cubeMap, vec3(1.0, 0.0, 0.0)); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -193,7 +193,7 @@ defineSuite([ cubeMap = cubeMap.destroy(); }); - it("draws to a color attachment", function() { + it('draws to a color attachment', function() { var colorTexture = context.createTexture2D({ width : 1, height : 1 @@ -207,8 +207,8 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); // 2 of 4. Render green point into color attachment. - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -229,8 +229,8 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); // 4 of 4. Render green to default color buffer by reading from previous color attachment - var vs2 = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs2 = "uniform sampler2D u_texture; void main() { gl_FragColor = texture2D(u_texture, vec2(0.0)); }"; + var vs2 = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs2 = 'uniform sampler2D u_texture; void main() { gl_FragColor = texture2D(u_texture, vec2(0.0)); }'; var sp2 = context.createShaderProgram(vs2, fs2, { position : 0 }); @@ -246,7 +246,7 @@ defineSuite([ sp2 = sp2.destroy(); }); - it("draws with a depth attachment", function() { + it('draws with a depth attachment', function() { framebuffer = context.createFramebuffer({ colorTexture : context.createTexture2D({ width : 1, @@ -259,8 +259,8 @@ defineSuite([ }) }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -311,7 +311,7 @@ defineSuite([ })).toEqualArray([255, 255, 255, 255]); }); - it("draws with a stencil attachment", function() { + it('draws with a stencil attachment', function() { framebuffer = context.createFramebuffer({ colorTexture : context.createTexture2D({ width : 1, @@ -324,8 +324,8 @@ defineSuite([ }) }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "uniform vec4 u_color; void main() { gl_FragColor = u_color; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'uniform vec4 u_color; void main() { gl_FragColor = u_color; }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -396,41 +396,41 @@ defineSuite([ })).toEqualArray([255, 255, 255, 255]); }); - it("destroys", function() { + it('destroys', function() { var f = context.createFramebuffer(); expect(f.isDestroyed()).toEqual(false); f.destroy(); expect(f.isDestroyed()).toEqual(true); }); - it("fails to create (depth and depth-stencil)", function() { + it('fails to create (depth and depth-stencil)', function() { expect(function() { framebuffer = context.createFramebuffer({ - depthRenderbuffer : "not null", - depthStencilRenderbuffer : "not null" + depthRenderbuffer : 'not null', + depthStencilRenderbuffer : 'not null' }); }).toThrow(); }); - it("fails to create (stencil and depth-stencil)", function() { + it('fails to create (stencil and depth-stencil)', function() { expect(function() { framebuffer = context.createFramebuffer({ - stencilRenderbuffer : "not null", - depthStencilRenderbuffer : "not null" + stencilRenderbuffer : 'not null', + depthStencilRenderbuffer : 'not null' }); }).toThrow(); }); - it("fails to create (depth and stencil)", function() { + it('fails to create (depth and stencil)', function() { expect(function() { framebuffer = context.createFramebuffer({ - depthRenderbuffer : "not null", - stencilRenderbuffer : "not null" + depthRenderbuffer : 'not null', + stencilRenderbuffer : 'not null' }); }).toThrow(); }); - it("throws when the depth test is enabled without an appropriate attachment", function() { + it('throws when the depth test is enabled without an appropriate attachment', function() { framebuffer = context.createFramebuffer({ colorTexture : context.createTexture2D({ width : 1, @@ -438,8 +438,8 @@ defineSuite([ }) }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); }'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -464,7 +464,7 @@ defineSuite([ }).toThrow(); }); - it("fails to destroy", function() { + it('fails to destroy', function() { var f = context.createFramebuffer(); f.destroy(); diff --git a/Specs/Renderer/RaySpec.js b/Specs/Renderer/RaySpec.js index 1ecd32491cf..1bc8dc84a87 100644 --- a/Specs/Renderer/RaySpec.js +++ b/Specs/Renderer/RaySpec.js @@ -4,7 +4,7 @@ defineSuite([ '../Specs/destroyContext', '../Specs/renderFragment', 'Shaders/Ray' - ], "Renderer/Ray", function( + ], 'Renderer/Ray', function( createContext, destroyContext, renderFragment, @@ -26,7 +26,7 @@ defineSuite([ return function(context, fs) { var fsSource = ShadersRay + - "#line 0\n" + + '#line 0\n' + fs; return renderFragment(context, fsSource); }; @@ -34,371 +34,371 @@ defineSuite([ /////////////////////////////////////////////////////////////////////// - it("agi_pointAlongRay: point at ray origin", function() { + it('agi_pointAlongRay: point at ray origin', function() { var fs = - "void main() { " + - " gl_FragColor = vec4(agi_pointAlongRay(agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)), 0.0) == vec3(0.0)); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4(agi_pointAlongRay(agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)), 0.0) == vec3(0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_pointAlongRay: point in front of ray origin", function() { + it('agi_pointAlongRay: point in front of ray origin', function() { var fs = - "void main() { " + - " gl_FragColor = vec4(agi_pointAlongRay(agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)), 2.0) == vec3(2.0, 0.0, 0.0)); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4(agi_pointAlongRay(agi_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)), 2.0) == vec3(2.0, 0.0, 0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_pointAlongRay: point behind ray origin", function() { + it('agi_pointAlongRay: point behind ray origin', function() { var fs = - "void main() { " + - " gl_FragColor = vec4(agi_pointAlongRay(agi_ray(vec3(0.0), vec3(0.0, 1.0, 0.0)), -2.0) == vec3(0.0, -2.0, 0.0)); " + - "}"; + 'void main() { ' + + ' gl_FragColor = vec4(agi_pointAlongRay(agi_ray(vec3(0.0), vec3(0.0, 1.0, 0.0)), -2.0) == vec3(0.0, -2.0, 0.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_intersect: no intersection 0", function() { + it('agi_intersect: no intersection 0', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_isEmpty(agi_intersection(agi_raySegment(1.0, 2.0), agi_raySegment(3.0, 4.0)))); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_isEmpty(agi_intersection(agi_raySegment(1.0, 2.0), agi_raySegment(3.0, 4.0)))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: no intersection 1", function() { + it('agi_intersect: no intersection 1', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_isEmpty(agi_intersection(agi_raySegment(3.0, 4.0), agi_raySegment(1.0, 2.0)))); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_isEmpty(agi_intersection(agi_raySegment(3.0, 4.0), agi_raySegment(1.0, 2.0)))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: no intersection 2", function() { + it('agi_intersect: no intersection 2', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_isEmpty(agi_intersection(agi_raySegment(-2.0, -1.0), agi_raySegment(3.0, 4.0)))); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_isEmpty(agi_intersection(agi_raySegment(-2.0, -1.0), agi_raySegment(3.0, 4.0)))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: intersection 0", function() { + it('agi_intersect: intersection 0', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 2.0), agi_raySegment(1.0, 2.0)) == agi_raySegment(1.0, 2.0)); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 2.0), agi_raySegment(1.0, 2.0)) == agi_raySegment(1.0, 2.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: intersection 1", function() { + it('agi_intersect: intersection 1', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 3.0), agi_raySegment(2.0, 4.0)) == agi_raySegment(2.0, 3.0)); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 3.0), agi_raySegment(2.0, 4.0)) == agi_raySegment(2.0, 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: intersection 2", function() { + it('agi_intersect: intersection 2', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 2.0), agi_raySegment(2.0, 3.0)) == agi_raySegment(2.0, 2.0)); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 2.0), agi_raySegment(2.0, 3.0)) == agi_raySegment(2.0, 2.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: intersection 3", function() { + it('agi_intersect: intersection 3', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 4.0), agi_raySegment(2.0, 3.0)) == agi_raySegment(2.0, 3.0)); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_intersection(agi_raySegment(1.0, 4.0), agi_raySegment(2.0, 3.0)) == agi_raySegment(2.0, 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: intersection 4", function() { + it('agi_intersect: intersection 4', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_intersection(agi_raySegment(2.0, 3.0), agi_raySegment(1.0, 4.0)) == agi_raySegment(2.0, 3.0)); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_intersection(agi_raySegment(2.0, 3.0), agi_raySegment(1.0, 4.0)) == agi_raySegment(2.0, 3.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_intersect: intersection 5", function() { + it('agi_intersect: intersection 5', function() { var fs = - "void main() {" + - " gl_FragColor = vec4(agi_intersection(agi_raySegment(-3.0, 3.0), agi_raySegment(-1.0, 1.0)) == agi_raySegment(-1.0, 1.0)); " + - "}"; + 'void main() {' + + ' gl_FragColor = vec4(agi_intersection(agi_raySegment(-3.0, 3.0), agi_raySegment(-1.0, 1.0)) == agi_raySegment(-1.0, 1.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_subtract: inner inside outer", function() { + it('agi_subtract: inner inside outer', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(2.0, 3.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 2.0)) && (i.intervals[1] == agi_raySegment(3.0, 4.0))); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(2.0, 3.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 2.0)) && (i.intervals[1] == agi_raySegment(3.0, 4.0))); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner inside outer on left boundary", function() { + it('agi_subtract: inner inside outer on left boundary', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(1.0, 2.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(2.0, 4.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(1.0, 2.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(2.0, 4.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner inside outer on right boundary", function() { + it('agi_subtract: inner inside outer on right boundary', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(3.0, 4.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 3.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(3.0, 4.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 3.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner equals outer", function() { + it('agi_subtract: inner equals outer', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(1.0, 4.0));" + - " gl_FragColor = vec4(i.count == 0); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(1.0, 4.0));' + + ' gl_FragColor = vec4(i.count == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner is greater than outer", function() { + it('agi_subtract: inner is greater than outer', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(0.0, 5.0));" + - " gl_FragColor = vec4(i.count == 0); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(0.0, 5.0));' + + ' gl_FragColor = vec4(i.count == 0); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner overlaps outer at left boundary", function() { + it('agi_subtract: inner overlaps outer at left boundary', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(0.0, 2.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(2.0, 4.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(0.0, 2.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(2.0, 4.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner overlaps outer at right boundary", function() { + it('agi_subtract: inner overlaps outer at right boundary', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(3.0, 5.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 3.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(3.0, 5.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 3.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner touches at left boundary", function() { + it('agi_subtract: inner touches at left boundary', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(0.0, 1.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(0.0, 1.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner touches at right boundary", function() { + it('agi_subtract: inner touches at right boundary', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(4.0, 5.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(4.0, 5.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner is to the right of outer", function() { + it('agi_subtract: inner is to the right of outer', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(5.0, 6.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(5.0, 6.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_subtract: inner is to the left of outer", function() { + it('agi_subtract: inner is to the left of outer', function() { var fs = - "void main() {" + - " agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(-1.0, 0.0));" + - " gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection i = agi_subtraction(agi_raySegment(1.0, 4.0), agi_raySegment(-1.0, 0.0));' + + ' gl_FragColor = vec4((i.intervals[0] == agi_raySegment(1.0, 4.0)) && (i.count == 1)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_insertAt: last, first, middle", function() { + it('agi_insertAt: last, first, middle', function() { var fs = - "void main() {" + - " agi_raySegmentCollection segments = agi_raySegmentCollectionNew();" + - " agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);" + - " agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);" + - " agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);" + - " gl_FragColor = vec4(" + - " (segments.count == 3)" + - " && (segments.intervals[0].start == 1.0) && (segments.intervals[0].stop == 2.0)" + - " && (segments.intervals[1].start == 3.0) && (segments.intervals[1].stop == 4.0)" + - " && (segments.intervals[2].start == 5.0) && (segments.intervals[2].stop == 6.0)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection segments = agi_raySegmentCollectionNew();' + + ' agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);' + + ' agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);' + + ' agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);' + + ' gl_FragColor = vec4(' + + ' (segments.count == 3)' + + ' && (segments.intervals[0].start == 1.0) && (segments.intervals[0].stop == 2.0)' + + ' && (segments.intervals[1].start == 3.0) && (segments.intervals[1].stop == 4.0)' + + ' && (segments.intervals[2].start == 5.0) && (segments.intervals[2].stop == 6.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_removeAt: first", function() { + it('agi_removeAt: first', function() { var fs = - "void main() {" + - " agi_raySegmentCollection segments = agi_raySegmentCollectionNew();" + - " agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);" + - " agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);" + - " agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);" + - " agi_removeAt(segments, 0);" + - " gl_FragColor = vec4(" + - " (segments.count == 2)" + - " && (segments.intervals[0].start == 3.0) && (segments.intervals[0].stop == 4.0)" + - " && (segments.intervals[1].start == 5.0) && (segments.intervals[1].stop == 6.0)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection segments = agi_raySegmentCollectionNew();' + + ' agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);' + + ' agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);' + + ' agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);' + + ' agi_removeAt(segments, 0);' + + ' gl_FragColor = vec4(' + + ' (segments.count == 2)' + + ' && (segments.intervals[0].start == 3.0) && (segments.intervals[0].stop == 4.0)' + + ' && (segments.intervals[1].start == 5.0) && (segments.intervals[1].stop == 6.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_removeAt: middle", function() { + it('agi_removeAt: middle', function() { var fs = - "void main() {" + - " agi_raySegmentCollection segments = agi_raySegmentCollectionNew();" + - " agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);" + - " agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);" + - " agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);" + - " agi_removeAt(segments, 1);" + - " gl_FragColor = vec4(" + - " (segments.count == 2)" + - " && (segments.intervals[0].start == 1.0) && (segments.intervals[0].stop == 2.0)" + - " && (segments.intervals[1].start == 5.0) && (segments.intervals[1].stop == 6.0)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection segments = agi_raySegmentCollectionNew();' + + ' agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);' + + ' agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);' + + ' agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);' + + ' agi_removeAt(segments, 1);' + + ' gl_FragColor = vec4(' + + ' (segments.count == 2)' + + ' && (segments.intervals[0].start == 1.0) && (segments.intervals[0].stop == 2.0)' + + ' && (segments.intervals[1].start == 5.0) && (segments.intervals[1].stop == 6.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); - it("agi_removeAt: last", function() { + it('agi_removeAt: last', function() { var fs = - "void main() {" + - " agi_raySegmentCollection segments = agi_raySegmentCollectionNew();" + - " agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);" + - " agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);" + - " agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);" + - " agi_removeAt(segments, 2);" + - " gl_FragColor = vec4(" + - " (segments.count == 2)" + - " && (segments.intervals[0].start == 1.0) && (segments.intervals[0].stop == 2.0)" + - " && (segments.intervals[1].start == 3.0) && (segments.intervals[1].stop == 4.0)); " + - "}"; + 'void main() {' + + ' agi_raySegmentCollection segments = agi_raySegmentCollectionNew();' + + ' agi_insertAt(segments, agi_raySegment(5.0, 6.0), segments.count);' + + ' agi_insertAt(segments, agi_raySegment(1.0, 2.0), 0);' + + ' agi_insertAt(segments, agi_raySegment(3.0, 4.0), 1);' + + ' agi_removeAt(segments, 2);' + + ' gl_FragColor = vec4(' + + ' (segments.count == 2)' + + ' && (segments.intervals[0].start == 1.0) && (segments.intervals[0].stop == 2.0)' + + ' && (segments.intervals[1].start == 3.0) && (segments.intervals[1].stop == 4.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); /////////////////////////////////////////////////////////////////////// - it("agi_intersect: {[5,8],[10,20]} with {[5,8],[10,20]}", function() { - var fs = - "void main() {" + - " agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection1, agi_raySegment(5.0, 8.0), 0);" + - " agi_insertAt(collection1, agi_raySegment(10.0, 20.0), collection1.count);" + - " agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection2, agi_raySegment(5.0, 8.0), 0);" + - " agi_insertAt(collection2, agi_raySegment(10.0, 20.0), collection1.count);" + - " agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);" + - " gl_FragColor = vec4(" + - " (intersection.count == 2)" + - " && (intersection.intervals[0].start == 5.0) && (intersection.intervals[0].stop == 8.0)" + - " && (intersection.intervals[1].start == 10.0) && (intersection.intervals[1].stop == 20.0)); " + - "}"; - expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); - }); - - it("agi_intersect: {[5,8],[10,20]} with {[7,11]}", function() { - var fs = - "void main() {" + - " agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection1, agi_raySegment(5.0, 8.0), 0);" + - " agi_insertAt(collection1, agi_raySegment(10.0, 20.0), collection1.count);" + - " agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection2, agi_raySegment(7.0, 11.0), 0);" + - " agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);" + - " gl_FragColor = vec4(" + - " (intersection.count == 2)" + - " && (intersection.intervals[0].start == 7.0) && (intersection.intervals[0].stop == 8.0)" + - " && (intersection.intervals[1].start == 10.0) && (intersection.intervals[1].stop == 11.0)); " + - "}"; - expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); - }); - - it("agi_intersect: {[2,4],[5,7]} with {[1,6],[6.1,8]}", function() { - var fs = - "void main() {" + - " agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection1, agi_raySegment(2.0, 4.0), 0);" + - " agi_insertAt(collection1, agi_raySegment(5.0, 7.0), collection1.count);" + - " agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection2, agi_raySegment(1.0, 6.0), 0);" + - " agi_insertAt(collection2, agi_raySegment(6.1, 8.0), collection2.count);" + - " agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);" + - " gl_FragColor = vec4(" + - " (intersection.count == 3)" + - " && (intersection.intervals[0].start == 2.0) && (intersection.intervals[0].stop == 4.0)" + - " && (intersection.intervals[1].start == 5.0) && (intersection.intervals[1].stop == 6.0)" + - " && (intersection.intervals[2].start == 6.1) && (intersection.intervals[2].stop == 7.0)); " + - "}"; - expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); - }); - - it("agi_intersect: {[3.5,4]} with {[1,2],[3,4]}", function() { - var fs = - "void main() {" + - " agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection1, agi_raySegment(3.5, 4.0), 0);" + - " agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection2, agi_raySegment(1.0, 2.0), 0);" + - " agi_insertAt(collection2, agi_raySegment(3.0, 4.0), collection1.count);" + - " agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);" + - " gl_FragColor = vec4(" + - " (intersection.count == 1)" + - " && (intersection.intervals[0].start == 3.5) && (intersection.intervals[0].stop == 4.0)); " + - "}"; - expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); - }); - - it("agi_intersect: {[2,4],[5,7]} with {}", function() { - var fs = - "void main() {" + - " agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection1, agi_raySegment(2.0, 4.0), 0);" + - " agi_insertAt(collection1, agi_raySegment(5.0, 7.0), collection1.count);" + - " agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();" + - " agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);" + - " gl_FragColor = vec4(" + - " (intersection.count == 0)); " + - "}"; - expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); - }); - - it("agi_intersect: {[2,4]} with {[2,4]}", function() { - var fs = - "void main() {" + - " agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection1, agi_raySegment(2.0, 4.0), 0);" + - " agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();" + - " agi_insertAt(collection2, agi_raySegment(2.0, 4.0), 0);" + - " agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);" + - " gl_FragColor = vec4(" + - " (intersection.count == 1)" + - " && (intersection.intervals[0].start == 2.0) && (intersection.intervals[0].stop == 4.0)); " + - "}"; + it('agi_intersect: {[5,8],[10,20]} with {[5,8],[10,20]}', function() { + var fs = + 'void main() {' + + ' agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection1, agi_raySegment(5.0, 8.0), 0);' + + ' agi_insertAt(collection1, agi_raySegment(10.0, 20.0), collection1.count);' + + ' agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection2, agi_raySegment(5.0, 8.0), 0);' + + ' agi_insertAt(collection2, agi_raySegment(10.0, 20.0), collection1.count);' + + ' agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);' + + ' gl_FragColor = vec4(' + + ' (intersection.count == 2)' + + ' && (intersection.intervals[0].start == 5.0) && (intersection.intervals[0].stop == 8.0)' + + ' && (intersection.intervals[1].start == 10.0) && (intersection.intervals[1].stop == 20.0)); ' + + '}'; + expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); + }); + + it('agi_intersect: {[5,8],[10,20]} with {[7,11]}', function() { + var fs = + 'void main() {' + + ' agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection1, agi_raySegment(5.0, 8.0), 0);' + + ' agi_insertAt(collection1, agi_raySegment(10.0, 20.0), collection1.count);' + + ' agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection2, agi_raySegment(7.0, 11.0), 0);' + + ' agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);' + + ' gl_FragColor = vec4(' + + ' (intersection.count == 2)' + + ' && (intersection.intervals[0].start == 7.0) && (intersection.intervals[0].stop == 8.0)' + + ' && (intersection.intervals[1].start == 10.0) && (intersection.intervals[1].stop == 11.0)); ' + + '}'; + expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); + }); + + it('agi_intersect: {[2,4],[5,7]} with {[1,6],[6.1,8]}', function() { + var fs = + 'void main() {' + + ' agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection1, agi_raySegment(2.0, 4.0), 0);' + + ' agi_insertAt(collection1, agi_raySegment(5.0, 7.0), collection1.count);' + + ' agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection2, agi_raySegment(1.0, 6.0), 0);' + + ' agi_insertAt(collection2, agi_raySegment(6.1, 8.0), collection2.count);' + + ' agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);' + + ' gl_FragColor = vec4(' + + ' (intersection.count == 3)' + + ' && (intersection.intervals[0].start == 2.0) && (intersection.intervals[0].stop == 4.0)' + + ' && (intersection.intervals[1].start == 5.0) && (intersection.intervals[1].stop == 6.0)' + + ' && (intersection.intervals[2].start == 6.1) && (intersection.intervals[2].stop == 7.0)); ' + + '}'; + expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); + }); + + it('agi_intersect: {[3.5,4]} with {[1,2],[3,4]}', function() { + var fs = + 'void main() {' + + ' agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection1, agi_raySegment(3.5, 4.0), 0);' + + ' agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection2, agi_raySegment(1.0, 2.0), 0);' + + ' agi_insertAt(collection2, agi_raySegment(3.0, 4.0), collection1.count);' + + ' agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);' + + ' gl_FragColor = vec4(' + + ' (intersection.count == 1)' + + ' && (intersection.intervals[0].start == 3.5) && (intersection.intervals[0].stop == 4.0)); ' + + '}'; + expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); + }); + + it('agi_intersect: {[2,4],[5,7]} with {}', function() { + var fs = + 'void main() {' + + ' agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection1, agi_raySegment(2.0, 4.0), 0);' + + ' agi_insertAt(collection1, agi_raySegment(5.0, 7.0), collection1.count);' + + ' agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();' + + ' agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);' + + ' gl_FragColor = vec4(' + + ' (intersection.count == 0)); ' + + '}'; + expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); + }); + + it('agi_intersect: {[2,4]} with {[2,4]}', function() { + var fs = + 'void main() {' + + ' agi_raySegmentCollection collection1 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection1, agi_raySegment(2.0, 4.0), 0);' + + ' agi_raySegmentCollection collection2 = agi_raySegmentCollectionNew();' + + ' agi_insertAt(collection2, agi_raySegment(2.0, 4.0), 0);' + + ' agi_raySegmentCollection intersection = agi_intersection(collection1, collection2);' + + ' gl_FragColor = vec4(' + + ' (intersection.count == 1)' + + ' && (intersection.intervals[0].start == 2.0) && (intersection.intervals[0].stop == 4.0)); ' + + '}'; expect(renderFragment(context, fs)).toEqualArray([255, 255, 255, 255]); }); }); \ No newline at end of file diff --git a/Specs/Renderer/RenderStateSpec.js b/Specs/Renderer/RenderStateSpec.js index e1b10370d0a..00f8e78dd1f 100644 --- a/Specs/Renderer/RenderStateSpec.js +++ b/Specs/Renderer/RenderStateSpec.js @@ -9,7 +9,7 @@ defineSuite([ 'Renderer/DepthFunction', 'Renderer/StencilFunction', 'Renderer/StencilOperation' - ], "Renderer/RenderState", function( + ], 'Renderer/RenderState', function( createContext, destroyContext, WindingOrder, @@ -32,7 +32,7 @@ defineSuite([ destroyContext(context); }); - it("creates with defaults", function() { + it('creates with defaults', function() { var defaultRS = { frontFace : WindingOrder.COUNTER_CLOCKWISE, cull : { @@ -162,7 +162,7 @@ defineSuite([ expect(rs.dither).toEqual(defaultRS.dither); }); - it("creates with all render states", function() { + it('creates with all render states', function() { var r = { frontFace : WindingOrder.CLOCKWISE, cull : { @@ -292,7 +292,7 @@ defineSuite([ expect(rs.dither).toEqual(r.dither); }); - it("creates with some render states", function() { + it('creates with some render states', function() { var r = { frontFace : WindingOrder.CLOCKWISE, depthRange : { @@ -354,25 +354,25 @@ defineSuite([ expect(rs.dither).toEqual(defaultRS.dither); }); - it("fails to create (frontFace)", function() { + it('fails to create (frontFace)', function() { expect(function() { context.createRenderState({ - frontFace : "invalid value" + frontFace : 'invalid value' }); }).toThrow(); }); - it("fails to create (cull.face)", function() { + it('fails to create (cull.face)', function() { expect(function() { context.createRenderState({ cull : { - face : "invalid value" + face : 'invalid value' } }); }).toThrow(); }); - it("fails to create (small lineWidth)", function() { + it('fails to create (small lineWidth)', function() { expect(function() { context.createRenderState({ lineWidth : context.getMinimumAliasedLineWidth() - 1 @@ -380,7 +380,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (large lineWidth)", function() { + it('fails to create (large lineWidth)', function() { expect(function() { context.createRenderState({ lineWidth : context.getMaximumAliasedLineWidth() + 1 @@ -388,7 +388,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (negative scissorTest.rectangle.width)", function() { + it('fails to create (negative scissorTest.rectangle.width)', function() { expect(function() { context.createRenderState({ scissorTest : { @@ -403,7 +403,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (negative scissorTest.rectangle.height)", function() { + it('fails to create (negative scissorTest.rectangle.height)', function() { expect(function() { context.createRenderState({ scissorTest : { @@ -418,7 +418,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (near > far)", function() { + it('fails to create (near > far)', function() { expect(function() { context.createRenderState({ depthRange : { @@ -429,7 +429,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (near < 0)", function() { + it('fails to create (near < 0)', function() { expect(function() { context.createRenderState({ depthRange : { @@ -439,7 +439,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (far > 1)", function() { + it('fails to create (far > 1)', function() { expect(function() { context.createRenderState({ depthRange : { @@ -449,17 +449,17 @@ defineSuite([ }).toThrow(); }); - it("fails to create (depthTest.func)", function() { + it('fails to create (depthTest.func)', function() { expect(function() { context.createRenderState({ depthTest : { - func : "invalid value" + func : 'invalid value' } }); }).toThrow(); }); - it("fails to create (blending.color < 0)", function() { + it('fails to create (blending.color < 0)', function() { expect(function() { context.createRenderState({ blending : { @@ -474,7 +474,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (blending.color > 1)", function() { + it('fails to create (blending.color > 1)', function() { expect(function() { context.createRenderState({ blending : { @@ -489,152 +489,152 @@ defineSuite([ }).toThrow(); }); - it("fails to create (blend.equationRgb)", function() { + it('fails to create (blend.equationRgb)', function() { expect(function() { context.createRenderState({ blending : { - equationRgb : "invalid value" + equationRgb : 'invalid value' } }); }).toThrow(); }); - it("fails to create (blend.equationAlpha)", function() { + it('fails to create (blend.equationAlpha)', function() { expect(function() { context.createRenderState({ blending : { - equationAlpha : "invalid value" + equationAlpha : 'invalid value' } }); }).toThrow(); }); - it("fails to create (blend.functionSourceRgb)", function() { + it('fails to create (blend.functionSourceRgb)', function() { expect(function() { context.createRenderState({ blending : { - functionSourceRgb : "invalid value" + functionSourceRgb : 'invalid value' } }); }).toThrow(); }); - it("fails to create (blend.functionSourceAlpha)", function() { + it('fails to create (blend.functionSourceAlpha)', function() { expect(function() { context.createRenderState({ blending : { - functionSourceAlpha : "invalid value" + functionSourceAlpha : 'invalid value' } }); }).toThrow(); }); - it("fails to create (blend.functionDestinationRgb)", function() { + it('fails to create (blend.functionDestinationRgb)', function() { expect(function() { context.createRenderState({ blending : { - functionDestinationRgb : "invalid value" + functionDestinationRgb : 'invalid value' } }); }).toThrow(); }); - it("fails to create (blend.functionDestinationAlpha)", function() { + it('fails to create (blend.functionDestinationAlpha)', function() { expect(function() { context.createRenderState({ blending : { - functionDestinationAlpha : "invalid value" + functionDestinationAlpha : 'invalid value' } }); }).toThrow(); }); - it("fails to create (stencilTest.frontFunction)", function() { + it('fails to create (stencilTest.frontFunction)', function() { expect(function() { context.createRenderState({ stencilTest : { - frontFunction : "invalid value" + frontFunction : 'invalid value' } }); }).toThrow(); }); - it("fails to create (stencilTest.backFunction)", function() { + it('fails to create (stencilTest.backFunction)', function() { expect(function() { context.createRenderState({ stencilTest : { - backFunction : "invalid value" + backFunction : 'invalid value' } }); }).toThrow(); }); - it("fails to create (stencilTest.frontOperation.fail)", function() { + it('fails to create (stencilTest.frontOperation.fail)', function() { expect(function() { context.createRenderState({ stencilTest : { frontOperation : { - fail : "invalid value" + fail : 'invalid value' } } }); }).toThrow(); }); - it("fails to create (stencilTest.frontOperation.zFail)", function() { + it('fails to create (stencilTest.frontOperation.zFail)', function() { expect(function() { context.createRenderState({ stencilTest : { frontOperation : { - zFail : "invalid value" + zFail : 'invalid value' } } }); }).toThrow(); }); - it("fails to create (stencilTest.frontOperation.zPass)", function() { + it('fails to create (stencilTest.frontOperation.zPass)', function() { expect(function() { context.createRenderState({ stencilTest : { frontOperation : { - zPass : "invalid value" + zPass : 'invalid value' } } }); }).toThrow(); }); - it("fails to create (stencilTest.backOperation.fail)", function() { + it('fails to create (stencilTest.backOperation.fail)', function() { expect(function() { context.createRenderState({ stencilTest : { backOperation : { - fail : "invalid value" + fail : 'invalid value' } } }); }).toThrow(); }); - it("fails to create (stencilTest.backOperation.zFail)", function() { + it('fails to create (stencilTest.backOperation.zFail)', function() { expect(function() { context.createRenderState({ stencilTest : { backOperation : { - zFail : "invalid value" + zFail : 'invalid value' } } }); }).toThrow(); }); - it("fails to create (stencilTest.backOperation.zPass)", function() { + it('fails to create (stencilTest.backOperation.zPass)', function() { expect(function() { context.createRenderState({ stencilTest : { backOperation : { - zPass : "invalid value" + zPass : 'invalid value' } } }); diff --git a/Specs/Renderer/RenderbufferSpec.js b/Specs/Renderer/RenderbufferSpec.js index 567ff78cbb3..528fa1eff0e 100644 --- a/Specs/Renderer/RenderbufferSpec.js +++ b/Specs/Renderer/RenderbufferSpec.js @@ -3,7 +3,7 @@ defineSuite([ '../Specs/createContext', '../Specs/destroyContext', 'Renderer/RenderbufferFormat' - ], "Renderer/Renderbuffer", function( + ], 'Renderer/Renderbuffer', function( createContext, destroyContext, RenderbufferFormat) { @@ -25,7 +25,7 @@ defineSuite([ destroyContext(context); }); - it("creates", function() { + it('creates', function() { renderbuffer = context.createRenderbuffer({ format : RenderbufferFormat.DEPTH_COMPONENT16, width : 64, @@ -37,7 +37,7 @@ defineSuite([ expect(renderbuffer.getHeight()).toEqual(32); }); - it("creates with defaults", function() { + it('creates with defaults', function() { renderbuffer = context.createRenderbuffer(); expect(renderbuffer.getFormat()).toEqual(RenderbufferFormat.RGBA4); @@ -45,22 +45,22 @@ defineSuite([ expect(renderbuffer.getHeight()).toEqual(context.getCanvas().clientHeight); }); - it("destroys", function() { + it('destroys', function() { var r = context.createRenderbuffer(); expect(r.isDestroyed()).toEqual(false); r.destroy(); expect(r.isDestroyed()).toEqual(true); }); - it("fails to create (format)", function() { + it('fails to create (format)', function() { expect(function() { renderbuffer = context.createRenderbuffer({ - format : "invalid format" + format : 'invalid format' }); }).toThrow(); }); - it("fails to create (small width)", function() { + it('fails to create (small width)', function() { expect(function() { renderbuffer = context.createRenderbuffer({ width : 0 @@ -68,7 +68,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (large width)", function() { + it('fails to create (large width)', function() { expect(function() { renderbuffer = context.createRenderbuffer({ width : context.getMaximumRenderbufferSize() + 1 @@ -76,7 +76,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (small height)", function() { + it('fails to create (small height)', function() { expect(function() { renderbuffer = context.createRenderbuffer({ height : 0 @@ -84,7 +84,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (large height)", function() { + it('fails to create (large height)', function() { expect(function() { renderbuffer = context.createRenderbuffer({ height : context.getMaximumRenderbufferSize() + 1 @@ -92,7 +92,7 @@ defineSuite([ }).toThrow(); }); - it("fails to destroy", function() { + it('fails to destroy', function() { var r = context.createRenderbuffer(); r.destroy(); diff --git a/Specs/Renderer/ShaderCacheSpec.js b/Specs/Renderer/ShaderCacheSpec.js index 08a1f2bf155..c69c4730054 100644 --- a/Specs/Renderer/ShaderCacheSpec.js +++ b/Specs/Renderer/ShaderCacheSpec.js @@ -20,9 +20,9 @@ defineSuite([ destroyContext(context); }); - it("adds and removes", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('adds and removes', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var cache = new ShaderCache(context); var sp = cache.getShaderProgram(vs, fs, { @@ -39,9 +39,9 @@ defineSuite([ cache.destroy(); }); - it("adds and removes 2", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('adds and removes 2', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var cache = new ShaderCache(context); var sp = cache.getShaderProgram(vs, fs, { @@ -58,9 +58,9 @@ defineSuite([ cache.destroy(); }); - it("has a cache hit", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('has a cache hit', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var cache = new ShaderCache(context); var sp = cache.getShaderProgram(vs, fs, { @@ -82,9 +82,9 @@ defineSuite([ cache.destroy(); }); - it("avoids thrashing", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('avoids thrashing', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var cache = new ShaderCache(context); var sp = cache.getShaderProgram(vs, fs, { @@ -108,9 +108,9 @@ defineSuite([ cache.destroy(); }); - it("is destroyed", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('is destroyed', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var cache = new ShaderCache(context); var sp = cache.getShaderProgram(vs, fs, { @@ -123,7 +123,7 @@ defineSuite([ expect(cache.isDestroyed()).toEqual(true); }); - it("is not destroyed", function() { + it('is not destroyed', function() { var cache = new ShaderCache(context); expect(cache.isDestroyed()).toEqual(false); }); diff --git a/Specs/Renderer/ShaderProgramSpec.js b/Specs/Renderer/ShaderProgramSpec.js index 263b50f8885..585804e8c5b 100644 --- a/Specs/Renderer/ShaderProgramSpec.js +++ b/Specs/Renderer/ShaderProgramSpec.js @@ -11,7 +11,7 @@ defineSuite([ 'Core/PrimitiveType', 'Renderer/BufferUsage', 'Renderer/UniformDatatype' - ], "Renderer/ShaderProgram", function( + ], 'Renderer/ShaderProgram', function( createContext, destroyContext, Cartesian2, @@ -38,22 +38,22 @@ defineSuite([ destroyContext(context); }); - it("has a position vertex attribute", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('has a position vertex attribute', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); expect(sp.getNumberOfVertexAttributes()).toEqual(1); - expect(sp.getVertexAttributes().position.name).toEqual("position"); + expect(sp.getVertexAttributes().position.name).toEqual('position'); }); - it("sets attribute indices", function() { + it('sets attribute indices', function() { var vs = - "attribute vec4 position;" + - "attribute vec3 normal;" + - "attribute float heat;" + - "void main() { gl_Position = position + vec4(normal, 0.0) + vec4(heat); }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + 'attribute vec4 position;' + + 'attribute vec3 normal;' + + 'attribute float heat;' + + 'void main() { gl_Position = position + vec4(normal, 0.0) + vec4(heat); }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var attributes = { position : 3, @@ -63,88 +63,88 @@ defineSuite([ sp = context.createShaderProgram(vs, fs, attributes); expect(sp.getNumberOfVertexAttributes()).toEqual(3); - expect(sp.getVertexAttributes().position.name).toEqual("position"); + expect(sp.getVertexAttributes().position.name).toEqual('position'); expect(sp.getVertexAttributes().position.index).toEqual(attributes.position); - expect(sp.getVertexAttributes().normal.name).toEqual("normal"); + expect(sp.getVertexAttributes().normal.name).toEqual('normal'); expect(sp.getVertexAttributes().normal.index).toEqual(attributes.normal); - expect(sp.getVertexAttributes().heat.name).toEqual("heat"); + expect(sp.getVertexAttributes().heat.name).toEqual('heat'); expect(sp.getVertexAttributes().heat.index).toEqual(attributes.heat); }); - it("has a uniform", function() { - var vs = "uniform vec4 u_vec4; void main() { gl_Position = u_vec4; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('has a uniform', function() { + var vs = 'uniform vec4 u_vec4; void main() { gl_Position = u_vec4; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); var uniform = sp.getAllUniforms().u_vec4; - expect(uniform.getName()).toEqual("u_vec4"); + expect(uniform.getName()).toEqual('u_vec4'); }); - it("has an automatic uniform", function() { - var vs = "uniform vec4 u_vec4; void main() { gl_Position = u_vec4; }"; - var fs = "void main() { gl_FragColor = vec4((agi_viewport.x == 0) && (agi_viewport.y == 0) && (agi_viewport.z == 1) && (agi_viewport.w == 1)); }"; + it('has an automatic uniform', function() { + var vs = 'uniform vec4 u_vec4; void main() { gl_Position = u_vec4; }'; + var fs = 'void main() { gl_FragColor = vec4((agi_viewport.x == 0) && (agi_viewport.y == 0) && (agi_viewport.z == 1) && (agi_viewport.w == 1)); }'; sp = context.createShaderProgram(vs, fs); - expect(sp.getAllUniforms().u_vec4.getName()).toEqual("u_vec4"); - expect(sp.getAllUniforms().agi_viewport.getName()).toEqual("agi_viewport"); + expect(sp.getAllUniforms().u_vec4.getName()).toEqual('u_vec4'); + expect(sp.getAllUniforms().agi_viewport.getName()).toEqual('agi_viewport'); - expect(sp.getManualUniforms().u_vec4.getName()).toEqual("u_vec4"); + expect(sp.getManualUniforms().u_vec4.getName()).toEqual('u_vec4'); expect(sp.getManualUniforms().agi_viewport).not.toBeDefined(); }); - it("has uniforms", function() { - var vs = "uniform float u_float; uniform vec4 u_vec4; uniform mat4 u_mat4; void main() { gl_Position = u_mat4 * u_float * u_vec4; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('has uniforms', function() { + var vs = 'uniform float u_float; uniform vec4 u_vec4; uniform mat4 u_mat4; void main() { gl_Position = u_mat4 * u_float * u_vec4; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); - expect(sp.getAllUniforms().u_float.getName()).toEqual("u_float"); - expect(sp.getAllUniforms().u_vec4.getName()).toEqual("u_vec4"); - expect(sp.getAllUniforms().u_mat4.getName()).toEqual("u_mat4"); + expect(sp.getAllUniforms().u_float.getName()).toEqual('u_float'); + expect(sp.getAllUniforms().u_vec4.getName()).toEqual('u_vec4'); + expect(sp.getAllUniforms().u_mat4.getName()).toEqual('u_mat4'); }); - it("has uniforms of every datatype", function() { + it('has uniforms of every datatype', function() { var d = context; var vs = - "uniform float u_float;" + - "uniform vec2 u_vec2;" + - "uniform vec3 u_vec3;" + - "uniform vec4 u_vec4;" + - "uniform int u_int;" + - "uniform ivec2 u_ivec2;" + - "uniform ivec3 u_ivec3;" + - "uniform ivec4 u_ivec4;" + - "uniform bool u_bool;" + - "uniform bvec2 u_bvec2;" + - "uniform bvec3 u_bvec3;" + - "uniform bvec4 u_bvec4;" + - "uniform mat2 u_mat2;" + - "uniform mat3 u_mat3;" + - "uniform mat4 u_mat4;" + - "void main() { gl_Position = vec4(u_float) * vec4((u_mat2 * u_vec2), 0.0, 0.0) * vec4((u_mat3 * u_vec3), 0.0) * (u_mat4 * u_vec4) * vec4(u_int) * vec4(u_ivec2, 0.0, 0.0) * vec4(u_ivec3, 0.0) * vec4(u_ivec4) * vec4(u_bool) * vec4(u_bvec2, 0.0, 0.0) * vec4(u_bvec3, 0.0) * vec4(u_bvec4); }"; + 'uniform float u_float;' + + 'uniform vec2 u_vec2;' + + 'uniform vec3 u_vec3;' + + 'uniform vec4 u_vec4;' + + 'uniform int u_int;' + + 'uniform ivec2 u_ivec2;' + + 'uniform ivec3 u_ivec3;' + + 'uniform ivec4 u_ivec4;' + + 'uniform bool u_bool;' + + 'uniform bvec2 u_bvec2;' + + 'uniform bvec3 u_bvec3;' + + 'uniform bvec4 u_bvec4;' + + 'uniform mat2 u_mat2;' + + 'uniform mat3 u_mat3;' + + 'uniform mat4 u_mat4;' + + 'void main() { gl_Position = vec4(u_float) * vec4((u_mat2 * u_vec2), 0.0, 0.0) * vec4((u_mat3 * u_vec3), 0.0) * (u_mat4 * u_vec4) * vec4(u_int) * vec4(u_ivec2, 0.0, 0.0) * vec4(u_ivec3, 0.0) * vec4(u_ivec4) * vec4(u_bool) * vec4(u_bvec2, 0.0, 0.0) * vec4(u_bvec3, 0.0) * vec4(u_bvec4); }'; var fs = - "uniform sampler2D u_sampler2D;" + - "uniform samplerCube u_samplerCube;" + - "void main() { gl_FragColor = texture2D(u_sampler2D, vec2(0.0)) + textureCube(u_samplerCube, vec3(1.0)); }"; + 'uniform sampler2D u_sampler2D;' + + 'uniform samplerCube u_samplerCube;' + + 'void main() { gl_FragColor = texture2D(u_sampler2D, vec2(0.0)) + textureCube(u_samplerCube, vec3(1.0)); }'; sp = d.createShaderProgram(vs, fs); - expect(sp.getAllUniforms().u_float.getName()).toEqual("u_float"); - expect(sp.getAllUniforms().u_vec2.getName()).toEqual("u_vec2"); - expect(sp.getAllUniforms().u_vec3.getName()).toEqual("u_vec3"); - expect(sp.getAllUniforms().u_vec4.getName()).toEqual("u_vec4"); - expect(sp.getAllUniforms().u_int.getName()).toEqual("u_int"); - expect(sp.getAllUniforms().u_ivec2.getName()).toEqual("u_ivec2"); - expect(sp.getAllUniforms().u_ivec3.getName()).toEqual("u_ivec3"); - expect(sp.getAllUniforms().u_ivec4.getName()).toEqual("u_ivec4"); - expect(sp.getAllUniforms().u_bool.getName()).toEqual("u_bool"); - expect(sp.getAllUniforms().u_bvec2.getName()).toEqual("u_bvec2"); - expect(sp.getAllUniforms().u_bvec3.getName()).toEqual("u_bvec3"); - expect(sp.getAllUniforms().u_bvec4.getName()).toEqual("u_bvec4"); - expect(sp.getAllUniforms().u_mat2.getName()).toEqual("u_mat2"); - expect(sp.getAllUniforms().u_mat3.getName()).toEqual("u_mat3"); - expect(sp.getAllUniforms().u_mat4.getName()).toEqual("u_mat4"); - expect(sp.getAllUniforms().u_sampler2D.getName()).toEqual("u_sampler2D"); - expect(sp.getAllUniforms().u_samplerCube.getName()).toEqual("u_samplerCube"); + expect(sp.getAllUniforms().u_float.getName()).toEqual('u_float'); + expect(sp.getAllUniforms().u_vec2.getName()).toEqual('u_vec2'); + expect(sp.getAllUniforms().u_vec3.getName()).toEqual('u_vec3'); + expect(sp.getAllUniforms().u_vec4.getName()).toEqual('u_vec4'); + expect(sp.getAllUniforms().u_int.getName()).toEqual('u_int'); + expect(sp.getAllUniforms().u_ivec2.getName()).toEqual('u_ivec2'); + expect(sp.getAllUniforms().u_ivec3.getName()).toEqual('u_ivec3'); + expect(sp.getAllUniforms().u_ivec4.getName()).toEqual('u_ivec4'); + expect(sp.getAllUniforms().u_bool.getName()).toEqual('u_bool'); + expect(sp.getAllUniforms().u_bvec2.getName()).toEqual('u_bvec2'); + expect(sp.getAllUniforms().u_bvec3.getName()).toEqual('u_bvec3'); + expect(sp.getAllUniforms().u_bvec4.getName()).toEqual('u_bvec4'); + expect(sp.getAllUniforms().u_mat2.getName()).toEqual('u_mat2'); + expect(sp.getAllUniforms().u_mat3.getName()).toEqual('u_mat3'); + expect(sp.getAllUniforms().u_mat4.getName()).toEqual('u_mat4'); + expect(sp.getAllUniforms().u_sampler2D.getName()).toEqual('u_sampler2D'); + expect(sp.getAllUniforms().u_samplerCube.getName()).toEqual('u_samplerCube'); expect(sp.getAllUniforms().u_float.getDatatype()).toEqual(UniformDatatype.FLOAT); expect(sp.getAllUniforms().u_vec2.getDatatype()).toEqual(UniformDatatype.FLOAT_VECTOR2); @@ -165,68 +165,68 @@ defineSuite([ expect(sp.getAllUniforms().u_samplerCube.getDatatype()).toEqual(UniformDatatype.SAMPLER_CUBE); }); - it("has a struct uniform", function() { - var vs = "uniform struct { float f; vec4 v; } u_struct; void main() { gl_Position = u_struct.f * u_struct.v; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('has a struct uniform', function() { + var vs = 'uniform struct { float f; vec4 v; } u_struct; void main() { gl_Position = u_struct.f * u_struct.v; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); - expect(sp.getAllUniforms()["u_struct.f"].getName()).toEqual("u_struct.f"); - expect(sp.getAllUniforms()["u_struct.v"].getName()).toEqual("u_struct.v"); + expect(sp.getAllUniforms()['u_struct.f'].getName()).toEqual('u_struct.f'); + expect(sp.getAllUniforms()['u_struct.v'].getName()).toEqual('u_struct.v'); }); - it("has a uniform array", function() { - var vs = "uniform vec4 u_vec4[2]; void main() { gl_Position = u_vec4[0] + u_vec4[1]; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('has a uniform array', function() { + var vs = 'uniform vec4 u_vec4[2]; void main() { gl_Position = u_vec4[0] + u_vec4[1]; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); var uniform = sp.getAllUniforms().u_vec4; - expect(uniform.getName()).toEqual("u_vec4"); + expect(uniform.getName()).toEqual('u_vec4'); expect(uniform.value.length).toEqual(2); }); - it("has uniform arrays of every datatype", function() { + it('has uniform arrays of every datatype', function() { var d = context; var vs = - "uniform float u_float[2];" + - "uniform vec2 u_vec2[2];" + - "uniform vec3 u_vec3[2];" + - "uniform vec4 u_vec4[2];" + - "uniform int u_int[2];" + - "uniform ivec2 u_ivec2[2];" + - "uniform ivec3 u_ivec3[2];" + - "uniform ivec4 u_ivec4[2];" + - "uniform bool u_bool[2];" + - "uniform bvec2 u_bvec2[2];" + - "uniform bvec3 u_bvec3[2];" + - "uniform bvec4 u_bvec4[2];" + - "uniform mat2 u_mat2[2];" + - "uniform mat3 u_mat3[2];" + - "uniform mat4 u_mat4[2];" + - "void main() { gl_Position = vec4(u_float[0]) * vec4(u_float[1]) * vec4((u_mat2[0] * u_vec2[0]), 0.0, 0.0) * vec4((u_mat2[1] * u_vec2[1]), 0.0, 0.0) * vec4((u_mat3[0] * u_vec3[0]), 0.0) * vec4((u_mat3[1] * u_vec3[1]), 0.0) * (u_mat4[0] * u_vec4[0]) * (u_mat4[1] * u_vec4[1]) * vec4(u_int[0]) * vec4(u_int[1]) * vec4(u_ivec2[0], 0.0, 0.0) * vec4(u_ivec2[1], 0.0, 0.0) * vec4(u_ivec3[0], 0.0) * vec4(u_ivec3[1], 0.0) * vec4(u_ivec4[0]) * vec4(u_ivec4[1]) * vec4(u_bool[0]) * vec4(u_bool[1]) * vec4(u_bvec2[0], 0.0, 0.0) * vec4(u_bvec2[1], 0.0, 0.0) * vec4(u_bvec3[0], 0.0) * vec4(u_bvec3[1], 0.0) * vec4(u_bvec4[0]) * vec4(u_bvec4[1]); }"; + 'uniform float u_float[2];' + + 'uniform vec2 u_vec2[2];' + + 'uniform vec3 u_vec3[2];' + + 'uniform vec4 u_vec4[2];' + + 'uniform int u_int[2];' + + 'uniform ivec2 u_ivec2[2];' + + 'uniform ivec3 u_ivec3[2];' + + 'uniform ivec4 u_ivec4[2];' + + 'uniform bool u_bool[2];' + + 'uniform bvec2 u_bvec2[2];' + + 'uniform bvec3 u_bvec3[2];' + + 'uniform bvec4 u_bvec4[2];' + + 'uniform mat2 u_mat2[2];' + + 'uniform mat3 u_mat3[2];' + + 'uniform mat4 u_mat4[2];' + + 'void main() { gl_Position = vec4(u_float[0]) * vec4(u_float[1]) * vec4((u_mat2[0] * u_vec2[0]), 0.0, 0.0) * vec4((u_mat2[1] * u_vec2[1]), 0.0, 0.0) * vec4((u_mat3[0] * u_vec3[0]), 0.0) * vec4((u_mat3[1] * u_vec3[1]), 0.0) * (u_mat4[0] * u_vec4[0]) * (u_mat4[1] * u_vec4[1]) * vec4(u_int[0]) * vec4(u_int[1]) * vec4(u_ivec2[0], 0.0, 0.0) * vec4(u_ivec2[1], 0.0, 0.0) * vec4(u_ivec3[0], 0.0) * vec4(u_ivec3[1], 0.0) * vec4(u_ivec4[0]) * vec4(u_ivec4[1]) * vec4(u_bool[0]) * vec4(u_bool[1]) * vec4(u_bvec2[0], 0.0, 0.0) * vec4(u_bvec2[1], 0.0, 0.0) * vec4(u_bvec3[0], 0.0) * vec4(u_bvec3[1], 0.0) * vec4(u_bvec4[0]) * vec4(u_bvec4[1]); }'; var fs = - "uniform sampler2D u_sampler2D[2];" + - "uniform samplerCube u_samplerCube[2];" + - "void main() { gl_FragColor = texture2D(u_sampler2D[0], vec2(0.0)) + texture2D(u_sampler2D[1], vec2(0.0)) + textureCube(u_samplerCube[0], vec3(1.0)) + textureCube(u_samplerCube[1], vec3(1.0)); }"; + 'uniform sampler2D u_sampler2D[2];' + + 'uniform samplerCube u_samplerCube[2];' + + 'void main() { gl_FragColor = texture2D(u_sampler2D[0], vec2(0.0)) + texture2D(u_sampler2D[1], vec2(0.0)) + textureCube(u_samplerCube[0], vec3(1.0)) + textureCube(u_samplerCube[1], vec3(1.0)); }'; sp = d.createShaderProgram(vs, fs); - expect(sp.getAllUniforms().u_float.getName()).toEqual("u_float"); - expect(sp.getAllUniforms().u_vec2.getName()).toEqual("u_vec2"); - expect(sp.getAllUniforms().u_vec3.getName()).toEqual("u_vec3"); - expect(sp.getAllUniforms().u_vec4.getName()).toEqual("u_vec4"); - expect(sp.getAllUniforms().u_int.getName()).toEqual("u_int"); - expect(sp.getAllUniforms().u_ivec2.getName()).toEqual("u_ivec2"); - expect(sp.getAllUniforms().u_ivec3.getName()).toEqual("u_ivec3"); - expect(sp.getAllUniforms().u_ivec4.getName()).toEqual("u_ivec4"); - expect(sp.getAllUniforms().u_bool.getName()).toEqual("u_bool"); - expect(sp.getAllUniforms().u_bvec2.getName()).toEqual("u_bvec2"); - expect(sp.getAllUniforms().u_bvec3.getName()).toEqual("u_bvec3"); - expect(sp.getAllUniforms().u_bvec4.getName()).toEqual("u_bvec4"); - expect(sp.getAllUniforms().u_mat2.getName()).toEqual("u_mat2"); - expect(sp.getAllUniforms().u_mat3.getName()).toEqual("u_mat3"); - expect(sp.getAllUniforms().u_mat4.getName()).toEqual("u_mat4"); - expect(sp.getAllUniforms().u_sampler2D.getName()).toEqual("u_sampler2D"); - expect(sp.getAllUniforms().u_samplerCube.getName()).toEqual("u_samplerCube"); + expect(sp.getAllUniforms().u_float.getName()).toEqual('u_float'); + expect(sp.getAllUniforms().u_vec2.getName()).toEqual('u_vec2'); + expect(sp.getAllUniforms().u_vec3.getName()).toEqual('u_vec3'); + expect(sp.getAllUniforms().u_vec4.getName()).toEqual('u_vec4'); + expect(sp.getAllUniforms().u_int.getName()).toEqual('u_int'); + expect(sp.getAllUniforms().u_ivec2.getName()).toEqual('u_ivec2'); + expect(sp.getAllUniforms().u_ivec3.getName()).toEqual('u_ivec3'); + expect(sp.getAllUniforms().u_ivec4.getName()).toEqual('u_ivec4'); + expect(sp.getAllUniforms().u_bool.getName()).toEqual('u_bool'); + expect(sp.getAllUniforms().u_bvec2.getName()).toEqual('u_bvec2'); + expect(sp.getAllUniforms().u_bvec3.getName()).toEqual('u_bvec3'); + expect(sp.getAllUniforms().u_bvec4.getName()).toEqual('u_bvec4'); + expect(sp.getAllUniforms().u_mat2.getName()).toEqual('u_mat2'); + expect(sp.getAllUniforms().u_mat3.getName()).toEqual('u_mat3'); + expect(sp.getAllUniforms().u_mat4.getName()).toEqual('u_mat4'); + expect(sp.getAllUniforms().u_sampler2D.getName()).toEqual('u_sampler2D'); + expect(sp.getAllUniforms().u_samplerCube.getName()).toEqual('u_samplerCube'); expect(sp.getAllUniforms().u_float.getDatatype()).toEqual(UniformDatatype.FLOAT); expect(sp.getAllUniforms().u_vec2.getDatatype()).toEqual(UniformDatatype.FLOAT_VECTOR2); @@ -247,26 +247,26 @@ defineSuite([ expect(sp.getAllUniforms().u_samplerCube.getDatatype()).toEqual(UniformDatatype.SAMPLER_CUBE); }); - it("sets uniforms", function() { + it('sets uniforms', function() { var d = context; var vs = - "uniform float u_float;" + - "uniform vec2 u_vec2;" + - "uniform vec3 u_vec3;" + - "uniform vec4 u_vec4;" + - "uniform int u_int;" + - "uniform ivec2 u_ivec2;" + - "uniform ivec3 u_ivec3;" + - "uniform ivec4 u_ivec4;" + - "uniform bool u_bool;" + - "uniform bvec2 u_bvec2;" + - "uniform bvec3 u_bvec3;" + - "uniform bvec4 u_bvec4;" + - "uniform mat2 u_mat2;" + - "uniform mat3 u_mat3;" + - "uniform mat4 u_mat4;" + - "void main() { gl_Position = vec4(u_float) * vec4((u_mat2 * u_vec2), 0.0, 0.0) * vec4((u_mat3 * u_vec3), 0.0) * (u_mat4 * u_vec4) * vec4(u_int) * vec4(u_ivec2, 0.0, 0.0) * vec4(u_ivec3, 0.0) * vec4(u_ivec4) * vec4(u_bool) * vec4(u_bvec2, 0.0, 0.0) * vec4(u_bvec3, 0.0) * vec4(u_bvec4); }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + 'uniform float u_float;' + + 'uniform vec2 u_vec2;' + + 'uniform vec3 u_vec3;' + + 'uniform vec4 u_vec4;' + + 'uniform int u_int;' + + 'uniform ivec2 u_ivec2;' + + 'uniform ivec3 u_ivec3;' + + 'uniform ivec4 u_ivec4;' + + 'uniform bool u_bool;' + + 'uniform bvec2 u_bvec2;' + + 'uniform bvec3 u_bvec3;' + + 'uniform bvec4 u_bvec4;' + + 'uniform mat2 u_mat2;' + + 'uniform mat3 u_mat3;' + + 'uniform mat4 u_mat4;' + + 'void main() { gl_Position = vec4(u_float) * vec4((u_mat2 * u_vec2), 0.0, 0.0) * vec4((u_mat3 * u_vec3), 0.0) * (u_mat4 * u_vec4) * vec4(u_int) * vec4(u_ivec2, 0.0, 0.0) * vec4(u_ivec3, 0.0) * vec4(u_ivec4) * vec4(u_bool) * vec4(u_bvec2, 0.0, 0.0) * vec4(u_bvec3, 0.0) * vec4(u_bvec4); }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = d.createShaderProgram(vs, fs); sp.getAllUniforms().u_float.value = 1.0; sp.getAllUniforms().u_vec2.value = new Cartesian2(1.0, 2.0); @@ -304,26 +304,26 @@ defineSuite([ expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms().u_mat4._getLocation())).toEqualArray((new Matrix4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0)).values); }); - it("sets a struct uniform", function() { + it('sets a struct uniform', function() { var d = context; - var vs = "uniform struct { float f; vec4 v; } u_struct; void main() { gl_Position = u_struct.f * u_struct.v; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + var vs = 'uniform struct { float f; vec4 v; } u_struct; void main() { gl_Position = u_struct.f * u_struct.v; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = d.createShaderProgram(vs, fs); - sp.getAllUniforms()["u_struct.f"].value = 1; - sp.getAllUniforms()["u_struct.v"].value = new Cartesian4(1.0, 2.0, 3.0, 4.0); + sp.getAllUniforms()['u_struct.f'].value = 1; + sp.getAllUniforms()['u_struct.v'].value = new Cartesian4(1.0, 2.0, 3.0, 4.0); sp._bind(); sp._setUniforms(); - expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms()["u_struct.f"]._getLocation())).toEqual(1); - expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms()["u_struct.v"]._getLocation())).toEqualArray(new Float32Array([1.0, 2.0, 3.0, 4.0])); + expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms()['u_struct.f']._getLocation())).toEqual(1); + expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms()['u_struct.v']._getLocation())).toEqualArray(new Float32Array([1.0, 2.0, 3.0, 4.0])); }); - it("sets a uniform array", function() { + it('sets a uniform array', function() { var d = context; - var vs = "uniform float u_float[2];" + "void main() { gl_Position = vec4(u_float[0]) * vec4(u_float[1]); }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + var vs = 'uniform float u_float[2];' + 'void main() { gl_Position = vec4(u_float[0]) * vec4(u_float[1]); }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = d.createShaderProgram(vs, fs); sp.getAllUniforms().u_float.value = new Float32Array([1, 2]); @@ -334,26 +334,26 @@ defineSuite([ expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms().u_float._getLocations()[1])).toEqual(2); }); - it("sets uniform arrays", function() { + it('sets uniform arrays', function() { var d = context; var vs = - "uniform float u_float[2];" + - "uniform vec2 u_vec2[2];" + - "uniform vec3 u_vec3[2];" + - "uniform vec4 u_vec4[2];" + - "uniform int u_int[2];" + - "uniform ivec2 u_ivec2[2];" + - "uniform ivec3 u_ivec3[2];" + - "uniform ivec4 u_ivec4[2];" + - "uniform bool u_bool[2];" + - "uniform bvec2 u_bvec2[2];" + - "uniform bvec3 u_bvec3[2];" + - "uniform bvec4 u_bvec4[2];" + - "uniform mat2 u_mat2[2];" + - "uniform mat3 u_mat3[2];" + - "uniform mat4 u_mat4[2];" + - "void main() { gl_Position = vec4(u_float[0]) * vec4(u_float[1]) * vec4((u_mat2[0] * u_vec2[0]), 0.0, 0.0) * vec4((u_mat2[1] * u_vec2[1]), 0.0, 0.0) * vec4((u_mat3[0] * u_vec3[0]), 0.0) * vec4((u_mat3[1] * u_vec3[1]), 0.0) * (u_mat4[0] * u_vec4[0]) * (u_mat4[1] * u_vec4[1]) * vec4(u_int[0]) * vec4(u_int[1]) * vec4(u_ivec2[0], 0.0, 0.0) * vec4(u_ivec2[1], 0.0, 0.0) * vec4(u_ivec3[0], 0.0) * vec4(u_ivec3[1], 0.0) * vec4(u_ivec4[0]) * vec4(u_ivec4[1]) * vec4(u_bool[0]) * vec4(u_bool[1]) * vec4(u_bvec2[0], 0.0, 0.0) * vec4(u_bvec2[1], 0.0, 0.0) * vec4(u_bvec3[0], 0.0) * vec4(u_bvec3[1], 0.0) * vec4(u_bvec4[0]) * vec4(u_bvec4[1]); }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + 'uniform float u_float[2];' + + 'uniform vec2 u_vec2[2];' + + 'uniform vec3 u_vec3[2];' + + 'uniform vec4 u_vec4[2];' + + 'uniform int u_int[2];' + + 'uniform ivec2 u_ivec2[2];' + + 'uniform ivec3 u_ivec3[2];' + + 'uniform ivec4 u_ivec4[2];' + + 'uniform bool u_bool[2];' + + 'uniform bvec2 u_bvec2[2];' + + 'uniform bvec3 u_bvec3[2];' + + 'uniform bvec4 u_bvec4[2];' + + 'uniform mat2 u_mat2[2];' + + 'uniform mat3 u_mat3[2];' + + 'uniform mat4 u_mat4[2];' + + 'void main() { gl_Position = vec4(u_float[0]) * vec4(u_float[1]) * vec4((u_mat2[0] * u_vec2[0]), 0.0, 0.0) * vec4((u_mat2[1] * u_vec2[1]), 0.0, 0.0) * vec4((u_mat3[0] * u_vec3[0]), 0.0) * vec4((u_mat3[1] * u_vec3[1]), 0.0) * (u_mat4[0] * u_vec4[0]) * (u_mat4[1] * u_vec4[1]) * vec4(u_int[0]) * vec4(u_int[1]) * vec4(u_ivec2[0], 0.0, 0.0) * vec4(u_ivec2[1], 0.0, 0.0) * vec4(u_ivec3[0], 0.0) * vec4(u_ivec3[1], 0.0) * vec4(u_ivec4[0]) * vec4(u_ivec4[1]) * vec4(u_bool[0]) * vec4(u_bool[1]) * vec4(u_bvec2[0], 0.0, 0.0) * vec4(u_bvec2[1], 0.0, 0.0) * vec4(u_bvec3[0], 0.0) * vec4(u_bvec3[1], 0.0) * vec4(u_bvec4[0]) * vec4(u_bvec4[1]); }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; sp = d.createShaderProgram(vs, fs); sp.getAllUniforms().u_float.value = [1.0, 2.0]; @@ -407,23 +407,23 @@ defineSuite([ expect(d._gl.getUniform(sp._getProgram(), sp.getAllUniforms().u_mat4._getLocations()[1])).toEqualArray((new Matrix4(9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0)).values); }); - it("has predefined constants", function() { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + it('has predefined constants', function() { + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "void main() { " + - " float f = ((agi_pi > 0.0) && \n" + - " (agi_oneOverPi > 0.0) && \n" + - " (agi_piOverTwo > 0.0) && \n" + - " (agi_piOverThree > 0.0) && \n" + - " (agi_piOverFour > 0.0) && \n" + - " (agi_piOverSix > 0.0) && \n" + - " (agi_threePiOver2 > 0.0) && \n" + - " (agi_twoPi > 0.0) && \n" + - " (agi_oneOverTwoPi > 0.0) && \n" + - " (agi_radiansPerDegree > 0.0) && \n" + - " (agi_degreesPerRadian > 0.0)) ? 1.0 : 0.0; \n" + - " gl_FragColor = vec4(f); \n" + - "}"; + 'void main() { ' + + ' float f = ((agi_pi > 0.0) && \n' + + ' (agi_oneOverPi > 0.0) && \n' + + ' (agi_piOverTwo > 0.0) && \n' + + ' (agi_piOverThree > 0.0) && \n' + + ' (agi_piOverFour > 0.0) && \n' + + ' (agi_piOverSix > 0.0) && \n' + + ' (agi_threePiOver2 > 0.0) && \n' + + ' (agi_twoPi > 0.0) && \n' + + ' (agi_oneOverTwoPi > 0.0) && \n' + + ' (agi_radiansPerDegree > 0.0) && \n' + + ' (agi_degreesPerRadian > 0.0)) ? 1.0 : 0.0; \n' + + ' gl_FragColor = vec4(f); \n' + + '}'; sp = context.createShaderProgram(vs, fs); va = context.createVertexArray(); @@ -444,31 +444,31 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("compiles with #version at the top", function() { + it('compiles with #version at the top', function() { var vs = - "#version 100 \n" + - "attribute vec4 position; void main() { gl_Position = position; }"; + '#version 100 \n' + + 'attribute vec4 position; void main() { gl_Position = position; }'; var fs = - "#version 100 \n" + - "void main() { gl_FragColor = vec4(1.0); }"; + '#version 100 \n' + + 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); }); - it("compiles with #version after whitespace and comments", function() { + it('compiles with #version after whitespace and comments', function() { var vs = - "// comment before version directive. \n" + - "#version 100 \n" + - "attribute vec4 position; void main() { gl_Position = position; }"; + '// comment before version directive. \n' + + '#version 100 \n' + + 'attribute vec4 position; void main() { gl_Position = position; }'; var fs = - "\n" + - "#version 100 \n" + - "void main() { gl_FragColor = vec4(1.0); }"; + '\n' + + '#version 100 \n' + + 'void main() { gl_FragColor = vec4(1.0); }'; sp = context.createShaderProgram(vs, fs); }); - it("destroys", function() { - var vs = "attribute vec4 position; void main() { gl_Position = position; }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('destroys', function() { + var vs = 'attribute vec4 position; void main() { gl_Position = position; }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var s = context.createShaderProgram(vs, fs); expect(s.isDestroyed()).toEqual(false); @@ -476,36 +476,36 @@ defineSuite([ expect(s.isDestroyed()).toEqual(true); }); - it("fails vertex shader compile", function() { - var vs = "doesn't compile."; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('fails vertex shader compile', function() { + var vs = 'does not compile.'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; expect(function() { sp = context.createShaderProgram(vs, fs); }).toThrow(); }); - it("fails fragment shader compile", function() { - var vs = "void main() { gl_Position = vec4(0.0); }"; - var fs = "doesn't compile."; + it('fails fragment shader compile', function() { + var vs = 'void main() { gl_Position = vec4(0.0); }'; + var fs = 'does not compile.'; expect(function() { sp = context.createShaderProgram(vs, fs); }).toThrow(); }); - it("fails to link", function() { - var vs = "void nomain() { }"; - var fs = "void nomain() { }"; + it('fails to link', function() { + var vs = 'void nomain() { }'; + var fs = 'void nomain() { }'; expect(function() { sp = context.createShaderProgram(vs, fs); }).toThrow(); }); - it("fails to destroy", function() { - var vs = "void main() { gl_Position = vec4(1.0); }"; - var fs = "void main() { gl_FragColor = vec4(1.0); }"; + it('fails to destroy', function() { + var vs = 'void main() { gl_Position = vec4(1.0); }'; + var fs = 'void main() { gl_FragColor = vec4(1.0); }'; var s = context.createShaderProgram(vs, fs); s.destroy(); diff --git a/Specs/Renderer/TextureAtlasSpec.js b/Specs/Renderer/TextureAtlasSpec.js index dae8c07650b..c9182d37db3 100644 --- a/Specs/Renderer/TextureAtlasSpec.js +++ b/Specs/Renderer/TextureAtlasSpec.js @@ -31,30 +31,30 @@ defineSuite([ destroyContext(context); }); - it("initialize suite", function() { + it('initialize suite', function() { greenImage = new Image(); - greenImage.src = "./Data/Images/Green.png"; + greenImage.src = './Data/Images/Green.png'; tallGreenImage = new Image(); - tallGreenImage.src = "./Data/Images/Green1x4.png"; + tallGreenImage.src = './Data/Images/Green1x4.png'; blueImage = new Image(); - blueImage.src = "./Data/Images/Blue.png"; + blueImage.src = './Data/Images/Blue.png'; waitsFor(function() { return greenImage.complete && tallGreenImage.complete && blueImage.complete; - }, "Load .png file(s) for texture atlas test.", 3000); + }, 'Load .png file(s) for texture atlas test.', 3000); }); var draw = function(texture, textureCoordinate, expectedColorArray) { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform sampler2D u_texture;" + - "void main() { " + - " gl_FragColor = texture2D(u_texture, vec2(" + - textureCoordinate.x.toString() + ", " + textureCoordinate.y.toString() + - " )); " + - "}"; + 'uniform sampler2D u_texture;' + + 'void main() { ' + + ' gl_FragColor = texture2D(u_texture, vec2(' + + textureCoordinate.x.toString() + ', ' + textureCoordinate.y.toString() + + ' )); ' + + '}'; var sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -82,7 +82,7 @@ defineSuite([ return context.readPixels(); }; - it("creates a single image atlas", function() { + it('creates a single image atlas', function() { atlas = context.createTextureAtlas([greenImage], PixelFormat.RGBA, 0); var texture = atlas.getTexture(); var coordinates = atlas.getTextureCoordinates(); @@ -100,7 +100,7 @@ defineSuite([ expect(coordinates[0].y1).toEqual(1); }); - it("renders a single image atlas", function() { + it('renders a single image atlas', function() { atlas = context.createTextureAtlas([greenImage], PixelFormat.RGBA, 0); expect(draw.apply(this, [atlas.getTexture(), { @@ -109,7 +109,7 @@ defineSuite([ }])).toEqualArray([0, 255, 0, 255]); }); - it("creates a two image atlas", function() { + it('creates a two image atlas', function() { atlas = context.createTextureAtlas([greenImage, blueImage], PixelFormat.RGBA, 0); var texture = atlas.getTexture(); var coordinates = atlas.getTextureCoordinates(); @@ -129,7 +129,7 @@ defineSuite([ expect(coordinates[1].y1).toEqual(1.0); }); - it("renders a two image atlas", function() { + it('renders a two image atlas', function() { atlas = context.createTextureAtlas([greenImage, blueImage], PixelFormat.RGBA, 0); var texture = atlas.getTexture(); @@ -147,7 +147,7 @@ defineSuite([ }])).toEqualArray([0, 0, 255, 255]); }); - it("renders a four image atlas", function() { + it('renders a four image atlas', function() { atlas = context.createTextureAtlas([greenImage, blueImage, blueImage, greenImage], PixelFormat.RGBA, 0); expect(atlas.getTextureCoordinates().length).toEqual(4); @@ -178,7 +178,7 @@ defineSuite([ }])).toEqualArray([0, 255, 0, 255]); }); - it("creates an atlas with different image heights", function() { + it('creates an atlas with different image heights', function() { atlas = context.createTextureAtlas([blueImage, tallGreenImage], PixelFormat.RGBA, 0); var texture = atlas.getTexture(); var coordinates = atlas.getTextureCoordinates(); @@ -191,7 +191,7 @@ defineSuite([ expect(coordinates[1].y0).toEqual(coordinates[1].y0); }); - it("renders an atlas with different image heights", function() { + it('renders an atlas with different image heights', function() { atlas = context.createTextureAtlas([blueImage, tallGreenImage], PixelFormat.RGBA, 0); var texture = atlas.getTexture(); @@ -213,19 +213,19 @@ defineSuite([ expect(pixels[3]).toEqual(255); }); - it("throws without images", function() { + it('throws without images', function() { expect(function() { atlas = context.createTextureAtlas(); }).toThrow(); }); - it("throws with a negative borderWidthInPixels", function() { + it('throws with a negative borderWidthInPixels', function() { expect(function() { atlas = context.createTextureAtlas([greenImage, blueImage], PixelFormat.RGBA, -1); }).toThrow(); }); - it("throws without context", function() { + it('throws without context', function() { expect(function() { return new TextureAtlas(); }).toThrow(); diff --git a/Specs/Renderer/TextureSpec.js b/Specs/Renderer/TextureSpec.js index 4bad2536d26..bbef5d8ffe3 100644 --- a/Specs/Renderer/TextureSpec.js +++ b/Specs/Renderer/TextureSpec.js @@ -10,7 +10,7 @@ defineSuite([ 'Renderer/TextureWrap', 'Renderer/TextureMinificationFilter', 'Renderer/TextureMagnificationFilter' - ], "Renderer/Texture", function( + ], 'Renderer/Texture', function( createContext, destroyContext, Cartesian2, @@ -55,10 +55,10 @@ defineSuite([ }); function renderFragment(context) { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform sampler2D u_texture;" + - "void main() { gl_FragColor = texture2D(u_texture, vec2(0.0)); }"; + 'uniform sampler2D u_texture;' + + 'void main() { gl_FragColor = texture2D(u_texture, vec2(0.0)); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -79,25 +79,25 @@ defineSuite([ return context.readPixels(); } - it("initializem suite", function() { + it('initializem suite', function() { greenImage = new Image(); - greenImage.src = "./Data/Images/Green.png"; + greenImage.src = './Data/Images/Green.png'; blueImage = new Image(); - blueImage.src = "./Data/Images/Blue.png"; + blueImage.src = './Data/Images/Blue.png'; blueAlphaImage = new Image(); - blueAlphaImage.src = "./Data/Images/BlueAlpha.png"; + blueAlphaImage.src = './Data/Images/BlueAlpha.png'; blueOverRedImage = new Image(); - blueOverRedImage.src = "./Data/Images/BlueOverRed.png"; + blueOverRedImage.src = './Data/Images/BlueOverRed.png'; waitsFor(function() { return greenImage.complete && blueImage.complete && blueAlphaImage.complete && blueOverRedImage.complete; - }, "Load .png file(s) for texture test.", 3000); + }, 'Load .png file(s) for texture test.', 3000); }); - it("creates with defaults", function() { + it('creates with defaults', function() { texture = context.createTexture2D({ source : blueImage }); @@ -106,7 +106,7 @@ defineSuite([ expect(texture.getPixelDatatype()).toEqual(PixelDatatype.UNSIGNED_BYTE); }); - it("creates from the framebuffer", function() { + it('creates from the framebuffer', function() { context.clear(context.createClearState({ color : { red : 1.0, @@ -134,7 +134,7 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([255, 0, 0, 255]); }); - it("copies from the framebuffer", function() { + it('copies from the framebuffer', function() { texture = context.createTexture2D({ source : blueImage, pixelFormat : PixelFormat.RGB @@ -171,7 +171,7 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([255, 0, 0, 255]); }); - it("draws a textured blue point", function() { + it('draws a textured blue point', function() { texture = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA @@ -180,7 +180,7 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([0, 0, 255, 255]); }); - it("renders with premultiplied alpha", function() { + it('renders with premultiplied alpha', function() { texture = context.createTexture2D({ source : blueAlphaImage, pixelFormat :PixelFormat.RGBA, @@ -191,17 +191,17 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([0, 0, 127, 127]); }); - it("draws textured blue and red points", function() { + it('draws textured blue and red points', function() { texture = context.createTexture2D({ source : blueOverRedImage, pixelFormat :PixelFormat.RGBA }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform sampler2D u_texture;" + - "uniform mediump vec2 u_txCoords;" + - "void main() { gl_FragColor = texture2D(u_texture, u_txCoords); }"; + 'uniform sampler2D u_texture;' + + 'uniform mediump vec2 u_txCoords;' + + 'void main() { gl_FragColor = texture2D(u_texture, u_txCoords); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -230,7 +230,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 0, 255]); }); - it("creates from a typed array", function() { + it('creates from a typed array', function() { var bytes = new Uint8Array([0, 255, 0, 255]); texture = context.createTexture2D({ @@ -246,7 +246,7 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([0, 255, 0, 255]); }); - it("copies from a typed array", function() { + it('copies from a typed array', function() { texture = context.createTexture2D({ width : 1, height : 1, @@ -264,17 +264,17 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([255, 0, 255, 0]); }); - it("copies over a subset of a texture", function() { + it('copies over a subset of a texture', function() { texture = context.createTexture2D({ source : blueOverRedImage, pixelFormat :PixelFormat.RGBA }); - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var fs = - "uniform sampler2D u_texture;" + - "uniform mediump vec2 u_txCoords;" + - "void main() { gl_FragColor = texture2D(u_texture, u_txCoords); }"; + 'uniform sampler2D u_texture;' + + 'uniform mediump vec2 u_txCoords;' + + 'void main() { gl_FragColor = texture2D(u_texture, u_txCoords); }'; sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -317,7 +317,7 @@ defineSuite([ }); // Fails on firefox. Should be fixed soon: https://bugzilla.mozilla.org/show_bug.cgi?id=685156 - xit("generates mipmaps", function() { + xit('generates mipmaps', function() { texture = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA @@ -331,7 +331,7 @@ defineSuite([ expect(renderFragment(context)).toEqualArray([0, 0, 255, 255]); }); - it("gets the default sampler", function() { + it('gets the default sampler', function() { texture = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA @@ -345,7 +345,7 @@ defineSuite([ expect(sampler.maximumAnisotropy).toEqual(1.0); }); - it("sets a sampler", function() { + it('sets a sampler', function() { texture = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA @@ -368,7 +368,7 @@ defineSuite([ expect(s.maximumAnisotropy).toEqual(2.0); }); - it("gets width and height", function() { + it('gets width and height', function() { texture = context.createTexture2D({ source : blueOverRedImage, pixelFormat :PixelFormat.RGBA @@ -378,7 +378,7 @@ defineSuite([ expect(texture.getHeight()).toEqual(2); }); - it("destroys", function() { + it('destroys', function() { var t = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA @@ -389,19 +389,19 @@ defineSuite([ expect(t.isDestroyed()).toEqual(true); }); - it("fails to create (description)", function() { + it('fails to create (description)', function() { expect(function() { texture = context.createTexture2D(); }).toThrow(); }); - it("fails to create (source)", function() { + it('fails to create (source)', function() { expect(function() { texture = context.createTexture2D({}); }).toThrow(); }); - it("fails to create (width, no height)", function() { + it('fails to create (width, no height)', function() { expect(function() { texture = context.createTexture2D({ width : 16 @@ -409,7 +409,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (small width)", function() { + it('fails to create (small width)', function() { expect(function() { texture = context.createTexture2D({ width : 0, @@ -418,7 +418,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (large width)", function() { + it('fails to create (large width)', function() { expect(function() { texture = context.createTexture2D({ width : context.getMaximumTextureSize() + 1, @@ -427,7 +427,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (small height)", function() { + it('fails to create (small height)', function() { expect(function() { texture = context.createTexture2D({ width : 16, @@ -436,7 +436,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (large height)", function() { + it('fails to create (large height)', function() { expect(function() { texture = context.createTexture2D({ width : 16, @@ -445,56 +445,56 @@ defineSuite([ }).toThrow(); }); - it("fails to create (PixelFormat)", function() { + it('fails to create (PixelFormat)', function() { expect(function() { texture = context.createTexture2D({ source : blueImage, - pixelFormat :"invalid PixelFormat" + pixelFormat :'invalid PixelFormat' }); }).toThrow(); }); - it("fails to create (pixelDatatype)", function() { + it('fails to create (pixelDatatype)', function() { expect(function() { texture = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA, - pixelDatatype : "invalid pixelDatatype" + pixelDatatype : 'invalid pixelDatatype' }); }).toThrow(); }); - it("fails to create from the framebuffer (PixelFormat)", function() { + it('fails to create from the framebuffer (PixelFormat)', function() { expect(function() { - texture = context.createTexture2DFromFramebuffer("invalid PixelFormat"); + texture = context.createTexture2DFromFramebuffer('invalid PixelFormat'); }).toThrow(); }); - it("fails to create from the framebuffer (framebufferXOffset)", function() { + it('fails to create from the framebuffer (framebufferXOffset)', function() { expect(function() { texture = context.createTexture2DFromFramebuffer(PixelFormat.RGB, -1); }).toThrow(); }); - it("fails to create from the framebuffer (framebufferYOffset)", function() { + it('fails to create from the framebuffer (framebufferYOffset)', function() { expect(function() { texture = context.createTexture2DFromFramebuffer(PixelFormat.RGB, 0, -1); }).toThrow(); }); - it("fails to create from the framebuffer (width)", function() { + it('fails to create from the framebuffer (width)', function() { expect(function() { texture = context.createTexture2DFromFramebuffer(PixelFormat.RGB, 0, 0, context.getCanvas().clientWidth + 1); }).toThrow(); }); - it("fails to create from the framebuffer (height)", function() { + it('fails to create from the framebuffer (height)', function() { expect(function() { texture = context.createTexture2DFromFramebuffer(PixelFormat.RGB, 0, 0, 1, context.getCanvas().clientHeight + 1); }).toThrow(); }); - it("fails to copy from the frame buffer (xOffset)", function() { + it('fails to copy from the frame buffer (xOffset)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -504,7 +504,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (yOffset)", function() { + it('fails to copy from the frame buffer (yOffset)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -514,7 +514,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (framebufferXOffset)", function() { + it('fails to copy from the frame buffer (framebufferXOffset)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -524,7 +524,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (framebufferYOffset)", function() { + it('fails to copy from the frame buffer (framebufferYOffset)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -534,7 +534,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (width)", function() { + it('fails to copy from the frame buffer (width)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -544,7 +544,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from the frame buffer (height)", function() { + it('fails to copy from the frame buffer (height)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -554,39 +554,39 @@ defineSuite([ }).toThrow(); }); - it("fails to set sampler (wrapS)", function() { + it('fails to set sampler (wrapS)', function() { expect(function() { context.createSampler({ - wrapS : "invalid wrap" + wrapS : 'invalid wrap' }); }).toThrow(); }); - it("fails to set sampler (wrapT)", function() { + it('fails to set sampler (wrapT)', function() { expect(function() { context.createSampler({ - wrapT : "invalid wrap" + wrapT : 'invalid wrap' }); }).toThrow(); }); - it("fails to set sampler (minificationFilter)", function() { + it('fails to set sampler (minificationFilter)', function() { expect(function() { context.createSampler({ - minificationFilter : "invalid filter" + minificationFilter : 'invalid filter' }); }).toThrow(); }); - it("fails to set sampler (magnificationFilter)", function() { + it('fails to set sampler (magnificationFilter)', function() { expect(function() { context.createSampler({ - magnificationFilter : "invalid filter" + magnificationFilter : 'invalid filter' }); }).toThrow(); }); - it("fails to set sampler (maximumAnisotropy)", function() { + it('fails to set sampler (maximumAnisotropy)', function() { expect(function() { context.createSampler({ maximumAnisotropy : 0.0 @@ -594,7 +594,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (source)", function() { + it('fails to copy from an image (source)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -604,7 +604,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (xOffset)", function() { + it('fails to copy from an image (xOffset)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -615,7 +615,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (yOffset)", function() { + it('fails to copy from an image (yOffset)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -626,7 +626,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (width)", function() { + it('fails to copy from an image (width)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -638,7 +638,7 @@ defineSuite([ }).toThrow(); }); - it("fails to copy from an image (height)", function() { + it('fails to copy from an image (height)', function() { texture = context.createTexture2D({ source : blueImage }); @@ -650,7 +650,7 @@ defineSuite([ }).toThrow(); }); - it("fails to generate mipmaps (width)", function() { + it('fails to generate mipmaps (width)', function() { texture = context.createTexture2D({ width : 3, height : 2 @@ -661,7 +661,7 @@ defineSuite([ }).toThrow(); }); - it("fails to generate mipmaps (height)", function() { + it('fails to generate mipmaps (height)', function() { texture = context.createTexture2D({ width : 2, height : 3 @@ -672,17 +672,17 @@ defineSuite([ }).toThrow(); }); - it("fails to generate mipmaps (hint)", function() { + it('fails to generate mipmaps (hint)', function() { texture = context.createTexture2D({ source : blueImage }); expect(function() { - texture.generateMipmap("invalid hint"); + texture.generateMipmap('invalid hint'); }).toThrow(); }); - it("fails to destroy", function() { + it('fails to destroy', function() { var t = context.createTexture2D({ source : blueImage, pixelFormat :PixelFormat.RGBA diff --git a/Specs/Renderer/UniformDatatypeSpec.js b/Specs/Renderer/UniformDatatypeSpec.js index 33a55e40154..96f8cae78bb 100644 --- a/Specs/Renderer/UniformDatatypeSpec.js +++ b/Specs/Renderer/UniformDatatypeSpec.js @@ -6,75 +6,75 @@ defineSuite([ "use strict"; /*global it, expect*/ - it("FLOAT", function() { - expect(UniformDatatype.FLOAT.getGLSL()).toEqual("float"); + it('FLOAT', function() { + expect(UniformDatatype.FLOAT.getGLSL()).toEqual('float'); }); - it("FLOAT_VECTOR2", function() { - expect(UniformDatatype.FLOAT_VECTOR2.getGLSL()).toEqual("vec2"); + it('FLOAT_VECTOR2', function() { + expect(UniformDatatype.FLOAT_VECTOR2.getGLSL()).toEqual('vec2'); }); - it("FLOAT_VECTOR3", function() { - expect(UniformDatatype.FLOAT_VECTOR3.getGLSL()).toEqual("vec3"); + it('FLOAT_VECTOR3', function() { + expect(UniformDatatype.FLOAT_VECTOR3.getGLSL()).toEqual('vec3'); }); - it("FLOAT_VECTOR4", function() { - expect(UniformDatatype.FLOAT_VECTOR4.getGLSL()).toEqual("vec4"); + it('FLOAT_VECTOR4', function() { + expect(UniformDatatype.FLOAT_VECTOR4.getGLSL()).toEqual('vec4'); }); - it("INT", function() { - expect(UniformDatatype.INT.getGLSL()).toEqual("int"); + it('INT', function() { + expect(UniformDatatype.INT.getGLSL()).toEqual('int'); }); - it("INT_VECTOR2", function() { - expect(UniformDatatype.INT_VECTOR2.getGLSL()).toEqual("ivec2"); + it('INT_VECTOR2', function() { + expect(UniformDatatype.INT_VECTOR2.getGLSL()).toEqual('ivec2'); }); - it("INT_VECTOR3", function() { - expect(UniformDatatype.INT_VECTOR3.getGLSL()).toEqual("ivec3"); + it('INT_VECTOR3', function() { + expect(UniformDatatype.INT_VECTOR3.getGLSL()).toEqual('ivec3'); }); - it("INT_VECTOR4", function() { - expect(UniformDatatype.INT_VECTOR4.getGLSL()).toEqual("ivec4"); + it('INT_VECTOR4', function() { + expect(UniformDatatype.INT_VECTOR4.getGLSL()).toEqual('ivec4'); }); - it("BOOL", function() { - expect(UniformDatatype.BOOL.getGLSL()).toEqual("bool"); + it('BOOL', function() { + expect(UniformDatatype.BOOL.getGLSL()).toEqual('bool'); }); - it("BOOL_VECTOR2", function() { - expect(UniformDatatype.BOOL_VECTOR2.getGLSL()).toEqual("bvec2"); + it('BOOL_VECTOR2', function() { + expect(UniformDatatype.BOOL_VECTOR2.getGLSL()).toEqual('bvec2'); }); - it("BOOL_VECTOR3", function() { - expect(UniformDatatype.BOOL_VECTOR3.getGLSL()).toEqual("bvec3"); + it('BOOL_VECTOR3', function() { + expect(UniformDatatype.BOOL_VECTOR3.getGLSL()).toEqual('bvec3'); }); - it("BOOL_VECTOR4", function() { - expect(UniformDatatype.BOOL_VECTOR4.getGLSL()).toEqual("bvec4"); + it('BOOL_VECTOR4', function() { + expect(UniformDatatype.BOOL_VECTOR4.getGLSL()).toEqual('bvec4'); }); - it("FLOAT_MATRIX2", function() { - expect(UniformDatatype.FLOAT_MATRIX2.getGLSL()).toEqual("mat2"); + it('FLOAT_MATRIX2', function() { + expect(UniformDatatype.FLOAT_MATRIX2.getGLSL()).toEqual('mat2'); }); - it("FLOAT_MATRIX2", function() { - expect(UniformDatatype.FLOAT_MATRIX2.getGLSL()).toEqual("mat2"); + it('FLOAT_MATRIX2', function() { + expect(UniformDatatype.FLOAT_MATRIX2.getGLSL()).toEqual('mat2'); }); - it("FLOAT_MATRIX3", function() { - expect(UniformDatatype.FLOAT_MATRIX3.getGLSL()).toEqual("mat3"); + it('FLOAT_MATRIX3', function() { + expect(UniformDatatype.FLOAT_MATRIX3.getGLSL()).toEqual('mat3'); }); - it("FLOAT_MATRIX4", function() { - expect(UniformDatatype.FLOAT_MATRIX4.getGLSL()).toEqual("mat4"); + it('FLOAT_MATRIX4', function() { + expect(UniformDatatype.FLOAT_MATRIX4.getGLSL()).toEqual('mat4'); }); - it("SAMPLER_2D", function() { - expect(UniformDatatype.SAMPLER_2D.getGLSL()).toEqual("sampler2D"); + it('SAMPLER_2D', function() { + expect(UniformDatatype.SAMPLER_2D.getGLSL()).toEqual('sampler2D'); }); - it("SAMPLER_CUBE", function() { - expect(UniformDatatype.SAMPLER_CUBE.getGLSL()).toEqual("samplerCube"); + it('SAMPLER_CUBE', function() { + expect(UniformDatatype.SAMPLER_CUBE.getGLSL()).toEqual('samplerCube'); }); }); \ No newline at end of file diff --git a/Specs/Renderer/VertexArrayFacadeSpec.js b/Specs/Renderer/VertexArrayFacadeSpec.js index 3b98dd51c44..d1ad7d8e3e2 100644 --- a/Specs/Renderer/VertexArrayFacadeSpec.js +++ b/Specs/Renderer/VertexArrayFacadeSpec.js @@ -24,7 +24,7 @@ defineSuite([ destroyContext(context); }); - it("creates a vertex array with static floats", function() { + it('creates a vertex array with static floats', function() { var positionIndex = 0; var vaf = new VertexArrayFacade(context, [{ index : positionIndex, @@ -48,7 +48,7 @@ defineSuite([ expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(3 * 4); }); - it("resizes a vertex array with static floats", function() { + it('resizes a vertex array with static floats', function() { var positionIndex = 0; var vaf = new VertexArrayFacade(context, [{ index : positionIndex, @@ -75,7 +75,7 @@ defineSuite([ expect(vaf.va[0].va.getAttribute(0).strideInBytes).toEqual(3 * 4); }); - it("creates a vertex array with static floats and unsigned bytes", function() { + it('creates a vertex array with static floats and unsigned bytes', function() { var positionIndex = 0; var colorIndex = 2; var vaf = new VertexArrayFacade(context, [{ @@ -117,7 +117,7 @@ defineSuite([ expect(vaf.va[0].va.getAttribute(1).strideInBytes).toEqual(vaf.va[0].va.getAttribute(0).strideInBytes); }); - it("creates a vertex array with static and dynamic attributes", function() { + it('creates a vertex array with static and dynamic attributes', function() { var positionIndex = 0; var txCoordIndex = 2; var vaf = new VertexArrayFacade(context, [{ @@ -162,7 +162,7 @@ defineSuite([ expect(vaf.va[0].va.getAttribute(1).strideInBytes).toEqual(2 * 2); }); - it("sub-commits", function() { + it('sub-commits', function() { var positionIndex = 0; var temperatureIndex = 2; var vaf = new VertexArrayFacade(context, [{ @@ -220,49 +220,49 @@ defineSuite([ expect(vaf.va[0].va.getAttribute(1).strideInBytes).toEqual(1 * 4); }); - it("throws when constructed without a context", function() { + it('throws when constructed without a context', function() { expect(function() { return new VertexArrayFacade(undefined, undefined, undefined); }).toThrow(); }); - it("throws when constructed undefined attributes", function() { + it('throws when constructed undefined attributes', function() { expect(function() { return new VertexArrayFacade(context, undefined, undefined); }).toThrow(); }); - it("throws when constructed without attributes", function() { + it('throws when constructed without attributes', function() { expect(function() { return new VertexArrayFacade(context, []); }).toThrow(); }); - it("throws when constructed with attributes without componentsPerAttribute", function() { + it('throws when constructed with attributes without componentsPerAttribute', function() { expect(function() { return new VertexArrayFacade(context, [{}]); }).toThrow(); }); - it("throws when constructed with attributes with an invalid componentDatatype", function() { + it('throws when constructed with attributes with an invalid componentDatatype', function() { expect(function() { return new VertexArrayFacade(context, [{ componentsPerAttribute : 1, - componentDatatype : "invalid component datatype" + componentDatatype : 'invalid component datatype' }]); }).toThrow(); }); - it("throws when constructed with attributes with an invalid usage", function() { + it('throws when constructed with attributes with an invalid usage', function() { expect(function() { return new VertexArrayFacade(context, [{ componentsPerAttribute : 1, - usage : "invalid component usage" + usage : 'invalid component usage' }]); }).toThrow(); }); - it("throws when constructed with attributes with duplicate indices", function() { + it('throws when constructed with attributes with duplicate indices', function() { expect(function() { return new VertexArrayFacade(context, [{ index : 0, diff --git a/Specs/Renderer/VertexArrayFactorySpec.js b/Specs/Renderer/VertexArrayFactorySpec.js index 79e311779f2..20ed00f3536 100644 --- a/Specs/Renderer/VertexArrayFactorySpec.js +++ b/Specs/Renderer/VertexArrayFactorySpec.js @@ -8,7 +8,7 @@ defineSuite([ 'Core/IndexDatatype', 'Renderer/BufferUsage', 'Renderer/VertexLayout' - ], "Renderer/VertexArrayFactory", function( + ], 'Renderer/VertexArrayFactory', function( createContext, destroyContext, ComponentDatatype, @@ -40,13 +40,13 @@ defineSuite([ destroyContext(context); }); - it("creates with no arguments", function() { + it('creates with no arguments', function() { va = context.createVertexArrayFromMesh(); expect(va.getNumberOfAttributes()).toEqual(0); expect(va.getIndexBuffer()).not.toBeDefined(); }); - it("creates with no mesh", function() { + it('creates with no mesh', function() { va = context.createVertexArrayFromMesh({ vertexLayout : VertexLayout.INTERLEAVED }); @@ -54,7 +54,7 @@ defineSuite([ expect(va.getIndexBuffer()).not.toBeDefined(); }); - it("creates a single-attribute vertex (non-interleaved)", function() { + it('creates a single-attribute vertex (non-interleaved)', function() { var mesh = { attributes : { position : { @@ -83,7 +83,7 @@ defineSuite([ expect(va.getAttribute(0).vertexBuffer.getUsage()).toEqual(BufferUsage.DYNAMIC_DRAW); // Default }); - it("creates a single-attribute vertex (interleaved)", function() { + it('creates a single-attribute vertex (interleaved)', function() { var mesh = { attributes : { position : { @@ -114,7 +114,7 @@ defineSuite([ expect(va.getAttribute(0).vertexBuffer.getUsage()).toEqual(BufferUsage.STATIC_DRAW); }); - it("creates a homogeneous multiple-attribute vertex (non-interleaved)", function() { + it('creates a homogeneous multiple-attribute vertex (non-interleaved)', function() { var mesh = { attributes : { position : { @@ -155,7 +155,7 @@ defineSuite([ expect(va.getAttribute(0).vertexBuffer).not.toBe(va.getAttribute(1).vertexBuffer); }); - it("creates a homogeneous multiple-attribute vertex (interleaved)", function() { + it('creates a homogeneous multiple-attribute vertex (interleaved)', function() { var mesh = { attributes : { position : { @@ -199,7 +199,7 @@ defineSuite([ expect(va.getAttribute(0).vertexBuffer).toBe(va.getAttribute(1).vertexBuffer); }); - it("creates a heterogeneous multiple-attribute vertex (interleaved)", function() { + it('creates a heterogeneous multiple-attribute vertex (interleaved)', function() { var mesh = { attributes : { position : { @@ -243,7 +243,7 @@ defineSuite([ expect(va.getAttribute(0).vertexBuffer).toBe(va.getAttribute(1).vertexBuffer); }); - it("sorts interleaved attributes from large to small components", function() { + it('sorts interleaved attributes from large to small components', function() { var mesh = { attributes : { bytes : { @@ -280,20 +280,20 @@ defineSuite([ // Validate via rendering var vs = - "attribute float bytes; " + - "attribute float shorts; " + - "attribute float floats; " + - "varying vec4 fsColor; " + - "void main() { " + - " gl_PointSize = 1.0; " + - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0); " + - " fsColor = vec4((bytes == 0.0) && (shorts == 1.0) && (floats == 2.0)); " + - "}"; + 'attribute float bytes; ' + + 'attribute float shorts; ' + + 'attribute float floats; ' + + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0); ' + + ' fsColor = vec4((bytes == 0.0) && (shorts == 1.0) && (floats == 2.0)); ' + + '}'; var fs = - "varying vec4 fsColor; " + - "void main() { " + - " gl_FragColor = fsColor; " + - "}"; + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_FragColor = fsColor; ' + + '}'; sp = context.createShaderProgram(vs, fs, attributeIndices); context.clear(); @@ -307,7 +307,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("sorts interleaved attributes from large to small components (2)", function() { + it('sorts interleaved attributes from large to small components (2)', function() { // TODO: Color should be normalized var mesh = { attributes : { @@ -335,19 +335,19 @@ defineSuite([ // Validate via rendering var vs = - "attribute vec3 position; " + - "attribute vec4 color; " + - "varying vec4 fsColor; " + - "void main() { " + - " gl_PointSize = 1.0; " + - " gl_Position = vec4(position, 1.0); " + - " fsColor = color; " + - "}"; + 'attribute vec3 position; ' + + 'attribute vec4 color; ' + + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = vec4(position, 1.0); ' + + ' fsColor = color; ' + + '}'; var fs = - "varying vec4 fsColor; " + - "void main() { " + - " gl_FragColor = fsColor; " + - "}"; + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_FragColor = fsColor; ' + + '}'; sp = context.createShaderProgram(vs, fs, attributeIndices); context.clear(); @@ -372,7 +372,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("sorts interleaved attributes from large to small components (3)", function() { + it('sorts interleaved attributes from large to small components (3)', function() { var mesh = { attributes : { unsignedByteAttribute : { @@ -410,21 +410,21 @@ defineSuite([ // Validate via rendering var vs = - "attribute vec2 unsignedByteAttribute; " + - "attribute float unsignedShortAttribute; " + - "attribute float byteAttribute; " + - "attribute float shortAttribute; " + - "varying vec4 fsColor; " + - "void main() { " + - " gl_PointSize = 1.0; " + - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0); " + - " fsColor = vec4((unsignedByteAttribute.x == 1.0) && (unsignedByteAttribute.y == 2.0) && (unsignedShortAttribute == 3.0) && (byteAttribute == 4.0) && (shortAttribute == 5.0)); " + - "}"; + 'attribute vec2 unsignedByteAttribute; ' + + 'attribute float unsignedShortAttribute; ' + + 'attribute float byteAttribute; ' + + 'attribute float shortAttribute; ' + + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0); ' + + ' fsColor = vec4((unsignedByteAttribute.x == 1.0) && (unsignedByteAttribute.y == 2.0) && (unsignedShortAttribute == 3.0) && (byteAttribute == 4.0) && (shortAttribute == 5.0)); ' + + '}'; var fs = - "varying vec4 fsColor; " + - "void main() { " + - " gl_FragColor = fsColor; " + - "}"; + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_FragColor = fsColor; ' + + '}'; sp = context.createShaderProgram(vs, fs, attributeIndices); context.clear(); @@ -438,7 +438,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("creates a custom interleaved vertex", function() { + it('creates a custom interleaved vertex', function() { // TODO: Color should be normalized var mesh = { @@ -477,26 +477,26 @@ defineSuite([ // Validate via rendering var vs = - "attribute vec3 position; " + - "attribute vec3 color; " + - "attribute vec3 normal; " + - "attribute float temperature; " + - "varying vec4 fsColor; " + - "void main() { " + - " gl_PointSize = 1.0; " + - " gl_Position = vec4(position, 1.0); " + - " if ((normal == vec3(1.0, 0.0, 0.0)) && (temperature == 75.0)) { " + - " fsColor = vec4(color, 1.0); " + - " } " + - " else {" + - " fsColor = vec4(1.0); " + - " }" + - "}"; + 'attribute vec3 position; ' + + 'attribute vec3 color; ' + + 'attribute vec3 normal; ' + + 'attribute float temperature; ' + + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = vec4(position, 1.0); ' + + ' if ((normal == vec3(1.0, 0.0, 0.0)) && (temperature == 75.0)) { ' + + ' fsColor = vec4(color, 1.0); ' + + ' } ' + + ' else {' + + ' fsColor = vec4(1.0); ' + + ' }' + + '}'; var fs = - "varying vec4 fsColor; " + - "void main() { " + - " gl_FragColor = fsColor; " + - "}"; + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_FragColor = fsColor; ' + + '}'; sp = context.createShaderProgram(vs, fs, attributeIndices); context.clear(); @@ -512,21 +512,21 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 0, 255]); var vs2 = - "attribute vec3 position; " + - "attribute vec3 color; " + - "attribute vec3 normal; " + - "attribute float temperature; " + - "varying vec4 fsColor; " + - "void main() { " + - " gl_PointSize = 1.0; " + - " gl_Position = vec4(position, 1.0); " + - " if ((normal == vec3(0.0, 1.0, 0.0)) && (temperature == 100.0)) { " + - " fsColor = vec4(color, 1.0); " + - " } " + - " else {" + - " fsColor = vec4(1.0); " + - " }" + - "}"; + 'attribute vec3 position; ' + + 'attribute vec3 color; ' + + 'attribute vec3 normal; ' + + 'attribute float temperature; ' + + 'varying vec4 fsColor; ' + + 'void main() { ' + + ' gl_PointSize = 1.0; ' + + ' gl_Position = vec4(position, 1.0); ' + + ' if ((normal == vec3(0.0, 1.0, 0.0)) && (temperature == 100.0)) { ' + + ' fsColor = vec4(color, 1.0); ' + + ' } ' + + ' else {' + + ' fsColor = vec4(1.0); ' + + ' }' + + '}'; sp = sp.destroy(); sp = context.createShaderProgram(vs2, fs, attributeIndices); @@ -540,7 +540,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("creates an index buffer", function() { + it('creates an index buffer', function() { var mesh = { indexLists : [{ primitiveType : PrimitiveType.POINTS, @@ -559,7 +559,7 @@ defineSuite([ expect(va.getIndexBuffer().getNumberOfIndices()).toEqual(mesh.indexLists[0].values.length); }); - it("throws with multiple index lists", function() { + it('throws with multiple index lists', function() { var mesh = { indexLists : [{ primitiveType : PrimitiveType.POINTS, @@ -577,7 +577,7 @@ defineSuite([ }).toThrow(); }); - it("throws with different number of interleaved attributes", function() { + it('throws with different number of interleaved attributes', function() { var mesh = { attributes : { position : { @@ -601,7 +601,7 @@ defineSuite([ }).toThrow(); }); - it("throws with duplicate indices", function() { + it('throws with duplicate indices', function() { var mesh = { attributes : { position : { diff --git a/Specs/Renderer/VertexArraySpec.js b/Specs/Renderer/VertexArraySpec.js index 4c688a34ac3..c32ddb93102 100644 --- a/Specs/Renderer/VertexArraySpec.js +++ b/Specs/Renderer/VertexArraySpec.js @@ -5,7 +5,7 @@ defineSuite([ 'Core/ComponentDatatype', 'Core/PrimitiveType', 'Renderer/BufferUsage' - ], "Renderer/VertexArray", function( + ], 'Renderer/VertexArray', function( createContext, destroyContext, ComponentDatatype, @@ -24,7 +24,7 @@ defineSuite([ destroyContext(context); }); - it("binds", function() { + it('binds', function() { var positionBuffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -44,7 +44,7 @@ defineSuite([ va = va.destroy(); }); - it("binds with default values", function() { + it('binds with default values', function() { var positionBuffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -67,7 +67,7 @@ defineSuite([ va = va.destroy(); }); - it("binds with multiple buffers", function() { + it('binds with multiple buffers', function() { var attributeSize = 3 * Float32Array.BYTES_PER_ELEMENT; var positionBuffer = context.createVertexBuffer(attributeSize, BufferUsage.STATIC_DRAW); var normalBuffer = context.createVertexBuffer(attributeSize, BufferUsage.STATIC_DRAW); @@ -90,7 +90,7 @@ defineSuite([ va = va.destroy(); }); - it("binds with interleaved buffer", function() { + it('binds with interleaved buffer', function() { var attributeSize = 3 * Float32Array.BYTES_PER_ELEMENT; var buffer = context.createVertexBuffer(attributeSize, BufferUsage.STATIC_DRAW); @@ -115,7 +115,7 @@ defineSuite([ va = va.destroy(); }); - it("adds attributes", function() { + it('adds attributes', function() { var positionBuffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var va = context.createVertexArray(); @@ -137,7 +137,7 @@ defineSuite([ va = va.destroy(); }); - it("modifies attributes", function() { + it('modifies attributes', function() { var buffer = context.createVertexBuffer(6, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -155,7 +155,7 @@ defineSuite([ va = va.destroy(); }); - it("removes attributes", function() { + it('removes attributes', function() { var buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var va = context.createVertexArray(); @@ -199,18 +199,18 @@ defineSuite([ })).toEqual(false); }); - it("renders with a one-component constant value", function() { + it('renders with a one-component constant value', function() { var vs = - "attribute float attr;" + - "varying vec4 v_color;" + - "void main() { " + - " v_color = vec4(attr == 0.5);" + - " gl_PointSize = 1.0;" + - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);" + - "}"; + 'attribute float attr;' + + 'varying vec4 v_color;' + + 'void main() { ' + + ' v_color = vec4(attr == 0.5);' + + ' gl_PointSize = 1.0;' + + ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0);' + + '}'; var fs = - "varying vec4 v_color;" + - "void main() { gl_FragColor = v_color; }"; + 'varying vec4 v_color;' + + 'void main() { gl_FragColor = v_color; }'; var sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -233,18 +233,18 @@ defineSuite([ va = va.destroy(); }); - it("renders with a two-component constant value", function() { + it('renders with a two-component constant value', function() { var vs = - "attribute vec2 attr;" + - "varying vec4 v_color;" + - "void main() { " + - " v_color = vec4(attr == vec2(0.25, 0.75));" + - " gl_PointSize = 1.0;" + - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);" + - "}"; + 'attribute vec2 attr;' + + 'varying vec4 v_color;' + + 'void main() { ' + + ' v_color = vec4(attr == vec2(0.25, 0.75));' + + ' gl_PointSize = 1.0;' + + ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0);' + + '}'; var fs = - "varying vec4 v_color;" + - "void main() { gl_FragColor = v_color; }"; + 'varying vec4 v_color;' + + 'void main() { gl_FragColor = v_color; }'; var sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -267,18 +267,18 @@ defineSuite([ va = va.destroy(); }); - it("renders with a three-component constant value", function() { + it('renders with a three-component constant value', function() { var vs = - "attribute vec3 attr;" + - "varying vec4 v_color;" + - "void main() { " + - " v_color = vec4(attr == vec3(0.25, 0.5, 0.75));" + - " gl_PointSize = 1.0;" + - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);" + - "}"; + 'attribute vec3 attr;' + + 'varying vec4 v_color;' + + 'void main() { ' + + ' v_color = vec4(attr == vec3(0.25, 0.5, 0.75));' + + ' gl_PointSize = 1.0;' + + ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0);' + + '}'; var fs = - "varying vec4 v_color;" + - "void main() { gl_FragColor = v_color; }"; + 'varying vec4 v_color;' + + 'void main() { gl_FragColor = v_color; }'; var sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -301,18 +301,18 @@ defineSuite([ va = va.destroy(); }); - it("renders with a four-component constant value", function() { + it('renders with a four-component constant value', function() { var vs = - "attribute vec4 attr;" + - "varying vec4 v_color;" + - "void main() { " + - " v_color = vec4(attr == vec4(0.2, 0.4, 0.6, 0.8));" + - " gl_PointSize = 1.0;" + - " gl_Position = vec4(0.0, 0.0, 0.0, 1.0);" + - "}"; + 'attribute vec4 attr;' + + 'varying vec4 v_color;' + + 'void main() { ' + + ' v_color = vec4(attr == vec4(0.2, 0.4, 0.6, 0.8));' + + ' gl_PointSize = 1.0;' + + ' gl_Position = vec4(0.0, 0.0, 0.0, 1.0);' + + '}'; var fs = - "varying vec4 v_color;" + - "void main() { gl_FragColor = v_color; }"; + 'varying vec4 v_color;' + + 'void main() { gl_FragColor = v_color; }'; var sp = context.createShaderProgram(vs, fs, { position : 0 }); @@ -335,14 +335,14 @@ defineSuite([ va = va.destroy(); }); - it("destroys", function() { + it('destroys', function() { var va = context.createVertexArray({}); expect(va.isDestroyed()).toEqual(false); va.destroy(); expect(va.isDestroyed()).toEqual(true); }); - it("fails to create (missing vertexBuffer and value)", function() { + it('fails to create (missing vertexBuffer and value)', function() { var attributes = [{ componentsPerAttribute : 3 }]; @@ -352,7 +352,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (provides both vertexBuffer and value)", function() { + it('fails to create (provides both vertexBuffer and value)', function() { var buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -366,7 +366,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create with duplicate indices", function() { + it('fails to create with duplicate indices', function() { var buffer = context.createVertexBuffer(1, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -384,7 +384,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (componentsPerAttribute missing)", function() { + it('fails to create (componentsPerAttribute missing)', function() { var buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -396,7 +396,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (componentsPerAttribute < 1)", function() { + it('fails to create (componentsPerAttribute < 1)', function() { var attributes = [{ componentsPerAttribute : 0 }]; @@ -406,7 +406,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (componentsPerAttribute > 4)", function() { + it('fails to create (componentsPerAttribute > 4)', function() { var attributes = [{ componentsPerAttribute : 5 }]; @@ -416,7 +416,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (value.length < 1)", function() { + it('fails to create (value.length < 1)', function() { var attributes = [{ value : [] }]; @@ -426,7 +426,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (value.length > 4)", function() { + it('fails to create (value.length > 4)', function() { var attributes = [{ value : [1.0, 2.0, 3.0, 4.0, 5.0] }]; @@ -436,13 +436,13 @@ defineSuite([ }).toThrow(); }); - it("fails to create (componentDatatype)", function() { + it('fails to create (componentDatatype)', function() { var buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var attributes = [{ vertexBuffer : buffer, componentsPerAttribute : 3, - componentDatatype : "invalid component datatype" + componentDatatype : 'invalid component datatype' }]; expect(function() { @@ -450,7 +450,7 @@ defineSuite([ }).toThrow(); }); - it("fails to create (strideInBytes)", function() { + it('fails to create (strideInBytes)', function() { var buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var attributes = [{ @@ -464,7 +464,7 @@ defineSuite([ }).toThrow(); }); - it("fails to get attribute", function() { + it('fails to get attribute', function() { var va = context.createVertexArray(); expect(function() { @@ -472,7 +472,7 @@ defineSuite([ }).toThrow(); }); - it("fails to add attribute with duplicate index", function() { + it('fails to add attribute with duplicate index', function() { var buffer = context.createVertexBuffer(3, BufferUsage.STATIC_DRAW); var va = context.createVertexArray(); @@ -491,7 +491,7 @@ defineSuite([ }).toThrow(); }); - it("fails to add attribute without vertex buffer", function() { + it('fails to add attribute without vertex buffer', function() { var va = context.createVertexArray(); expect(function() { @@ -499,7 +499,7 @@ defineSuite([ }).toThrow(); }); - it("fails to remove attribute without an index", function() { + it('fails to remove attribute without an index', function() { var va = context.createVertexArray(); expect(function() { @@ -507,7 +507,7 @@ defineSuite([ }).toThrow(); }); - it("fails to destroy", function() { + it('fails to destroy', function() { var va = context.createVertexArray(); va.destroy(); diff --git a/Specs/Scene/BillboardCollectionSpec.js b/Specs/Scene/BillboardCollectionSpec.js index ab84934a385..cd11d8a003a 100644 --- a/Specs/Scene/BillboardCollectionSpec.js +++ b/Specs/Scene/BillboardCollectionSpec.js @@ -69,22 +69,22 @@ defineSuite([ destroyContext(context); }); - it("initialize suite", function() { + it('initialize suite', function() { greenImage = new Image(); - greenImage.src = "./Data/Images/Green.png"; + greenImage.src = './Data/Images/Green.png'; blueImage = new Image(); - blueImage.src = "./Data/Images/Blue.png"; + blueImage.src = './Data/Images/Blue.png'; whiteImage = new Image(); - whiteImage.src = "./Data/Images/White.png"; + whiteImage.src = './Data/Images/White.png'; waitsFor(function() { return greenImage.complete && blueImage.complete && whiteImage.complete; - }, "Load .png file(s) for billboard collection test.", 3000); + }, 'Load .png file(s) for billboard collection test.', 3000); }); - it("default constructs a billboard", function() { + it('default constructs a billboard', function() { var b = billboards.add(); expect(b.getShow()).toEqual(true); expect(b.getPosition().equals(Cartesian3.ZERO)).toEqual(true); @@ -100,7 +100,7 @@ defineSuite([ expect(b.getColor().alpha).toEqual(1.0); }); - it("explicitly constructs a billboard", function() { + it('explicitly constructs a billboard', function() { var b = billboards.add({ show : false, position : new Cartesian3(1.0, 2.0, 3.0), @@ -132,7 +132,7 @@ defineSuite([ expect(b.getColor().alpha).toEqual(4.0); }); - it("set's a billboard's properties", function() { + it('set billboard properties', function() { var b = billboards.add(); b.setShow(false); b.setPosition(new Cartesian3(1.0, 2.0, 3.0)); @@ -163,18 +163,18 @@ defineSuite([ expect(b.getColor().alpha).toEqual(4.0); }); - it("set's a removed billboard's property", function() { + it('set a removed billboard property', function() { var b = billboards.add(); billboards.remove(b); b.setShow(false); expect(b.getShow()).toEqual(false); }); - it("has zero billboards when constructed", function() { + it('has zero billboards when constructed', function() { expect(billboards.getLength()).toEqual(0); }); - it("adds a billboard", function() { + it('adds a billboard', function() { var b = billboards.add({ position : { x : 1.0, @@ -187,7 +187,7 @@ defineSuite([ expect(billboards.get(0).equals(b)).toEqual(true); }); - it("removes the first billboard", function() { + it('removes the first billboard', function() { var one = billboards.add({ position : { x : 1.0, @@ -211,7 +211,7 @@ defineSuite([ expect(billboards.get(0).equals(two)).toEqual(true); }); - it("removes the last billboard", function() { + it('removes the last billboard', function() { var one = billboards.add({ position : { x : 1.0, @@ -235,7 +235,7 @@ defineSuite([ expect(billboards.get(0).equals(one)).toEqual(true); }); - it("removes the same billboard twice", function() { + it('removes the same billboard twice', function() { var b = billboards.add({ position : { x : 1.0, @@ -252,7 +252,7 @@ defineSuite([ expect(billboards.getLength()).toEqual(0); }); - it("removes null", function() { + it('removes null', function() { billboards.add({ position : { x : 1.0, @@ -266,7 +266,7 @@ defineSuite([ expect(billboards.getLength()).toEqual(1); }); - it("adds and removes billboards", function() { + it('adds and removes billboards', function() { var one = billboards.add({ position : { x : 1.0, @@ -298,7 +298,7 @@ defineSuite([ expect(billboards.get(1).equals(three)).toEqual(true); }); - it("removes all billboards", function() { + it('removes all billboards', function() { billboards.add({ position : { x : 1.0, @@ -319,14 +319,14 @@ defineSuite([ expect(billboards.getLength()).toEqual(0); }); - it("contains a billboard", function() { + it('contains a billboard', function() { var b = billboards.add(); billboards.add(b); expect(billboards.contains(b)).toEqual(true); }); - it("doesn't contain a billboard", function() { + it('does not contain a billboard', function() { var b0 = billboards.add(); var b1 = billboards.add(); @@ -337,11 +337,11 @@ defineSuite([ expect(billboards.contains(b0)).toEqual(false); }); - it("doesn't contain undefined", function() { + it('does not contain undefined', function() { expect(billboards.contains()).toBeFalsy(); }); - it("sets and gets a texture atlas", function() { + it('sets and gets a texture atlas', function() { expect(billboards.getTextureAtlas()).not.toBeDefined(); var atlas = createTextureAtlas([greenImage]); @@ -349,7 +349,7 @@ defineSuite([ expect(billboards.getTextureAtlas()).toEqual(atlas); }); - it("destroys a texture atlas", function() { + it('destroys a texture atlas', function() { var b = new BillboardCollection(); expect(b.getDestroyTextureAtlas()).toEqual(true); @@ -360,7 +360,7 @@ defineSuite([ expect(atlas.isDestroyed()).toEqual(true); }); - it("doesn't destroy a texture atlas", function() { + it('does not destroy a texture atlas', function() { var b = new BillboardCollection(); b.setDestroyTextureAtlas(false); @@ -371,7 +371,7 @@ defineSuite([ expect(atlas.isDestroyed()).toEqual(false); }); - it("doesn't render when constructed", function() { + it('does not render when constructed', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -380,7 +380,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("modifies and removes a billboard, then renders", function() { + it('modifies and removes a billboard, then renders', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage, blueImage])); var b = billboards.add({ position : { @@ -417,7 +417,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("renders a green billboard", function() { + it('renders a green billboard', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage])); billboards.add({ position : { @@ -436,7 +436,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("adds and renders a billboard", function() { + it('adds and renders a billboard', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage, blueImage])); billboards.add({ position : { @@ -468,7 +468,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("removes and renders a billboard", function() { + it('removes and renders a billboard', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage, blueImage])); billboards.add({ position : { @@ -503,7 +503,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("removes all billboards and renders", function() { + it('removes all billboards and renders', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage])); billboards.add({ position : { @@ -530,7 +530,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("removes all billboards, adds a billboard, and renders", function() { + it('removes all billboards, adds a billboard, and renders', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage, blueImage])); billboards.add({ position : { @@ -566,7 +566,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("renders with a different texture atlas", function() { + it('renders with a different texture atlas', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage])); billboards.add({ position : { @@ -593,7 +593,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("renders with a different buffer usage", function() { + it('renders with a different buffer usage', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage])); billboards.add({ position : { @@ -619,7 +619,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("renders using billboard's show property", function() { + it('renders using billboard show property', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage, blueImage])); var greenBillboard = billboards.add({ position : { @@ -657,7 +657,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("renders using billboard's position property", function() { + it('renders using billboard position property', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage])); var b = billboards.add({ position : { @@ -697,7 +697,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("renders using billboard's scale property", function() { + it('renders using billboard scale property', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage])); var b = billboards.add({ position : { @@ -729,7 +729,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("renders using billboard's imageIndex property", function() { + it('renders using billboard imageIndex property', function() { billboards.setTextureAtlas(createTextureAtlas([greenImage, blueImage])); var b = billboards.add({ position : { @@ -756,7 +756,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 255, 255]); }); - it("renders using billboard's color property", function() { + it('renders using billboard color property', function() { billboards.setTextureAtlas(createTextureAtlas([whiteImage])); var b = billboards.add({ position : { @@ -802,7 +802,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 255, 0, 255]); }); - it("updates 10% of billboards", function() { + it('updates 10% of billboards', function() { billboards.setTextureAtlas(createTextureAtlas([whiteImage])); for ( var i = 0; i < 10; ++i) { billboards.add({ @@ -851,7 +851,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 0, 0, 255]); }); - it("renders more than 16K billboards", function() { + it('renders more than 16K billboards', function() { billboards.setTextureAtlas(createTextureAtlas([whiteImage])); for ( var i = 0; i < 16 * 1024; ++i) { billboards.add({ @@ -884,7 +884,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([255, 255, 255, 255]); }); - it("is picked", function() { + it('is picked', function() { billboards.setTextureAtlas(createTextureAtlas([whiteImage])); var b = billboards.add({ position : { @@ -901,7 +901,7 @@ defineSuite([ expect(pickedObject).toEqual(b); }); - it("is not picked", function() { + it('is not picked', function() { billboards.setTextureAtlas(createTextureAtlas([whiteImage])); billboards.add({ show : false, @@ -919,7 +919,7 @@ defineSuite([ expect(pickedObject).not.toBeDefined(); }); - it("computes screen space position (1)", function() { + it('computes screen space position (1)', function() { var b = billboards.add({ position : { x : 0.0, @@ -931,7 +931,7 @@ defineSuite([ expect(b.computeScreenSpacePosition(us).equals(new Cartesian2(0.5, 0.5))); }); - it("computes screen space position (2)", function() { + it('computes screen space position (2)', function() { var b = billboards.add({ position : { x : 0.0, @@ -947,7 +947,7 @@ defineSuite([ expect(b.computeScreenSpacePosition(us).equals(new Cartesian2(1.5, 2.5))); }); - it("computes screen space position (3)", function() { + it('computes screen space position (3)', function() { var b = billboards.add({ position : { x : 0.0, @@ -966,7 +966,7 @@ defineSuite([ expect(p.y).toBeGreaterThan(0.5); }); - it("throws when computing screen space position when not in a collection", function() { + it('throws when computing screen space position when not in a collection', function() { var b = billboards.add({ position : { x : 0.0, @@ -981,7 +981,7 @@ defineSuite([ }).toThrow(); }); - it("throws when computing screen space position without uniform state", function() { + it('throws when computing screen space position without uniform state', function() { var b = billboards.add(); expect(function() { @@ -989,7 +989,7 @@ defineSuite([ }).toThrow(); }); - it("equals another billboard", function() { + it('equals another billboard', function() { var b = billboards.add({ position : { x : 1.0, @@ -1020,7 +1020,7 @@ defineSuite([ expect(b.equals(b2)).toEqual(true); }); - it("doesn't equal another billboard", function() { + it('does not equal another billboard', function() { var b = billboards.add({ position : { x : 1.0, @@ -1039,12 +1039,12 @@ defineSuite([ expect(b.equals(b2)).toEqual(false); }); - it("doesn't equal null", function() { + it('does not equal null', function() { var b = billboards.add({}); expect(b.equals(null)).toBeFalsy(); }); - it("throws when accessing without an index", function() { + it('throws when accessing without an index', function() { expect(function() { billboards.get(); }).toThrow(); diff --git a/Specs/Scene/Camera2DControllerSpec.js b/Specs/Scene/Camera2DControllerSpec.js index 6901adf05a6..02180d47bbe 100644 --- a/Specs/Scene/Camera2DControllerSpec.js +++ b/Specs/Scene/Camera2DControllerSpec.js @@ -68,39 +68,39 @@ defineSuite([ controller2 = controller2 && !controller2.isDestroyed() && controller2.destroy(); }); - it("setReferenceFrame", function() { + it('setReferenceFrame', function() { var transform = Transforms.eastNorthUpToFixedFrame(ellipsoid.cartographicDegreesToCartesian(new Cartographic2(-75.0, 40.0))); controller.setReferenceFrame(transform, ellipsoid); expect(controller.getEllipsoid()).toBe(ellipsoid); expect(controller._camera.transform).toBe(transform); }); - it("setEllipsoid", function() { + it('setEllipsoid', function() { controller.setEllipsoid(Ellipsoid.UNIT_SPHERE); expect(controller.getEllipsoid().equals(Ellipsoid.UNIT_SPHERE)).toEqual(true); }); - it("moveUp", function() { + it('moveUp', function() { controller.moveUp(moverate); expect(camera.position.equalsEpsilon(new Cartesian3(0.0, moverate, 0.0), CesiumMath.EPSILON10)).toEqual(true); }); - it("moveDown", function() { + it('moveDown', function() { controller.moveDown(moverate); expect(camera.position.equalsEpsilon(new Cartesian3(0.0, -moverate, 0.0), CesiumMath.EPSILON10)).toEqual(true); }); - it("moveRight", function() { + it('moveRight', function() { controller.moveRight(moverate); expect(camera.position.equalsEpsilon(new Cartesian3(moverate, 0.0, 0.0), CesiumMath.EPSILON10)).toEqual(true); }); - it("moveLeft", function() { + it('moveLeft', function() { controller.moveLeft(moverate); expect(camera.position.equalsEpsilon(new Cartesian3(-moverate, 0.0, 0.0), CesiumMath.EPSILON10)).toEqual(true); }); - it("translate", function() { + it('translate', function() { controller._translate({ startPosition : new Cartesian2(0.0, 0.0), endPosition : new Cartesian2(10.0, 10.0) @@ -108,7 +108,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(new Cartesian3(100000.0, 100000.0, 0.0))).toEqual(true); }); - it("zoom", function() { + it('zoom', function() { var offset = 0.5 * Math.max(camera.frustum.right - camera.frustum.left, camera.frustum.top - camera.frustum.bottom); var ratio = frustum.top / frustum.right; controller._zoom({ @@ -121,7 +121,7 @@ defineSuite([ expect(frustum.bottom).toEqual(-ratio * (controller._zoomRate + offset), CesiumMath.EPSILON10); }); - it("zoomOut", function() { + it('zoomOut', function() { controller.zoomOut(zoomrate); expect(frustum.right).toEqualEpsilon(3.0, CesiumMath.EPSILON10); expect(frustum.left).toEqual(-3.0, CesiumMath.EPSILON10); @@ -129,7 +129,7 @@ defineSuite([ expect(frustum.bottom).toEqual(-1.5, CesiumMath.EPSILON10); }); - it("zoomIn", function() { + it('zoomIn', function() { controller.zoomIn(zoomrate); expect(frustum.right).toEqualEpsilon(1.0, CesiumMath.EPSILON10); expect(frustum.left).toEqual(-1.0, CesiumMath.EPSILON10); @@ -137,7 +137,7 @@ defineSuite([ expect(frustum.bottom).toEqual(-0.5, CesiumMath.EPSILON10); }); - it("zoomIn throws with null OrthogrphicFrustum properties", function() { + it('zoomIn throws with null OrthogrphicFrustum properties', function() { var camera = new Camera(document); camera.frustum = new OrthographicFrustum(); controller2 = new Camera2DController(document, camera, ellipsoid); @@ -146,7 +146,7 @@ defineSuite([ }).toThrow(); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(controller.isDestroyed()).toEqual(false); controller.destroy(); expect(controller.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/CameraColumbusViewControllerSpec.js b/Specs/Scene/CameraColumbusViewControllerSpec.js index 6252a0f8da3..d22ed6cd598 100644 --- a/Specs/Scene/CameraColumbusViewControllerSpec.js +++ b/Specs/Scene/CameraColumbusViewControllerSpec.js @@ -28,12 +28,12 @@ defineSuite([ controller = controller && !controller.isDestroyed() && controller.destroy(); }); - it("updateReferenceFrame", function() { + it('updateReferenceFrame', function() { controller._updateReferenceFrame(); expect(camera.position.equalsEpsilon(Cartesian3.ZERO, CesiumMath.EPSILON10)).toEqual(true); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(controller.isDestroyed()).toEqual(false); controller.destroy(); expect(controller.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/CameraControllerCollectionSpec.js b/Specs/Scene/CameraControllerCollectionSpec.js index 0a2ab9666f3..3cfcd944340 100644 --- a/Specs/Scene/CameraControllerCollectionSpec.js +++ b/Specs/Scene/CameraControllerCollectionSpec.js @@ -30,35 +30,35 @@ defineSuite([ collection = collection && !collection.isDestroyed() && collection.destroy(); }); - it("add2D", function() { + it('add2D', function() { expect(function() { collection.add2D(); }).not.toThrow(); expect(collection.getLength()).toEqual(1); }); - it("addSpindle", function() { + it('addSpindle', function() { expect(function() { collection.addSpindle(); }).not.toThrow(); expect(collection.getLength()).toEqual(1); }); - it("addFreeLook", function() { + it('addFreeLook', function() { expect(function() { collection.addFreeLook(); }).not.toThrow(); expect(collection.getLength()).toEqual(1); }); - it("addColumbusView", function() { + it('addColumbusView', function() { expect(function() { collection.addColumbusView(); }).not.toThrow(); expect(collection.getLength()).toEqual(1); }); - it("addFlight", function() { + it('addFlight', function() { expect(function() { collection.addFlight({ destination : Ellipsoid.WGS84.cartographicDegreesToCartesian(new Cartographic3(-118.26, 34.19, 100000.0)), // Los Angeles @@ -68,29 +68,29 @@ defineSuite([ expect(collection.getLength()).toEqual(1); }); - it("get throws without index", function() { + it('get throws without index', function() { expect(function() { collection.get(); }).toThrow(); }); - it("get", function() { + it('get', function() { expect(collection.addSpindle()).toBe(collection.get(0)); }); - it("contains", function() { + it('contains', function() { var spindle = collection.addSpindle(); expect(collection.contains(spindle)).toEqual(true); collection.remove(spindle); expect(collection.contains(spindle)).toEqual(false); }); - it("does not contain", function() { + it('does not contain', function() { expect(collection.contains(new CameraFreeLookController(document, camera))).toEqual(false); expect(collection.contains()).toEqual(false); }); - it("update", function() { + it('update', function() { collection.add2D(); collection.addColumbusView(); expect(function() { @@ -99,7 +99,7 @@ defineSuite([ expect(collection.getLength()).toEqual(2); }); - it("update removes expired controllers", function() { + it('update removes expired controllers', function() { var flight = collection.addFlight({ destination : Ellipsoid.WGS84.cartographicDegreesToCartesian(new Cartographic3(-118.26, 34.19, 100000.0)), // Los Angeles duration : 4.0 @@ -110,15 +110,15 @@ defineSuite([ expect(collection.getLength()).toEqual(0); }); - it("remove", function() { + it('remove', function() { expect(collection.remove(collection.addSpindle())).toEqual(true); }); - it("remove returns false without controller", function() { + it('remove returns false without controller', function() { expect(collection.remove()).toEqual(false); }); - it("removeAll", function() { + it('removeAll', function() { collection.addSpindle(); collection.addFreeLook(); expect(collection.getLength()).toEqual(2); @@ -126,7 +126,7 @@ defineSuite([ expect(collection.getLength()).toEqual(0); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(collection.isDestroyed()).toEqual(false); collection.destroy(); expect(collection.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/CameraEventHandlerSpec.js b/Specs/Scene/CameraEventHandlerSpec.js index f9baf179476..01ea0085a25 100644 --- a/Specs/Scene/CameraEventHandlerSpec.js +++ b/Specs/Scene/CameraEventHandlerSpec.js @@ -22,51 +22,51 @@ defineSuite([ handler2 = handler2 && !handler2.isDestroyed() && handler2.destroy(); }); - it("throws without a canvas", function() { + it('throws without a canvas', function() { expect(function() { handler2 = new CameraEventHandler(); }).toThrow(); }); - it("throws without a moveType", function() { + it('throws without a moveType', function() { expect(function() { handler2 = new CameraEventHandler(document); }).toThrow(); }); - it("throws if the event type is not of CameraEventType", function() { + it('throws if the event type is not of CameraEventType', function() { expect(function() { handler2 = new CameraEventHandler(document, MouseEventType.LEFT_CLICK); }).toThrow(); }); - it("can be constructed using the middle drag event type", function() { + it('can be constructed using the middle drag event type', function() { expect(function(){ handler2 = new CameraEventHandler(document, CameraEventType.MIDDLE_DRAG); }).not.toThrow(); }); - it("getMovement", function() { + it('getMovement', function() { expect(handler.getMovement()).toBeFalsy(); }); - it("isMoving", function() { + it('isMoving', function() { expect(handler.isMoving()).toEqual(false); }); - it("isButtonDown", function() { + it('isButtonDown', function() { expect(handler.isButtonDown()).toEqual(false); }); - it("getButtonPressTime", function() { + it('getButtonPressTime', function() { expect(handler.getButtonPressTime()).toEqual(null); }); - it("getButtonReleaseTime", function() { + it('getButtonReleaseTime', function() { expect(handler.getButtonReleaseTime()).toEqual(null); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(handler.isDestroyed()).toEqual(false); handler.destroy(); expect(handler.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/CameraFreeLookControllerSpec.js b/Specs/Scene/CameraFreeLookControllerSpec.js index 7d04a0227a8..68b6efc9864 100644 --- a/Specs/Scene/CameraFreeLookControllerSpec.js +++ b/Specs/Scene/CameraFreeLookControllerSpec.js @@ -52,7 +52,7 @@ defineSuite([ cflc = cflc && !cflc.isDestroyed() && cflc.destroy(); }); - it("move forward", function() { + it('move forward', function() { cflc.moveForward(moverate); expect(camera.position.equals(new Cartesian3(0.0, 0.0, -moverate))).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -60,7 +60,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("move backward", function() { + it('move backward', function() { cflc.moveBackward(moverate); expect(camera.position.equals(new Cartesian3(0.0, 0.0, moverate))).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -68,7 +68,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("move up", function() { + it('move up', function() { cflc.moveUp(moverate); expect(camera.position.equals(new Cartesian3(0.0, moverate, 0.0))).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -76,7 +76,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("move down", function() { + it('move down', function() { cflc.moveDown(moverate); expect(camera.position.equals(new Cartesian3(0.0, -moverate, 0.0))).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -84,7 +84,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("move left", function() { + it('move left', function() { cflc.moveLeft(moverate); expect(camera.position.equals(new Cartesian3(-moverate, 0.0, 0.0))).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -92,7 +92,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("move right", function() { + it('move right', function() { cflc.moveRight(moverate); expect(camera.position.equals(new Cartesian3(moverate, 0.0, 0.0))).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -100,7 +100,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("look left", function() { + it('look left', function() { cflc.lookLeft(turnrate); expect(camera.position.equals(position)).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -108,7 +108,7 @@ defineSuite([ expect(camera.right.equalsEpsilon(dir, CesiumMath.EPSILON15)).toEqual(true); }); - it("look right", function() { + it('look right', function() { cflc.lookRight(turnrate); expect(camera.position.equals(position)).toEqual(true); expect(camera.up.equals(up)).toEqual(true); @@ -116,7 +116,7 @@ defineSuite([ expect(camera.right.equalsEpsilon(dir.negate(), CesiumMath.EPSILON15)).toEqual(true); }); - it("look up", function() { + it('look up', function() { cflc.lookUp(turnrate); expect(camera.position.equals(position)).toEqual(true); expect(camera.right.equals(right)).toEqual(true); @@ -124,7 +124,7 @@ defineSuite([ expect(camera.up.equalsEpsilon(dir.negate(), CesiumMath.EPSILON15)).toEqual(true); }); - it("look down", function() { + it('look down', function() { cflc.lookDown(turnrate); expect(camera.position.equals(position)).toEqual(true); expect(camera.right.equals(right)).toEqual(true); @@ -132,7 +132,7 @@ defineSuite([ expect(camera.up.equalsEpsilon(dir, CesiumMath.EPSILON15)).toEqual(true); }); - it("rotate", function() { + it('rotate', function() { cflc.rotate(Cartesian3.UNIT_X, CesiumMath.PI); expect(camera.position.equals(position)).toEqual(true); expect(camera.right.equals(right)).toEqual(true); @@ -140,7 +140,7 @@ defineSuite([ expect(camera.direction.equalsEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON10)).toEqual(true); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(cflc.isDestroyed()).toEqual(false); cflc.destroy(); expect(cflc.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/CameraSpec.js b/Specs/Scene/CameraSpec.js index db607eb1585..c39c4d74ee2 100644 --- a/Specs/Scene/CameraSpec.js +++ b/Specs/Scene/CameraSpec.js @@ -35,18 +35,18 @@ defineSuite([ camera.frustum.aspectRatio = 1.0; }); - it("constructor throws an exception when there is no canvas", function() { + it('constructor throws an exception when there is no canvas', function() { expect(function() { return new Camera(); }).toThrow(); }); - it("getControllers", function() { + it('getControllers', function() { var controllers = camera.getControllers(); expect(controllers).toEqual(new CameraControllerCollection(camera, document)); }); - it("lookAt object", function() { + it('lookAt object', function() { var target = Cartesian3.ZERO; var newPosition = new Cartesian3(1.0, 1.0, 1.0); var newDirection = target.subtract(newPosition).normalize(); @@ -62,7 +62,7 @@ defineSuite([ expect(tempCamera.up.equals(newUp)).toEqual(true); }); - it("lookAt array", function() { + it('lookAt array', function() { var target = Cartesian3.ZERO; var newPosition = new Cartesian3(1.0, 1.0, 1.0); var newDirection = target.subtract(newPosition).normalize(); @@ -74,7 +74,7 @@ defineSuite([ expect(tempCamera.up.equals(newUp)).toEqual(true); }); - it("lookAt returns without proper arguments", function() { + it('lookAt returns without proper arguments', function() { var eye = new Cartesian3(1, 1, 1); camera.lookAt(eye); @@ -86,7 +86,7 @@ defineSuite([ expect(camera.position.equals(eye)).toEqual(false); }); - it("get view matrix", function() { + it('get view matrix', function() { var viewMatrix = camera.getViewMatrix(); var position = camera.position; var up = camera.up; @@ -104,7 +104,7 @@ defineSuite([ expect(viewMatrix.equals(expected)).toEqual(true); }); - it("viewExtent", function() { + it('viewExtent', function() { var west = -CesiumMath.PI_OVER_TWO; var south = -CesiumMath.PI_OVER_TWO; var east = CesiumMath.PI_OVER_TWO; @@ -116,26 +116,26 @@ defineSuite([ expect(camera.right.equalsEpsilon(new Cartesian3(0.0, 1.0, 0.0), CesiumMath.EPSILON10)); }); - it("get inverse view matrix", function() { + it('get inverse view matrix', function() { var expected = camera.getViewMatrix().inverse(); expect(expected.equals(camera.getInverseViewMatrix())).toEqual(true); }); - it("get inverse transform", function() { + it('get inverse transform', function() { camera.transform = new Matrix4(5.0, 0.0, 0.0, 1.0, 0.0, 5.0, 0.0, 2.0, 0.0, 0.0, 5.0, 3.0, 0.0, 0.0, 0.0, 1.0); var expected = camera.transform.inverseTransformation(); expect(expected.equals(camera.getInverseTransform())).toEqual(true); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(camera.isDestroyed()).toEqual(false); camera.destroy(); expect(camera.isDestroyed()).toEqual(true); }); - describe("box intersections", function() { + describe('box intersections', function() { - it("can contain an axis aligned bounding box", function() { + it('can contain an axis aligned bounding box', function() { var box1 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 0, -1.25), new Cartesian3(0.5, 0, -1.25), @@ -145,9 +145,9 @@ defineSuite([ expect(camera.getVisibility(box1, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.INSIDE); }); - describe("can partially contain an axis aligned bounding box", function() { + describe('can partially contain an axis aligned bounding box', function() { - it("on the far plane", function() { + it('on the far plane', function() { var box2 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 0, -1.5), new Cartesian3(0.5, 0, -1.5), @@ -157,7 +157,7 @@ defineSuite([ expect(camera.getVisibility(box2, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the near plane", function() { + it('on the near plane', function() { var box3 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 0, -0.5), new Cartesian3(0.5, 0, -0.5), @@ -167,7 +167,7 @@ defineSuite([ expect(camera.getVisibility(box3, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the left plane", function() { + it('on the left plane', function() { var box4 = new AxisAlignedBoundingBox([ new Cartesian3(-1.5, 0, -1.25), new Cartesian3(0, 0, -1.25), @@ -177,7 +177,7 @@ defineSuite([ expect(camera.getVisibility(box4, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the right plane", function() { + it('on the right plane', function() { var box5 = new AxisAlignedBoundingBox([ new Cartesian3(0, 0, -1.25), new Cartesian3(1.5, 0, -1.25), @@ -187,7 +187,7 @@ defineSuite([ expect(camera.getVisibility(box5, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the top plane", function() { + it('on the top plane', function() { var box6 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 0, -1.25), new Cartesian3(0.5, 0, -1.25), @@ -197,7 +197,7 @@ defineSuite([ expect(camera.getVisibility(box6, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the bottom plane", function() { + it('on the bottom plane', function() { var box7 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, -2.0, -1.25), new Cartesian3(0.5, 0, -1.25), @@ -208,9 +208,9 @@ defineSuite([ }); }); - describe("can not contain an axis aligned bounding box", function() { + describe('can not contain an axis aligned bounding box', function() { - it("past the far plane", function() { + it('past the far plane', function() { var box8 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 0, -2.25), new Cartesian3(0.5, 0, -2.25), @@ -220,7 +220,7 @@ defineSuite([ expect(camera.getVisibility(box8, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.OUTSIDE); }); - it("before the near plane", function() { + it('before the near plane', function() { var box9 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 0, -0.25), new Cartesian3(0.5, 0, -0.25), @@ -230,7 +230,7 @@ defineSuite([ expect(camera.getVisibility(box9, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the left plane", function() { + it('past the left plane', function() { var box10 = new AxisAlignedBoundingBox([ new Cartesian3(-5, 0, -1.25), new Cartesian3(-3, 0, -1.25), @@ -240,7 +240,7 @@ defineSuite([ expect(camera.getVisibility(box10, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the right plane", function() { + it('past the right plane', function() { var box11 = new AxisAlignedBoundingBox([ new Cartesian3(3, 0, -1.25), new Cartesian3(5, 0, -1.25), @@ -250,7 +250,7 @@ defineSuite([ expect(camera.getVisibility(box11, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the top plane", function() { + it('past the top plane', function() { var box12 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, 3, -1.25), new Cartesian3(0.5, 3, -1.25), @@ -260,7 +260,7 @@ defineSuite([ expect(camera.getVisibility(box12, AxisAlignedBoundingBox.planeAABBIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the bottom plane", function() { + it('past the bottom plane', function() { var box13 = new AxisAlignedBoundingBox([ new Cartesian3(-0.5, -3, -1.25), new Cartesian3(0.5, -3, -1.25), @@ -273,74 +273,74 @@ defineSuite([ }); }); - describe("sphere intersection", function() { + describe('sphere intersection', function() { - it("can contain a sphere", function() { + it('can contain a sphere', function() { var sphere1 = new BoundingSphere([new Cartesian3(0, 0, -1.25), new Cartesian3(0, 0, -1.75)]); expect(camera.getVisibility(sphere1, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INSIDE); }); - describe("can partially contain a sphere", function() { + describe('can partially contain a sphere', function() { - it("on the far plane", function() { + it('on the far plane', function() { var sphere2 = new BoundingSphere([new Cartesian3(0, 0, -1.5), new Cartesian3(0, 0, -2.5)]); expect(camera.getVisibility(sphere2, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the near plane", function() { + it('on the near plane', function() { var sphere3 = new BoundingSphere([new Cartesian3(0, 0, -0.5), new Cartesian3(0, 0, -1.5)]); expect(camera.getVisibility(sphere3, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the left plane", function() { + it('on the left plane', function() { var sphere4 = new BoundingSphere([new Cartesian3(-1.0, 0, -1.5), new Cartesian3(0, 0, -1.5)]); expect(camera.getVisibility(sphere4, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the right plane", function() { + it('on the right plane', function() { var sphere5 = new BoundingSphere([new Cartesian3(0, 0, -1.5), new Cartesian3(1.0, 0, -1.5)]); expect(camera.getVisibility(sphere5, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the top plane", function() { + it('on the top plane', function() { var sphere6 = new BoundingSphere([new Cartesian3(0, 0, -1.5), new Cartesian3(0, 2.0, -1.5)]); expect(camera.getVisibility(sphere6, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INTERSECTING); }); - it("on the bottom plane", function() { + it('on the bottom plane', function() { var sphere7 = new BoundingSphere([new Cartesian3(0, -2.0, -1.5), new Cartesian3(0, 0, -1.5)]); expect(camera.getVisibility(sphere7, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.INTERSECTING); }); }); - describe("can not contain a sphere", function() { + describe('can not contain a sphere', function() { - it("past the far plane", function() { + it('past the far plane', function() { var sphere8 = new BoundingSphere([new Cartesian3(0, 0, -2.25), new Cartesian3(0, 0, -2.75)]); expect(camera.getVisibility(sphere8, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.OUTSIDE); }); - it("before the near plane", function() { + it('before the near plane', function() { var sphere9 = new BoundingSphere([new Cartesian3(0, 0, -0.25), new Cartesian3(0, 0, -0.5)]); expect(camera.getVisibility(sphere9, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the left plane", function() { + it('past the left plane', function() { var sphere10 = new BoundingSphere([new Cartesian3(-5, 0, -1.25), new Cartesian3(-4.5, 0, -1.75)]); expect(camera.getVisibility(sphere10, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the right plane", function() { + it('past the right plane', function() { var sphere11 = new BoundingSphere([new Cartesian3(4.5, 0, -1.25), new Cartesian3(5, 0, -1.75)]); expect(camera.getVisibility(sphere11, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the top plane", function() { + it('past the top plane', function() { var sphere12 = new BoundingSphere([new Cartesian3(-0.5, 4.5, -1.25), new Cartesian3(-0.5, 5, -1.25)]); expect(camera.getVisibility(sphere12, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.OUTSIDE); }); - it("past the bottom plane", function() { + it('past the bottom plane', function() { var sphere13 = new BoundingSphere([new Cartesian3(-0.5, -4.5, -1.25), new Cartesian3(-0.5, -5, -1.25)]); expect(camera.getVisibility(sphere13, BoundingSphere.planeSphereIntersect)).toEqual(Intersect.OUTSIDE); }); diff --git a/Specs/Scene/CameraSpindleControllerSpec.js b/Specs/Scene/CameraSpindleControllerSpec.js index 5bd368bab87..6e5adf78725 100644 --- a/Specs/Scene/CameraSpindleControllerSpec.js +++ b/Specs/Scene/CameraSpindleControllerSpec.js @@ -62,20 +62,20 @@ defineSuite([ csc2 = csc2 && !csc2.isDestroyed() && csc2.destroy(); }); - it("setEllipsoid", function() { + it('setEllipsoid', function() { expect(csc.getEllipsoid()).toEqual(Ellipsoid.WGS84); csc.setEllipsoid(Ellipsoid.UNIT_SPHERE); expect(csc.getEllipsoid()).toEqual(Ellipsoid.UNIT_SPHERE); }); - it("setReferenceFrame", function() { + it('setReferenceFrame', function() { var transform = Transforms.eastNorthUpToFixedFrame(Ellipsoid.UNIT_SPHERE.cartographicDegreesToCartesian(new Cartographic2(-76.0, 40.0))); csc.setReferenceFrame(transform, Ellipsoid.UNIT_SPHERE); expect(csc.getEllipsoid()).toEqual(Ellipsoid.UNIT_SPHERE); expect(camera.transform.equals(transform)).toEqual(true); }); - it("move up", function() { + it('move up', function() { csc.moveUp(rotaterate); expect(camera.up.equalsEpsilon(dir.negate(), CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(up, CesiumMath.EPSILON15)).toEqual(true); @@ -83,7 +83,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(Cartesian3.UNIT_Y.negate(), CesiumMath.EPSILON15)).toEqual(true); }); - it("move up with constrained Z", function() { + it('move up with constrained Z', function() { csc.moveUpWithConstrainedZ(rotaterate); expect(camera.up.equalsEpsilon(up, CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(dir, CesiumMath.EPSILON15)).toEqual(true); @@ -91,7 +91,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(position, CesiumMath.EPSILON15)).toEqual(true); }); - it("move down", function() { + it('move down', function() { csc.moveDown(rotaterate); expect(camera.up.equalsEpsilon(dir, CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(up.negate(), CesiumMath.EPSILON15)).toEqual(true); @@ -99,7 +99,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(Cartesian3.UNIT_Y, CesiumMath.EPSILON15)).toEqual(true); }); - it("move down with constrained Z", function() { + it('move down with constrained Z', function() { csc.moveDownWithConstrainedZ(-rotaterate); expect(camera.up.equalsEpsilon(up, CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(dir, CesiumMath.EPSILON15)).toEqual(true); @@ -107,7 +107,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(position, CesiumMath.EPSILON15)).toEqual(true); }); - it("move left", function() { + it('move left', function() { csc.moveLeft(rotaterate); expect(camera.up.equalsEpsilon(up, CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(right, CesiumMath.EPSILON15)).toEqual(true); @@ -115,7 +115,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(Cartesian3.UNIT_X.negate(), CesiumMath.EPSILON15)).toEqual(true); }); - it("move left with contrained Z", function() { + it('move left with contrained Z', function() { csc.moveLeftWithConstrainedZ(rotaterate); expect(camera.up.equalsEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(Cartesian3.UNIT_Z.negate(), CesiumMath.EPSILON15)).toEqual(true); @@ -123,7 +123,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON15)).toEqual(true); }); - it("move right", function() { + it('move right', function() { csc.moveRight(rotaterate); expect(camera.up.equalsEpsilon(up, CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(right.negate(), CesiumMath.EPSILON15)).toEqual(true); @@ -131,7 +131,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(Cartesian3.UNIT_X, CesiumMath.EPSILON15)).toEqual(true); }); - it("move right with contrained Z", function() { + it('move right with contrained Z', function() { csc.moveRightWithConstrainedZ(rotaterate); expect(camera.up.equalsEpsilon(Cartesian3.UNIT_X.negate(), CesiumMath.EPSILON15)).toEqual(true); expect(camera.direction.equalsEpsilon(Cartesian3.UNIT_Z.negate(), CesiumMath.EPSILON15)).toEqual(true); @@ -139,7 +139,7 @@ defineSuite([ expect(camera.position.equalsEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON15)).toEqual(true); }); - it("zoom in", function() { + it('zoom in', function() { camera.position = new Cartesian3(); csc.zoomIn(moverate); expect(camera.position.equals(new Cartesian3(0.0, 0.0, -moverate))).toEqual(true); @@ -148,7 +148,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("zoom out", function() { + it('zoom out', function() { camera.position = new Cartesian3(); csc.zoomOut(moverate); expect(camera.position.equals(new Cartesian3(0.0, 0.0, moverate))).toEqual(true); @@ -157,7 +157,7 @@ defineSuite([ expect(camera.right.equals(right)).toEqual(true); }); - it("rotate", function() { + it('rotate', function() { var camera2 = new Camera(document); camera2.position = position; camera2.up = up; @@ -179,7 +179,7 @@ defineSuite([ expect(camera.right.equalsEpsilon(camera2.right, CesiumMath.EPSILON15)); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(csc.isDestroyed()).toEqual(false); csc.destroy(); expect(csc.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/CompositePrimitiveSpec.js b/Specs/Scene/CompositePrimitiveSpec.js index 20b96abd1fd..7b65187eecf 100644 --- a/Specs/Scene/CompositePrimitiveSpec.js +++ b/Specs/Scene/CompositePrimitiveSpec.js @@ -74,7 +74,7 @@ defineSuite([ y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -95,26 +95,26 @@ defineSuite([ return polygon; } - it("gets default show", function() { + it('gets default show', function() { expect(primitives.show).toEqual(true); }); - it("get throws if index is undefined", function() { + it('get throws if index is undefined', function() { expect(function() { primitives.get(undefined); }).toThrow(); }); - it("has zero primitives when constructed", function() { + it('has zero primitives when constructed', function() { expect(primitives.getLength()).toEqual(0); }); - it("adds a primitive with add()", function() { + it('adds a primitive with add()', function() { primitives.add(createLabels()); expect(primitives.getLength()).toEqual(1); }); - it("removes the first primitive", function() { + it('removes the first primitive', function() { var p0 = createLabels(); var p1 = createLabels(); @@ -131,7 +131,7 @@ defineSuite([ expect(primitives.getLength()).toEqual(0); }); - it("removes the last primitive", function() { + it('removes the last primitive', function() { var p0 = createLabels(); var p1 = createLabels(); @@ -148,7 +148,7 @@ defineSuite([ expect(primitives.getLength()).toEqual(0); }); - it("removes a primitive twice", function() { + it('removes a primitive twice', function() { var p0 = createLabels(); primitives.add(p0); @@ -156,11 +156,11 @@ defineSuite([ expect(primitives.remove(p0)).toEqual(false); }); - it("removes null", function() { + it('removes null', function() { expect(primitives.remove()).toEqual(false); }); - it("removes all primitives", function() { + it('removes all primitives', function() { primitives.add(createLabels()); primitives.add(createLabels()); primitives.add(createLabels()); @@ -171,14 +171,14 @@ defineSuite([ expect(primitives.getLength()).toEqual(0); }); - it("contains a primitive", function() { + it('contains a primitive', function() { var labels = createLabels(); primitives.add(labels); expect(primitives.contains(labels)).toEqual(true); }); - it("doesn't contain a primitive", function() { + it('does not contain a primitive', function() { var labels0 = createLabels(); var labels1 = createLabels(); primitives.add(labels0); @@ -186,11 +186,11 @@ defineSuite([ expect(primitives.contains(labels1)).toEqual(false); }); - it("doesn't contain undefined", function() { + it('does not contain undefined', function() { expect(primitives.contains()).toEqual(false); }); - it("adds and removes a primitive in two composites", function() { + it('adds and removes a primitive in two composites', function() { var p = createLabels(); primitives.add(p); @@ -220,7 +220,7 @@ defineSuite([ otherPrimitives.destroy(); }); - it("doesn't remove from a second composite", function() { + it('does not remove from a second composite', function() { var p = createLabels(); primitives.add(p); @@ -230,11 +230,11 @@ defineSuite([ expect(otherPrimitives.remove(p)).toEqual(false); }); - it("gets default destroyPrimitives", function() { + it('gets default destroyPrimitives', function() { expect(primitives.destroyPrimitives).toEqual(true); }); - it("setting a central body", function() { + it('setting a central body', function() { var ellipsoid = Ellipsoid.UNIT_SPHERE; var cb = new CentralBody(ellipsoid); primitives.setCentralBody(cb); @@ -242,7 +242,7 @@ defineSuite([ expect(primitives.getCentralBody()).toBe(cb); }); - it("renders a central body", function() { + it('renders a central body', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -254,7 +254,7 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("renders a primitive added with add()", function() { + it('renders a primitive added with add()', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -264,7 +264,7 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("doesn't render", function() { + it('does not render', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -275,7 +275,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("renders a primitive in more than one composite", function() { + it('renders a primitive in more than one composite', function() { var otherPrimitives = new CompositePrimitive(context); context.clear(); @@ -301,7 +301,7 @@ defineSuite([ otherPrimitives.destroy(); }); - it("renders child composites", function() { + it('renders child composites', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -314,7 +314,7 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("picks a primitive added with add()", function() { + it('picks a primitive added with add()', function() { var labels = createLabels(); var l = labels.get(0); @@ -325,7 +325,7 @@ defineSuite([ expect(pickedObject).toEqual(l); }); - it("doesn't pick", function() { + it('does not pick', function() { var labels = createLabels(); primitives.show = false; @@ -336,7 +336,7 @@ defineSuite([ expect(pickedObject).not.toBeDefined(); }); - it("picks child composites", function() { + it('picks child composites', function() { var labels = createLabels(); var l = labels.get(0); @@ -350,7 +350,7 @@ defineSuite([ expect(pickedObject).toEqual(l); }); - it("picks a primitive added with render order (0)", function() { + it('picks a primitive added with render order (0)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -362,7 +362,7 @@ defineSuite([ expect(pickedObject).toEqual(p1); }); - it("picks a primitive added with render order (1)", function() { + it('picks a primitive added with render order (1)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -374,7 +374,7 @@ defineSuite([ expect(pickedObject).toEqual(p0); }); - it("picks a primitive added with bringForward (0)", function() { + it('picks a primitive added with bringForward (0)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -387,7 +387,7 @@ defineSuite([ expect(pickedObject).toEqual(p1); }); - it("picks a primitive added with bringForward (1)", function() { + it('picks a primitive added with bringForward (1)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -400,7 +400,7 @@ defineSuite([ expect(pickedObject).toEqual(p0); }); - it("picks a primitive added with bringToFront (0)", function() { + it('picks a primitive added with bringToFront (0)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -413,7 +413,7 @@ defineSuite([ expect(pickedObject).toEqual(p1); }); - it("picks a primitive added with bringToFront (1)", function() { + it('picks a primitive added with bringToFront (1)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -426,7 +426,7 @@ defineSuite([ expect(pickedObject).toEqual(p0); }); - it("picks a primitive added with sendBackward (0)", function() { + it('picks a primitive added with sendBackward (0)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -439,7 +439,7 @@ defineSuite([ expect(pickedObject).toEqual(p0); }); - it("picks a primitive added with sendBackward (1)", function() { + it('picks a primitive added with sendBackward (1)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -452,7 +452,7 @@ defineSuite([ expect(pickedObject).toEqual(p1); }); - it("picks a primitive added with sendToBack (0)", function() { + it('picks a primitive added with sendToBack (0)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -465,7 +465,7 @@ defineSuite([ expect(pickedObject).toEqual(p0); }); - it("picks a primitive added with sendToBack (1)", function() { + it('picks a primitive added with sendToBack (1)', function() { var p0 = createPolygon(); var p1 = createPolygon(); @@ -478,17 +478,17 @@ defineSuite([ expect(pickedObject).toEqual(p1); }); - it("is not destroyed when first constructed", function() { + it('is not destroyed when first constructed', function() { expect(primitives.isDestroyed()).toEqual(false); }); - it("is destroyed after calling destroy()", function() { + it('is destroyed after calling destroy()', function() { var p = new CompositePrimitive(); p.destroy(); expect(p.isDestroyed()).toEqual(true); }); - it("destroys its primitives", function() { + it('destroys its primitives', function() { var labels = new LabelCollection(context); primitives.add(labels); @@ -498,7 +498,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("destroys children", function() { + it('destroys children', function() { var labels = new LabelCollection(context); var children = new CompositePrimitive(); @@ -513,7 +513,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("destroys primitive on remove", function() { + it('destroys primitive on remove', function() { var labels = new LabelCollection(context); primitives.add(labels); @@ -523,7 +523,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("destroys primitive on removeAll", function() { + it('destroys primitive on removeAll', function() { var labels = new LabelCollection(context); primitives.add(labels); @@ -533,7 +533,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("destroys primitive on setCentralBody", function() { + it('destroys primitive on setCentralBody', function() { var cb = new CentralBody(Ellipsoid.UNIT_SPHERE); primitives.setCentralBody(cb); @@ -543,7 +543,7 @@ defineSuite([ expect(cb.isDestroyed()).toEqual(true); }); - it("doesn't destroy its primitives", function() { + it('does not destroy its primitives', function() { var labels = new LabelCollection(context); primitives.destroyPrimitives = false; @@ -557,7 +557,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("doesn't destroy primitive on remove", function() { + it('does not destroy primitive on remove', function() { var labels = new LabelCollection(context); primitives.destroyPrimitives = false; @@ -571,7 +571,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("doesn't destroy primitive on removeAll", function() { + it('does not destroy primitive on removeAll', function() { var labels = new LabelCollection(context); primitives.destroyPrimitives = false; @@ -585,7 +585,7 @@ defineSuite([ expect(labels.isDestroyed()).toEqual(true); }); - it("doesn't destroy primitive on setCentralBody", function() { + it('does not destroy primitive on setCentralBody', function() { var cb = new CentralBody(Ellipsoid.UNIT_SPHERE); primitives.destroyPrimitives = false; @@ -599,13 +599,13 @@ defineSuite([ expect(cb.isDestroyed()).toEqual(true); }); - it("throws when add() without an primitive", function() { + it('throws when add() without an primitive', function() { expect(function() { primitives.add(); }).toThrow(); }); - it("bringForward throws when primitive is not in composite", function() { + it('bringForward throws when primitive is not in composite', function() { var p = createLabels(); expect(function() { @@ -613,7 +613,7 @@ defineSuite([ }).toThrow(); }); - it("bringToFront throws when primitive is not in composite", function() { + it('bringToFront throws when primitive is not in composite', function() { var p = createLabels(); expect(function() { @@ -621,7 +621,7 @@ defineSuite([ }).toThrow(); }); - it("sendBackward throws when primitive is not in composite", function() { + it('sendBackward throws when primitive is not in composite', function() { var p = createLabels(); expect(function() { @@ -629,7 +629,7 @@ defineSuite([ }).toThrow(); }); - it("sendToBack throws when primitive is not in composite", function() { + it('sendToBack throws when primitive is not in composite', function() { var p = createLabels(); expect(function() { diff --git a/Specs/Scene/LabelCollectionSpec.js b/Specs/Scene/LabelCollectionSpec.js index 7f92c6d89f9..f9a05b674b8 100644 --- a/Specs/Scene/LabelCollectionSpec.js +++ b/Specs/Scene/LabelCollectionSpec.js @@ -57,12 +57,12 @@ defineSuite([ destroyContext(context); }); - it("default constructs a label", function() { + it('default constructs a label', function() { var l = labels.add(); expect(l.getShow()).toEqual(true); expect(l.getPosition().equals(Cartesian3.ZERO)).toEqual(true); - expect(l.getText()).toEqual(""); - expect(l.getFont()).toEqual("30px sans-serif"); + expect(l.getText()).toEqual(''); + expect(l.getFont()).toEqual('30px sans-serif'); expect(l.getFillColor().red).toEqual(1.0); expect(l.getFillColor().green).toEqual(1.0); expect(l.getFillColor().blue).toEqual(1.0); @@ -79,12 +79,12 @@ defineSuite([ expect(l.getScale()).toEqual(1.0); }); - it("explicitly constructs a label", function() { + it('explicitly constructs a label', function() { var l = labels.add({ show : false, position : new Cartesian3(1.0, 2.0, 3.0), - text : "abc", - font : "24px Helvetica", + text : 'abc', + font : '24px Helvetica', fillColor : { red : 2.0, green : 3.0, @@ -113,8 +113,8 @@ defineSuite([ expect(l.getShow()).toEqual(false); expect(l.getPosition().equals(new Cartesian3(1.0, 2.0, 3.0))).toEqual(true); - expect(l.getText()).toEqual("abc"); - expect(l.getFont()).toEqual("24px Helvetica"); + expect(l.getText()).toEqual('abc'); + expect(l.getFont()).toEqual('24px Helvetica'); expect(l.getFillColor().red).toEqual(2.0); expect(l.getFillColor().green).toEqual(3.0); expect(l.getFillColor().blue).toEqual(4.0); @@ -131,12 +131,12 @@ defineSuite([ expect(l.getScale()).toEqual(2.0); }); - it("sets a labels's properties", function() { + it('sets label properties', function() { var l = labels.add(); l.setShow(false); l.setPosition(new Cartesian3(1.0, 2.0, 3.0)); - l.setText("abc"); - l.setFont("24px Helvetica"); + l.setText('abc'); + l.setFont('24px Helvetica'); l.setFillColor({ red : 2.0, green : 3.0, @@ -158,8 +158,8 @@ defineSuite([ expect(l.getShow()).toEqual(false); expect(l.getPosition().equals(new Cartesian3(1.0, 2.0, 3.0))).toEqual(true); - expect(l.getText()).toEqual("abc"); - expect(l.getFont()).toEqual("24px Helvetica"); + expect(l.getText()).toEqual('abc'); + expect(l.getFont()).toEqual('24px Helvetica'); expect(l.getFillColor().red).toEqual(2.0); expect(l.getFillColor().green).toEqual(3.0); expect(l.getFillColor().blue).toEqual(4.0); @@ -176,27 +176,27 @@ defineSuite([ expect(l.getScale()).toEqual(2.0); }); - it("can specify font using units other than pixels", function() { + it('can specify font using units other than pixels', function() { var l = labels.add({ font : '12pt Arial', - text : "Hello" + text : 'Hello' }); var dimension = l._billboards[0]._labelDimension; expect(dimension.height).toBeGreaterThan(0); }); - it("sets a removed label's property", function() { + it('sets removed label property', function() { var l = labels.add(); labels.remove(l); l.setShow(false); expect(l.getShow()).toEqual(false); }); - it("has zero labels when constructed", function() { + it('has zero labels when constructed', function() { expect(labels.getLength()).toEqual(0); }); - it("adds a label", function() { + it('adds a label', function() { var l = labels.add({ position : { x : 1.0, @@ -209,7 +209,7 @@ defineSuite([ expect(labels.get(0).equals(l)).toEqual(true); }); - it("removes the first label", function() { + it('removes the first label', function() { var one = labels.add({ position : { x : 1.0, @@ -233,7 +233,7 @@ defineSuite([ expect(labels.get(0).equals(two)).toEqual(true); }); - it("removes the last label", function() { + it('removes the last label', function() { var one = labels.add({ position : { x : 1.0, @@ -257,7 +257,7 @@ defineSuite([ expect(labels.get(0).equals(one)).toEqual(true); }); - it("removes the same label twice", function() { + it('removes the same label twice', function() { var l = labels.add({ position : { x : 1.0, @@ -274,7 +274,7 @@ defineSuite([ expect(labels.getLength()).toEqual(0); }); - it("removes null", function() { + it('removes null', function() { labels.add({ position : { x : 1.0, @@ -288,7 +288,7 @@ defineSuite([ expect(labels.getLength()).toEqual(1); }); - it("adds and removes labels", function() { + it('adds and removes labels', function() { var one = labels.add({ position : { x : 1.0, @@ -320,7 +320,7 @@ defineSuite([ expect(labels.get(1).equals(three)).toEqual(true); }); - it("removes all labels", function() { + it('removes all labels', function() { labels.add({ position : { x : 1.0, @@ -341,14 +341,14 @@ defineSuite([ expect(labels.getLength()).toEqual(0); }); - it("contains a label", function() { + it('contains a label', function() { var l = labels.add(); labels.add(l); expect(labels.contains(l)).toEqual(true); }); - it("doesn't contain a label", function() { + it('does not contain a label', function() { var l0 = labels.add(); var l1 = labels.add(); @@ -359,15 +359,15 @@ defineSuite([ expect(labels.contains(l0)).toEqual(false); }); - it("doesn't contain undefined", function() { + it('does not contain undefined', function() { expect(labels.contains()).toEqual(false); }); - it("gets default buffer usage", function() { + it('gets default buffer usage', function() { expect(labels.bufferUsage).toEqual(BufferUsage.STATIC_DRAW); }); - it("doesn't render when constructed", function() { + it('does not render when constructed', function() { context.clear(); expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); @@ -376,14 +376,14 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("modifies and removes a label, then renders", function() { + it('modifies and removes a label, then renders', function() { var l = labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -393,7 +393,7 @@ defineSuite([ y : 0.0, z : 0.0 }, - text : "o", + text : 'o', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -420,14 +420,14 @@ defineSuite([ expect((p[3] === 0) || (p[3] === 255)).toEqual(true); // ANGLE Workaround: Blending or texture alpha channel is buggy }); - it("renders a label", function() { + it('renders a label', function() { labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -440,14 +440,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("adds and renders a label", function() { + it('adds and renders a label', function() { labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -465,7 +465,7 @@ defineSuite([ y : 0.0, z : 0.0 }, // Closer to viewer - text : "x", + text : 'x', fillColor : { red : 1.0, green : 0.0, @@ -481,14 +481,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); // Not the most precise check }); - it("removes and renders a label", function() { + it('removes and renders a label', function() { var l = labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -509,14 +509,14 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("removes all labels and renders", function() { + it('removes all labels and renders', function() { labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -537,14 +537,14 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("removes all labels, adds a label, and renders", function() { + it('removes all labels, adds a label, and renders', function() { labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -566,7 +566,7 @@ defineSuite([ y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -576,14 +576,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("renders with a different buffer usage", function() { + it('renders with a different buffer usage', function() { labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -604,14 +604,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("renders using label's show property", function() { + it('renders using show property', function() { var l = labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -637,14 +637,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("renders using label's position property", function() { + it('renders using position property', function() { var l = labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -678,14 +678,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("renders using label's scale property", function() { + it('renders using scale property', function() { var l = labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -711,14 +711,14 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("is picked", function() { + it('is picked', function() { var l = labels.add({ position : { x : 0.0, y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -729,7 +729,7 @@ defineSuite([ expect(pickedObject).toEqual(l); }); - it("is not picked", function() { + it('is not picked', function() { labels.add({ show : false, position : { @@ -737,7 +737,7 @@ defineSuite([ y : 0.0, z : 0.0 }, - text : "x", + text : 'x', horizontalOrigin : HorizontalOrigin.CENTER, verticalOrigin : VerticalOrigin.CENTER }); @@ -748,7 +748,7 @@ defineSuite([ expect(pickedObject).not.toBeDefined(); }); - it("computes screen space position (1)", function() { + it('computes screen space position (1)', function() { var l = labels.add({ position : { x : 0.0, @@ -760,7 +760,7 @@ defineSuite([ expect(l.computeScreenSpacePosition(us).equals(new Cartesian2(0.5, 0.5))); }); - it("computes screen space position (2)", function() { + it('computes screen space position (2)', function() { var l = labels.add({ position : { x : 0.0, @@ -776,7 +776,7 @@ defineSuite([ expect(l.computeScreenSpacePosition(us).equals(new Cartesian2(1.5, 2.5))); }); - it("computes screen space position (3)", function() { + it('computes screen space position (3)', function() { var l = labels.add({ position : { x : 0.0, @@ -795,7 +795,7 @@ defineSuite([ expect(p.y).toBeGreaterThan(0.5); }); - it("throws when computing screen space position when not in a collection", function() { + it('throws when computing screen space position when not in a collection', function() { var l = labels.add(); labels.remove(l); @@ -804,7 +804,7 @@ defineSuite([ }).toThrow(); }); - it("throws when computing screen space position without uniform state", function() { + it('throws when computing screen space position without uniform state', function() { var l = labels.add(); expect(function() { @@ -812,14 +812,14 @@ defineSuite([ }).toThrow(); }); - it("equals another label", function() { + it('equals another label', function() { var l = labels.add({ position : { x : 1.0, y : 2.0, z : 3.0 }, - text : "equals" + text : 'equals' }); var l2 = labels.add({ position : { @@ -827,13 +827,13 @@ defineSuite([ y : 2.0, z : 3.0 }, - text : "equals" + text : 'equals' }); expect(l.equals(l2)).toEqual(true); }); - it("doesn't equal another label", function() { + it('does not equal another label', function() { var l = labels.add({ position : { x : 1.0, @@ -852,35 +852,35 @@ defineSuite([ expect(l.equals(l2)).toEqual(false); }); - it("doesn't equal null", function() { + it('does not equal null', function() { var l = labels.add({}); expect(l.equals(null)).toBeFalsy(); }); - it("throws when accessing without an index", function() { + it('throws when accessing without an index', function() { expect(function() { labels.get(); }).toThrow(); }); - it("cache should have distinct entries", function() { + it('cache should have distinct entries', function() { labels.add({ - text : "a" + text : 'a' }); expect(labels._canvasContainer.getItems().length).toEqual(1); labels.add({ - text : "a" + text : 'a' }); expect(labels._canvasContainer.getItems().length).toEqual(1); labels.add({ - text : "ab" + text : 'ab' }); expect(labels._canvasContainer.getItems().length).toEqual(2); var label = labels.add({ - text : "abc" + text : 'abc' }); expect(labels._canvasContainer.getItems().length).toEqual(3); - label.setFont("30px arial"); + label.setFont('30px arial'); expect(labels._canvasContainer.getItems().length).toEqual(6); label.setStyle(LabelStyle.OUTLINE); expect(labels._canvasContainer.getItems().length).toEqual(9); @@ -901,26 +901,26 @@ defineSuite([ label.setVerticalOrigin(VerticalOrigin.CENTER); expect(labels._canvasContainer.getItems().length).toEqual(18); //even though we originally started with 30px sans-serif, other properties used to create the id have changed - label.setFont("30px sans-serif"); + label.setFont('30px sans-serif'); expect(labels._canvasContainer.getItems().length).toEqual(21); }); - it("billboards should equal number of characters", function() { + it('billboards should equal number of characters', function() { var label = labels.add({ - text : "abc" + text : 'abc' }); expect(label._billboards.length).toEqual(3); - label.setText("abcd"); + label.setText('abcd'); expect(label._billboards.length).toEqual(4); - label.setText(""); + label.setText(''); expect(label._billboards.length).toEqual(0); label = labels.add(); expect(label._billboards.length).toEqual(0); }); - it("pixelOffsets of billboards should should be correct when verticalOrigin is changed", function() { + it('pixelOffsets of billboards should should be correct when verticalOrigin is changed', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var y0 = label._billboards[0]._pixelOffset.y; var y1 = label._billboards[1]._pixelOffset.y; @@ -936,9 +936,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.y).toEqual(y2); }); - it("pixelOffsets of billboards should should be correct when verticalOrigin and scale are changed", function() { + it('pixelOffsets of billboards should should be correct when verticalOrigin and scale are changed', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var x0 = label._billboards[0]._pixelOffset.x; var y0 = label._billboards[0]._pixelOffset.y; @@ -970,9 +970,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.y).toBeGreaterThan(y2); }); - it("pixelOffsets of billboards should should be correct when HorizontalOrigin is changed", function() { + it('pixelOffsets of billboards should should be correct when HorizontalOrigin is changed', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var x0 = label._billboards[0]._pixelOffset.x; label.setHorizontalOrigin(HorizontalOrigin.CENTER); @@ -989,9 +989,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.x).toBeLessThan(centerX2); }); - it("pixelOffsets of billboards should should be correct when HorizontalOrigin and scale are changed", function() { + it('pixelOffsets of billboards should should be correct when HorizontalOrigin and scale are changed', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var x0 = label._billboards[0]._pixelOffset.x; var x1 = label._billboards[1]._pixelOffset.x; @@ -1014,9 +1014,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.x).toBeLessThan(centerX2); }); - it("pixelOffsets of billboards should should be correct when verticalOrigin, scale and pixelOffset are changed", function() { + it('pixelOffsets of billboards should should be correct when verticalOrigin, scale and pixelOffset are changed', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var x0 = label._billboards[0]._pixelOffset.x; var y0 = label._billboards[0]._pixelOffset.y; @@ -1052,9 +1052,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.y).toBeGreaterThan(y2); }); - it("pixelOffsets of billboards should should be correct when fontsize changes", function() { + it('pixelOffsets of billboards should should be correct when fontsize changes', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var x0 = label._billboards[0]._pixelOffset.x; var y0 = label._billboards[0]._pixelOffset.y; @@ -1062,7 +1062,7 @@ defineSuite([ var y1 = label._billboards[1]._pixelOffset.y; var x2 = label._billboards[2]._pixelOffset.x; var y2 = label._billboards[2]._pixelOffset.y; - label.setFont("20px sans-serif"); + label.setFont('20px sans-serif'); expect(label._billboards[0]._pixelOffset.x).toEqual(x0); expect(label._billboards[0]._pixelOffset.y).toEqual(y0); expect(label._billboards[1]._pixelOffset.x).toBeLessThan(x1); @@ -1071,11 +1071,11 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.y).toEqual(y2); }); - it("pixelOffset should equal if set by constructor or properties", function() { + it('pixelOffset should equal if set by constructor or properties', function() { var label = labels.add({ - text : "apl", + text : 'apl', scale : 2, - font : "20px sans-serif", + font : '20px sans-serif', verticalOrigin : VerticalOrigin.CENTER, pixelOffset : { x : 10, @@ -1083,9 +1083,9 @@ defineSuite([ } }); var propLabel = labels.add(); - propLabel.setText("apl"); + propLabel.setText('apl'); propLabel.setScale(2); - propLabel.setFont("20px sans-serif"); + propLabel.setFont('20px sans-serif'); propLabel.setVerticalOrigin(VerticalOrigin.CENTER); propLabel.setPixelOffset({ x : 10, @@ -1099,9 +1099,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.y).toEqual(propLabel._billboards[2]._pixelOffset.y); }); - it("pixelOffsets should not change if position changes", function() { + it('pixelOffsets should not change if position changes', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var x0 = label._billboards[0]._pixelOffset.x; var y0 = label._billboards[0]._pixelOffset.y; @@ -1122,9 +1122,9 @@ defineSuite([ expect(label._billboards[2]._pixelOffset.y).toEqual(y2); }); - it("scale does not change billboard dimension", function() { + it('scale does not change billboard dimension', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var dimension = label._billboards[0]._labelDimension; var width = dimension.width; @@ -1138,9 +1138,9 @@ defineSuite([ }); - it("font size changes billboard dimension", function() { + it('font size changes billboard dimension', function() { var label = labels.add({ - text : "apl" + text : 'apl' }); var dimension = label._billboards[0]._labelDimension; var width = dimension.width; @@ -1149,7 +1149,7 @@ defineSuite([ expect(dimension.width).toEqual(16); expect(dimension.height).toEqual(16); expect(dimension.descent).toEqual(-1); - label.setFont("20px sans-serif"); + label.setFont('20px sans-serif'); dimension = label._billboards[0]._labelDimension; expect(dimension.width).toBeLessThan(width); expect(dimension.height).toBeLessThan(height); diff --git a/Specs/Scene/OrthographicFrustumSpec.js b/Specs/Scene/OrthographicFrustumSpec.js index c26c603455c..a26aa58133f 100644 --- a/Specs/Scene/OrthographicFrustumSpec.js +++ b/Specs/Scene/OrthographicFrustumSpec.js @@ -28,21 +28,21 @@ defineSuite([ planes = frustum.getPlanes(new Cartesian3(), Cartesian3.UNIT_Z.negate(), Cartesian3.UNIT_Y); }); - it("left greater than right causes an exception", function() { + it('left greater than right causes an exception', function() { frustum.left = frustum.right + 1.0; expect(function() { frustum.getProjectionMatrix(); }).toThrow(); }); - it("bottom greater than top throws an exception", function() { + it('bottom greater than top throws an exception', function() { frustum.bottom = frustum.top + 1.0; expect(function() { frustum.getProjectionMatrix(); }).toThrow(); }); - it("out of range near plane throws an exception", function() { + it('out of range near plane throws an exception', function() { frustum.near = -1.0; expect(function() { frustum.getProjectionMatrix(); @@ -54,85 +54,85 @@ defineSuite([ }).toThrow(); }); - it("negative far plane throws an exception", function() { + it('negative far plane throws an exception', function() { frustum.far = -1.0; expect(function() { frustum.getProjectionMatrix(); }).toThrow(); }); - it("getPlanes with no position throws an exception", function() { + it('getPlanes with no position throws an exception', function() { expect(function() { frustum.getPlanes(); }).toThrow(); }); - it("getPlanes with no direction throws an exception", function() { + it('getPlanes with no direction throws an exception', function() { expect(function() { frustum.getPlanes(new Cartesian3()); }).toThrow(); }); - it("getPlanes with no up throws an exception", function() { + it('getPlanes with no up throws an exception', function() { expect(function() { frustum.getPlanes(new Cartesian3(), new Cartesian3()); }).toThrow(); }); - it("get frustum left plane", function() { + it('get frustum left plane', function() { var leftPlane = planes[0]; var expectedResult = new Cartesian4(1.0, 0.0, 0.0, 1.0); expect(leftPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum right plane", function() { + it('get frustum right plane', function() { var rightPlane = planes[1]; var expectedResult = new Cartesian4(-1.0, 0.0, 0.0, 1.0); expect(rightPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum bottom plane", function() { + it('get frustum bottom plane', function() { var bottomPlane = planes[2]; var expectedResult = new Cartesian4(0.0, 1.0, 0.0, 1.0); expect(bottomPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum top plane", function() { + it('get frustum top plane', function() { var topPlane = planes[3]; var expectedResult = new Cartesian4(0.0, -1.0, 0.0, 1.0); expect(topPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum near plane", function() { + it('get frustum near plane', function() { var nearPlane = planes[4]; var expectedResult = new Cartesian4(0.0, 0.0, -1.0, -1.0); expect(nearPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum far plane", function() { + it('get frustum far plane', function() { var farPlane = planes[5]; var expectedResult = new Cartesian4(0.0, 0.0, 1.0, 3.0); expect(farPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get orthographic projection matrix", function() { + it('get orthographic projection matrix', function() { var projectionMatrix = frustum.getProjectionMatrix(); var expected = Matrix4.createOrthographicOffCenter(frustum.left, frustum.right, frustum.top, frustum.bottm, frustum.near, frustum.far); expect(projectionMatrix.equalsEpsilon(expected, CesiumMath.EPSILON6)).toEqual(true); }); - it("clone", function() { + it('clone', function() { var clone = frustum.clone(); expect(clone.equals(frustum)).toEqual(true); }); - it("destroys", function() { + it('destroys', function() { expect(frustum.isDestroyed()).toEqual(false); frustum.destroy(); expect(frustum.isDestroyed()).toEqual(true); }); - it("throws with null plane(s)", function() { + it('throws with null plane(s)', function() { var frustum = new OrthographicFrustum(); expect(function() { frustum.getProjectionMatrix(); diff --git a/Specs/Scene/PerspectiveFrustumSpec.js b/Specs/Scene/PerspectiveFrustumSpec.js index b4cbac62e81..36ec1ed0f84 100644 --- a/Specs/Scene/PerspectiveFrustumSpec.js +++ b/Specs/Scene/PerspectiveFrustumSpec.js @@ -26,7 +26,7 @@ defineSuite([ planes = frustum.getPlanes(new Cartesian3(), Cartesian3.UNIT_Z.negate(), Cartesian3.UNIT_Y); }); - it("out of range fov causes an exception", function() { + it('out of range fov causes an exception', function() { frustum.fovy = -1.0; expect(function() { frustum.getProjectionMatrix(); @@ -38,14 +38,14 @@ defineSuite([ }).toThrow(); }); - it("negative aspect ratio throws an exception", function() { + it('negative aspect ratio throws an exception', function() { frustum.aspectRatio = -1.0; expect(function() { frustum.getProjectionMatrix(); }).toThrow(); }); - it("out of range near plane throws an exception", function() { + it('out of range near plane throws an exception', function() { frustum.near = -1.0; expect(function() { frustum.getProjectionMatrix(); @@ -57,74 +57,74 @@ defineSuite([ }).toThrow(); }); - it("negative far plane throws an exception", function() { + it('negative far plane throws an exception', function() { frustum.far = -1.0; expect(function() { frustum.getProjectionMatrix(); }).toThrow(); }); - it("getPlanes with no position throws an exception", function() { + it('getPlanes with no position throws an exception', function() { expect(function() { frustum.getPlanes(); }).toThrow(); }); - it("getPlanes with no direction throws an exception", function() { + it('getPlanes with no direction throws an exception', function() { expect(function() { frustum.getPlanes(new Cartesian3()); }).toThrow(); }); - it("getPlanes with no up throws an exception", function() { + it('getPlanes with no up throws an exception', function() { expect(function() { frustum.getPlanes(new Cartesian3(), new Cartesian3()); }).toThrow(); }); - it("get frustum left plane", function() { + it('get frustum left plane', function() { var leftPlane = planes[0]; var expectedResult = new Cartesian4(Math.sqrt(3) / 2, 0, -0.5, 0); expect(leftPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum right plane", function() { + it('get frustum right plane', function() { var rightPlane = planes[1]; var expectedResult = new Cartesian4(-Math.sqrt(3) / 2, 0, -0.5, 0); expect(rightPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum bottom plane", function() { + it('get frustum bottom plane', function() { var bottomPlane = planes[2]; var expectedResult = new Cartesian4(0, Math.sqrt(3) / 2, -0.5, 0); expect(bottomPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum top plane", function() { + it('get frustum top plane', function() { var topPlane = planes[3]; var expectedResult = new Cartesian4(0, -Math.sqrt(3) / 2, -0.5, 0); expect(topPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum near plane", function() { + it('get frustum near plane', function() { var nearPlane = planes[4]; var expectedResult = new Cartesian4(0, 0, -1, -1); expect(nearPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get frustum far plane", function() { + it('get frustum far plane', function() { var farPlane = planes[5]; var expectedResult = new Cartesian4(0, 0, 1, 2); expect(farPlane.equalsEpsilon(expectedResult, CesiumMath.EPSILON4)).toEqual(true); }); - it("get perspective projection matrix", function() { + it('get perspective projection matrix', function() { var projectionMatrix = frustum.getProjectionMatrix(); var expected = Matrix4.createPerspectiveFieldOfView(frustum.fovy, frustum.aspectRatio, frustum.near, frustum.far); expect(projectionMatrix.equalsEpsilon(expected, CesiumMath.EPSILON6)).toEqual(true); }); - it("get infinite perspective matrix", function() { + it('get infinite perspective matrix', function() { var top = frustum.near * Math.tan(0.5 * frustum.fovy); var bottom = -top; var right = frustum.aspectRatio * top; @@ -135,7 +135,7 @@ defineSuite([ expect(expected.equals(frustum.getInfiniteProjectionMatrix())).toEqual(true); }); - it("equals", function() { + it('equals', function() { var frustum2 = new PerspectiveFrustum(); frustum2.near = 1.0; frustum2.far = 2.0; @@ -144,13 +144,13 @@ defineSuite([ expect(frustum.equals(frustum2)).toEqual(true); }); - it("destroys", function() { + it('destroys', function() { expect(frustum.isDestroyed()).toEqual(false); frustum.destroy(); expect(frustum.isDestroyed()).toEqual(true); }); - it("throws with null frustum parameters", function() { + it('throws with null frustum parameters', function() { var frustum = new PerspectiveFrustum(); expect(function() { return frustum.getInfiniteProjectionMatrix(); diff --git a/Specs/Scene/PolygonSpec.js b/Specs/Scene/PolygonSpec.js index f4c817186e3..0ed8d416db1 100644 --- a/Specs/Scene/PolygonSpec.js +++ b/Specs/Scene/PolygonSpec.js @@ -53,11 +53,11 @@ defineSuite([ destroyContext(context); }); - it("gets default show", function() { + it('gets default show', function() { expect(polygon.show).toEqual(true); }); - it("sets positions", function() { + it('sets positions', function() { var positions = [ new Cartesian3(1.0, 2.0, 3.0), new Cartesian3(4.0, 5.0, 6.0), @@ -70,7 +70,7 @@ defineSuite([ expect(polygon.getPositions()).toEqualArray(positions); }); - it("configures extent", function() { + it('configures extent', function() { var extent = new Extent( 0.0, 0.0, @@ -83,7 +83,7 @@ defineSuite([ }); - it("gets the default color", function() { + it('gets the default color', function() { expect(polygon.material.color).toEqualProperties({ red : 1.0, green : 1.0, @@ -92,19 +92,19 @@ defineSuite([ }); }); - it("gets default buffer usage", function() { + it('gets default buffer usage', function() { expect(polygon.bufferUsage).toEqual(BufferUsage.STATIC_DRAW); }); - it("has a default ellipsoid", function() { + it('has a default ellipsoid', function() { expect(polygon.ellipsoid).toEqual(Ellipsoid.WGS84); }); - it("gets the default granularity", function() { + it('gets the default granularity', function() { expect(polygon.granularity).toEqual(CesiumMath.toRadians(1.0)); }); - it("renders", function() { + it('renders', function() { // This test fails in Chrome if a breakpoint is set inside this function. Strange. var ellipsoid = Ellipsoid.UNIT_SPHERE; @@ -131,7 +131,7 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("renders extent", function() { + it('renders extent', function() { // This test fails in Chrome if a breakpoint is set inside this function. Strange. var ellipsoid = Ellipsoid.UNIT_SPHERE; @@ -158,7 +158,7 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("doesn't renders", function() { + it('does not renders', function() { var ellipsoid = Ellipsoid.UNIT_SPHERE; polygon.ellipsoid = ellipsoid; polygon.granularity = CesiumMath.toRadians(20.0); @@ -184,7 +184,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("is picked", function() { + it('is picked', function() { var ellipsoid = Ellipsoid.UNIT_SPHERE; polygon.ellipsoid = ellipsoid; polygon.granularity = CesiumMath.toRadians(20.0); @@ -201,7 +201,7 @@ defineSuite([ expect(pickedObject).toEqual(polygon); }); - it("is not picked", function() { + it('is not picked', function() { var ellipsoid = Ellipsoid.UNIT_SPHERE; polygon.ellipsoid = ellipsoid; polygon.granularity = CesiumMath.toRadians(20.0); diff --git a/Specs/Scene/PolylineSpec.js b/Specs/Scene/PolylineSpec.js index ff1103e013f..23ef2e67372 100644 --- a/Specs/Scene/PolylineSpec.js +++ b/Specs/Scene/PolylineSpec.js @@ -46,11 +46,11 @@ defineSuite([ destroyContext(context); }); - it("gets default show", function() { + it('gets default show', function() { expect(polyline.show).toEqual(true); }); - it("sets positions", function() { + it('sets positions', function() { var positions = [new Cartesian3(1.0, 2.0, 3.0), new Cartesian3(4.0, 5.0, 6.0)]; expect(polyline.getPositions()).not.toBeDefined(); @@ -59,15 +59,15 @@ defineSuite([ expect(polyline.getPositions()).toEqualArray(positions); }); - it("gets the default width", function() { + it('gets the default width', function() { expect(polyline.width).toEqual(2); }); - it("gets the default outline-width", function() { + it('gets the default outline-width', function() { expect(polyline.outlineWidth).toEqual(5); }); - it("gets the default color", function() { + it('gets the default color', function() { expect(polyline.color).toEqualProperties({ red : 0.0, green : 0.0, @@ -76,7 +76,7 @@ defineSuite([ }); }); - it("gets the default outline-color", function() { + it('gets the default outline-color', function() { expect(polyline.outlineColor).toEqualProperties({ red : 1.0, green : 1.0, @@ -85,15 +85,15 @@ defineSuite([ }); }); - it("gets default bufferusage", function() { + it('gets default bufferusage', function() { expect(polyline.bufferUsage).toEqual(BufferUsage.STATIC_DRAW); }); - it("updates", function() { + it('updates', function() { polyline.update(context, sceneState); }); - it("renders", function() { + it('renders', function() { polyline.setPositions([new Cartesian3(0.0, -1.0, 0.0), new Cartesian3(0.0, 1.0, 0.0)]); polyline.color = { @@ -117,7 +117,7 @@ defineSuite([ expect(context.readPixels()).not.toEqualArray([0, 0, 0, 0]); }); - it("doesn't renders", function() { + it('does not renders', function() { polyline.setPositions([new Cartesian3(0.0, -1.0, 0.0), new Cartesian3(0.0, 1.0, 0.0)]); polyline.color = { @@ -142,7 +142,7 @@ defineSuite([ expect(context.readPixels()).toEqualArray([0, 0, 0, 0]); }); - it("is picked", function() { + it('is picked', function() { polyline.setPositions([new Cartesian3(0.0, -1.0, 0.0), new Cartesian3(0.0, 1.0, 0.0)]); polyline.update(context, sceneState); @@ -151,7 +151,7 @@ defineSuite([ expect(pickedObject).toEqual(polyline); }); - it("is not picked", function() { + it('is not picked', function() { polyline.setPositions([new Cartesian3(0.0, -1.0, 0.0), new Cartesian3(0.0, 1.0, 0.0)]); polyline.show = false; @@ -161,7 +161,7 @@ defineSuite([ expect(pickedObject).not.toBeDefined(); }); - it("isDestroyed", function() { + it('isDestroyed', function() { expect(polyline.isDestroyed()).toEqual(false); polyline.destroy(); expect(polyline.isDestroyed()).toEqual(true); diff --git a/Specs/Scene/Texture2DPoolSpec.js b/Specs/Scene/Texture2DPoolSpec.js index b12c1963727..753723010f8 100644 --- a/Specs/Scene/Texture2DPoolSpec.js +++ b/Specs/Scene/Texture2DPoolSpec.js @@ -33,13 +33,13 @@ defineSuite([ pool = new Texture2DPool(fakeContext); }); - it("throws when constructed without context", function() { + it('throws when constructed without context', function() { expect(function() { return new Texture2DPool(); }).toThrow(); }); - it("creates textures from the context on demand", function() { + it('creates textures from the context on demand', function() { var description = { width : 1, height : 1 @@ -50,7 +50,7 @@ defineSuite([ expect(texture).toBeDefined(); }); - it("creates textures of different sizes", function() { + it('creates textures of different sizes', function() { var texture1 = pool.createTexture2D({ width : 1, height : 1 @@ -64,7 +64,7 @@ defineSuite([ expect(texture2.getWidth()).toEqual(2); }); - it("returns textures to the pool when they are destroyed", function() { + it('returns textures to the pool when they are destroyed', function() { var texture1 = pool.createTexture2D({ width : 1, height : 1 @@ -80,7 +80,7 @@ defineSuite([ expect(texture2 === texture1).toEqual(true); }); - it("destroys free textures when the pool is destroyed", function() { + it('destroys free textures when the pool is destroyed', function() { var texture1 = pool.createTexture2D({ width : 1, height : 1 diff --git a/Specs/Scene/TileSpec.js b/Specs/Scene/TileSpec.js index b85c1b463d9..aea2d57b8dc 100644 --- a/Specs/Scene/TileSpec.js +++ b/Specs/Scene/TileSpec.js @@ -11,13 +11,13 @@ defineSuite([ /*global document,it,expect*/ - it("throws without a description", function() { + it('throws without a description', function() { expect(function() { return new Tile(); }).toThrow(); }); - it("throws without description.extent", function() { + it('throws without description.extent', function() { expect(function() { return new Tile({ x : 0, @@ -26,7 +26,7 @@ defineSuite([ }).toThrow(); }); - it("throws without description.zoom", function() { + it('throws without description.zoom', function() { expect(function() { return new Tile({ extent : new Extent( @@ -41,7 +41,7 @@ defineSuite([ }).toThrow(); }); - it("throws with negative x or y properties", function() { + it('throws with negative x or y properties', function() { expect(function() { return new Tile({ x : -1.0, @@ -51,14 +51,14 @@ defineSuite([ }).toThrow(); }); - it("creates extent on construction", function() { + it('creates extent on construction', function() { var desc = {x : 0, y : 0, zoom : 0}; var tile = new Tile(desc); var extent = Tile.tileXYToExtent(desc.x, desc.y, desc.zoom); expect(tile.extent).toEqual(extent); }); - it("creates x, y, zoom on construction", function() { + it('creates x, y, zoom on construction', function() { var desc = { extent : new Extent( -CesiumMath.PI, diff --git a/Specs/addDefaultMatchers.js b/Specs/addDefaultMatchers.js index 96f5c9d89a8..3c4744082f6 100755 --- a/Specs/addDefaultMatchers.js +++ b/Specs/addDefaultMatchers.js @@ -3,7 +3,7 @@ define(function() { "use strict"; function isEqual(a, b) { - if (typeof a !== "undefined" && typeof a.equals !== "undefined") { + if (typeof a !== 'undefined' && typeof a.equals !== 'undefined') { return a.equals(b); } diff --git a/Specs/createContext.js b/Specs/createContext.js index bccf81ba971..d45dca67c54 100755 --- a/Specs/createContext.js +++ b/Specs/createContext.js @@ -3,13 +3,13 @@ define(['Renderer/Context'], function(Context) { "use strict"; function createContext() { - var canvas = document.createElement("canvas"); - canvas.id = "glCanvas"; - canvas.setAttribute("width", "1"); - canvas.setAttribute("clientWidth", "1"); - canvas.setAttribute("height", "1"); - canvas.setAttribute("clientHeight", "1"); - canvas.innerHTML = "To view this web page, upgrade your browser; it does not support the HTML5 canvas element."; + var canvas = document.createElement('canvas'); + canvas.id = 'glCanvas'; + canvas.setAttribute('width', '1'); + canvas.setAttribute('clientWidth', '1'); + canvas.setAttribute('height', '1'); + canvas.setAttribute('clientHeight', '1'); + canvas.innerHTML = 'To view this web page, upgrade your browser; it does not support the HTML5 canvas element.'; document.body.appendChild(canvas); var context = new Context(canvas, { diff --git a/Specs/renderFragment.js b/Specs/renderFragment.js index 0810b176b29..5064ada197d 100755 --- a/Specs/renderFragment.js +++ b/Specs/renderFragment.js @@ -9,7 +9,7 @@ define([ /*global expect*/ function renderFragment(context, fs) { - var vs = "attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }"; + var vs = 'attribute vec4 position; void main() { gl_PointSize = 1.0; gl_Position = position; }'; var sp = context.createShaderProgram(vs, fs); var va = context.createVertexArray();