Skip to content

Commit

Permalink
Merge pull request CesiumGS#1612 from AnalyticalGraphicsInc/renameExtent
Browse files Browse the repository at this point in the history
Rename Extent to Rectangle
  • Loading branch information
bagnell committed Apr 10, 2014
2 parents 1fe947b + de2148b commit 66e6bbe
Show file tree
Hide file tree
Showing 116 changed files with 2,584 additions and 2,564 deletions.
18 changes: 9 additions & 9 deletions Apps/Sandcastle/gallery/Animations.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
require(['Cesium'], function(Cesium) {
"use strict";

var extent;
var rectangle;
var rectangularSensor;

function addAlphaAnimation(primitive, scene) {
Expand All @@ -40,25 +40,25 @@
scene.animations.addOffsetIncrement(primitive.material);
}

function resetExtentPropeties(extent) {
extent.material.uniforms.time = 1.0;
extent.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 0.5);
function resetRectanglePropeties(rectangle) {
rectangle.material.uniforms.time = 1.0;
rectangle.material.uniforms.color = new Cesium.Color(1.0, 0.0, 0.0, 0.5);
}

function createPrimitives(widget) {
var ellipsoid = widget.centralBody.ellipsoid;
var scene = widget.scene;
var primitives = scene.primitives;

extent = new Cesium.ExtentPrimitive({
extent : new Cesium.Extent(
rectangle = new Cesium.RectanglePrimitive({
rectangle : new Cesium.Rectangle(
Cesium.Math.toRadians(-120.0),
Cesium.Math.toRadians(20.0),
Cesium.Math.toRadians(-80.0),
Cesium.Math.toRadians(50.0)),
material : Cesium.Material.fromType('Color')
});
primitives.add(extent);
primitives.add(rectangle);

var modelMatrix = Cesium.Transforms.northEastDownToFixedFrame(
ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-45.0, 45.0)));
Expand Down Expand Up @@ -87,8 +87,8 @@

Sandcastle.addToolbarButton('Alpha Animation', function() {
scene.animations.removeAll();
resetExtentPropeties(extent);
addAlphaAnimation(extent, scene);
resetRectanglePropeties(rectangle);
addAlphaAnimation(rectangle, scene);
Sandcastle.highlight(addAlphaAnimation);
});

Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/CZML.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
viewer.dataSources.add(czmlDataSource);

// Zoom in a little closer...
var extent = new Cesium.Extent(-2.056, 0.587, -2.010, 0.633);
viewer.scene.camera.viewExtent(extent);
var rectangle = new Cesium.Rectangle(-2.056, 0.587, -2.010, 0.633);
viewer.scene.camera.viewRectangle(rectangle);
}

var viewer = new Cesium.Viewer('cesiumContainer');
Expand Down
36 changes: 18 additions & 18 deletions Apps/Sandcastle/gallery/Camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE -->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Fly to a specified location or view a geographic extent.">
<meta name="description" content="Fly to a specified location or view a geographic rectangle.">
<meta name="cesium-sandcastle-labels" content="Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
Expand Down Expand Up @@ -54,17 +54,17 @@
navigator.geolocation.getCurrentPosition(fly);
}

function viewAnExtent(scene) {
Sandcastle.declare(viewAnExtent); // For highlighting in Sandcastle.
function viewAnRectangle(scene) {
Sandcastle.declare(viewAnRectangle); // For highlighting in Sandcastle.
var west = Cesium.Math.toRadians(-77.0);
var south = Cesium.Math.toRadians(38.0);
var east = Cesium.Math.toRadians(-72.0);
var north = Cesium.Math.toRadians(42.0);

var extent = new Cesium.Extent(west, south, east, north);
scene.camera.viewExtent(extent, ellipsoid);
var rectangle = new Cesium.Rectangle(west, south, east, north);
scene.camera.viewRectangle(rectangle, ellipsoid);

// Show the extent. Not required; just for show.
// Show the rectangle. Not required; just for show.
var polylines = new Cesium.PolylineCollection();
polylines.add({
positions : ellipsoid.cartographicArrayToCartesianArray(
Expand All @@ -79,21 +79,21 @@
scene.primitives.add(polylines);
}

function flyToExtent(scene) {
Sandcastle.declare(flyToExtent); // For highlighting in Sandcastle.
function flyToRectangle(scene) {
Sandcastle.declare(flyToRectangle); // For highlighting in Sandcastle.
var west = Cesium.Math.toRadians(-90.0);
var south = Cesium.Math.toRadians(38.0);
var east = Cesium.Math.toRadians(-87.0);
var north = Cesium.Math.toRadians(40.0);

var extent = new Cesium.Extent(west, south, east, north);
var rectangle = new Cesium.Rectangle(west, south, east, north);

var flight = Cesium.CameraFlightPath.createAnimationExtent(scene, {
destination : extent
var flight = Cesium.CameraFlightPath.createAnimationRectangle(scene, {
destination : rectangle
});
scene.animations.add(flight);

// Show the extent. Not required; just for show.
// Show the rectangle. Not required; just for show.
var polylines = new Cesium.PolylineCollection();
polylines.add({
positions : ellipsoid.cartographicArrayToCartesianArray(
Expand Down Expand Up @@ -200,16 +200,16 @@
Sandcastle.highlight(flyToMyLocation);
});

Sandcastle.addToolbarButton('Fly to Extent', function() {
Sandcastle.addToolbarButton('Fly to Rectangle', function() {
reset(scene);
flyToExtent(scene);
Sandcastle.highlight(flyToExtent);
flyToRectangle(scene);
Sandcastle.highlight(flyToRectangle);
});

Sandcastle.addToolbarButton('View an Extent', function() {
Sandcastle.addToolbarButton('View an Rectangle', function() {
reset(scene);
viewAnExtent(scene);
Sandcastle.highlight(viewAnExtent);
viewAnRectangle(scene);
Sandcastle.highlight(viewAnRectangle);
});

Sandcastle.addToolbarButton('Set camera reference frame', function() {
Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/Cesium Inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@

primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : Cesium.Extent.fromDegrees(-100.0, 30.0, -93.0, 37.0),
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-100.0, 30.0, -93.0, 37.0),
height: 100000,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
Expand Down
16 changes: 8 additions & 8 deletions Apps/Sandcastle/gallery/Ellipsoid Surface.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
// Stripe Material
primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : Cesium.Extent.fromDegrees(-120.0, 30.0, -110.0, 40.0),
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-120.0, 30.0, -110.0, 40.0),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
}),
Expand All @@ -46,8 +46,8 @@
// Dot Material
primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : Cesium.Extent.fromDegrees(-110.0, 30.0, -100.0, 40.0),
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-110.0, 30.0, -100.0, 40.0),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
}),
Expand All @@ -59,8 +59,8 @@
// Checkerboard Material
primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : Cesium.Extent.fromDegrees(-100.0, 30.0, -90.0, 40.0),
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-100.0, 30.0, -90.0, 40.0),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
}),
Expand All @@ -72,8 +72,8 @@
// Grid Material
primitives.add(new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : Cesium.Extent.fromDegrees(-90.0, 30.0, -80.0, 40.0),
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-90.0, 30.0, -80.0, 40.0),
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
}),
Expand Down
68 changes: 34 additions & 34 deletions Apps/Sandcastle/gallery/Geometry and Appearances.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
var ellipsoid = viewer.centralBody.ellipsoid;
var solidWhite = Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE);

// Combine instances for an extent, polygon, ellipse, and circle into a single primitive.
// Combine instances for an rectangle, polygon, ellipse, and circle into a single primitive.

var extent = Cesium.Extent.fromDegrees(-92.0, 20.0, -86.0, 27.0);
var extentInstance = new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : extent,
var rectangle = Cesium.Rectangle.fromDegrees(-92.0, 20.0, -86.0, 27.0);
var rectangleInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
stRotation : Cesium.Math.toRadians(45)
})
});
var extentOutlineInstance = new Cesium.GeometryInstance({
geometry : new Cesium.ExtentOutlineGeometry({
extent : extent
var rectangleOutlineInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleOutlineGeometry({
rectangle : rectangle
}),
attributes : {
color : solidWhite
Expand Down Expand Up @@ -123,13 +123,13 @@
});

primitives.add(new Cesium.Primitive({
geometryInstances : [extentInstance, polygonInstance, ellipseInstance, circleInstance],
geometryInstances : [rectangleInstance, polygonInstance, ellipseInstance, circleInstance],
appearance : new Cesium.EllipsoidSurfaceAppearance({
material : Cesium.Material.fromType('Stripe')
})
}));
primitives.add(new Cesium.Primitive({
geometryInstances : [extentOutlineInstance, polygonOutlineInstance, ellipseOutlineInstance, circleOutlineInstance],
geometryInstances : [rectangleOutlineInstance, polygonOutlineInstance, ellipseOutlineInstance, circleOutlineInstance],
appearance : new Cesium.PerInstanceColorAppearance({
flat : true,
translucent : false,
Expand All @@ -142,12 +142,12 @@
})
}));

// Create extruded extent
extent = Cesium.Extent.fromDegrees(-118.0, 38.0, -116.0, 40.0);
// Create extruded rectangle
rectangle = Cesium.Rectangle.fromDegrees(-118.0, 38.0, -116.0, 40.0);
var extrudedHeight = 500000.0;
var extrudedExtent = new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : extent,
var extrudedRectangle = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
extrudedHeight : extrudedHeight
}),
Expand All @@ -156,9 +156,9 @@
}
});

var extrudedOutlineExtent = new Cesium.GeometryInstance({
geometry : new Cesium.ExtentOutlineGeometry({
extent : extent,
var extrudedOutlineRectangle = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleOutlineGeometry({
rectangle : rectangle,
extrudedHeight : extrudedHeight
}),
attributes : {
Expand Down Expand Up @@ -266,14 +266,14 @@
});

primitives.add(new Cesium.Primitive({
geometryInstances : [extrudedPolygon, extrudedExtent, extrudedEllipse, cylinderInstance],
geometryInstances : [extrudedPolygon, extrudedRectangle, extrudedEllipse, cylinderInstance],
appearance : new Cesium.PerInstanceColorAppearance({
translucent : false,
closed : true
})
}));
primitives.add(new Cesium.Primitive({
geometryInstances : [extrudedOutlineExtent, extrudedOutlineEllipse, extrudedOutlinePolygon, cylinderOutlineInstance],
geometryInstances : [extrudedOutlineRectangle, extrudedOutlineEllipse, extrudedOutlinePolygon, cylinderOutlineInstance],
appearance : new Cesium.PerInstanceColorAppearance({
flat : true,
translucent : false,
Expand Down Expand Up @@ -450,10 +450,10 @@
})
}));

extent = Cesium.Extent.fromDegrees(-92.0, 30.0, -85.0, 40.0);
extentInstance = new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : extent,
rectangle = Cesium.Rectangle.fromDegrees(-92.0, 30.0, -85.0, 40.0);
rectangleInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT
})
});
Expand Down Expand Up @@ -522,20 +522,20 @@
});

primitives.add(new Cesium.Primitive({
geometryInstances : [extentInstance, polygonInstance, ellipseInstance, circleInstance],
geometryInstances : [rectangleInstance, polygonInstance, ellipseInstance, circleInstance],
appearance : new Cesium.EllipsoidSurfaceAppearance({
material : Cesium.Material.fromType('Stripe')
})
}));

// Create extruded extent
extent = Cesium.Extent.fromDegrees(-110.0, 38.0, -107.0, 40.0);
// Create extruded rectangle
rectangle = Cesium.Rectangle.fromDegrees(-110.0, 38.0, -107.0, 40.0);
height = 700000.0;
extrudedHeight = 1000000.0;
rotation = Cesium.Math.toRadians(45.0);
extrudedExtent = new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : extent,
extrudedRectangle = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
height : height,
rotation : rotation,
Expand Down Expand Up @@ -610,7 +610,7 @@
});

primitives.add(new Cesium.Primitive({
geometryInstances : [extrudedPolygon, extrudedExtent, extrudedEllipse, cylinderInstance],
geometryInstances : [extrudedPolygon, extrudedRectangle, extrudedEllipse, cylinderInstance],
appearance : new Cesium.PerInstanceColorAppearance({
translucent : false,
closed : true
Expand All @@ -624,7 +624,7 @@

center = ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(-65.0, 35.0));
radius = 200000.0;
extent = Cesium.Extent.fromDegrees(-67.0, 27.0, -63.0, 32.0);
rectangle = Cesium.Rectangle.fromDegrees(-67.0, 27.0, -63.0, 32.0);
for (i = 0; i < 5; ++i) {
height = 200000.0 * i;

Expand All @@ -641,8 +641,8 @@
}));

instances.push(new Cesium.GeometryInstance({
geometry : new Cesium.ExtentGeometry({
extent : extent,
geometry : new Cesium.RectangleGeometry({
rectangle : rectangle,
height : height,
vertexFormat : Cesium.PerInstanceColorAppearance.VERTEX_FORMAT
}),
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Imagery Layers Manipulation.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
'Single image',
new Cesium.SingleTileImageryProvider({
url : '../images/Cesium_Logo_overlay.png',
extent : new Cesium.Extent(
rectangle : new Cesium.Rectangle(
Cesium.Math.toRadians(-115.0),
Cesium.Math.toRadians(38.0),
Cesium.Math.toRadians(-107),
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Imagery Layers.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
blackMarble.brightness = 2.0;
layers.addImageryProvider(new Cesium.SingleTileImageryProvider({
url : '../images/Cesium_Logo_overlay.png',
extent : new Cesium.Extent(
rectangle : new Cesium.Rectangle(
Cesium.Math.toRadians(-75.0),
Cesium.Math.toRadians(28.0),
Cesium.Math.toRadians(-67.0),
Expand Down
Loading

0 comments on commit 66e6bbe

Please sign in to comment.