<commit_before><!DOCTYPE html>
<html lang="en">
<head>
    <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.">
    <title>Cesium Demo</title>
    <script type="text/javascript" src="../Sandcastle-header.js"></script>
    <script data-dojo-config="async: 1, tlmSiblingOfDojo: 0" src="../../../ThirdParty/dojo-release-1.7.2-src/dojo/dojo.js"></script>
    <script type="text/javascript">
    require({
        baseUrl : '../../..',
        packages: [
            { name: 'dojo', location: 'ThirdParty/dojo-release-1.7.2-src/dojo' },
            { name: 'dijit', location: 'ThirdParty/dojo-release-1.7.2-src/dijit' },
            { name: 'dojox', location: 'ThirdParty/dojo-release-1.7.2-src/dojox' },
            { name: 'Assets', location: 'Source/Assets' },
            { name: 'Core', location: 'Source/Core' },
            { name: 'DynamicScene', location: 'Source/DynamicScene' },
            { name: 'Renderer', location: 'Source/Renderer' },
            { name: 'Scene', location: 'Source/Scene' },
            { name: 'Shaders', location: 'Source/Shaders' },
            { name: 'ThirdParty', location: 'Source/ThirdParty' },
            { name: 'Widgets', location: 'Source/Widgets' },
            { name: 'Workers', location: 'Source/Workers' }
        ]
    });
    </script>
    <link rel="Stylesheet" href="../../../ThirdParty/dojo-release-1.7.2-src/dijit/themes/claro/claro.css" type="text/css">
    <link rel="Stylesheet" href="../../../Source/Widgets/Dojo/CesiumViewerWidget.css" type="text/css">
</head>
<body class="claro" data-sandcastle-bucket="bucket-dojo.html" data-sandcastle-title="Cesium + Dojo">
<style>
    body {
        background: #000;
        color: #eee;
        font-family: sans-serif;
        font-size: 9pt;
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    .fullSize {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        border: none;
        width: 100%;
        height: 100%;
        z-index: -1;
    }
    #toolbar {
        padding: 2px 5px;
        border-radius: 5px;
        position: absolute;
    }
</style>

<div id="cesiumContainer" class="fullSize"></div>
<div id="toolbar">Loading...</div>
<script id="cesium_sandcastle_script">
require([
    'Source/Cesium', 'Widgets/Dojo/CesiumWidget',
    'dojo/on', 'dojo/dom', 'dijit/form/Button'
], function(
    Cesium, CesiumWidget,
    on, dom, ToggleButton)
{
    "use strict";
    
    function flyToSanDiego(scene) {
        Sandcastle.declare(flyToSanDiego);    // For highlighting in Sandcastle.
        var destination = Cesium.Cartographic.fromDegrees(-117.16, 32.71, 15000.0);
        var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
            destination : destination
        });
        scene.getAnimations().add(flight);
    }
    
    function flyToMyLocation(scene) {
        Sandcastle.declare(flyToMyLocation);    // For highlighting in Sandcastle.
        function fly(position) {
            var destination = Cesium.Cartographic.fromDegrees(position.coords.longitude, position.coords.latitude, 1000.0);
            var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
                destination : destination
            });
            scene.getAnimations().add(flight);
        }
        
        navigator.geolocation.getCurrentPosition(fly);
    }

    function viewAnExtent(scene) {
        Sandcastle.declare(viewAnExtent);   // 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.getCamera().controller.viewExtent(extent, Cesium.Ellipsoid.WGS84);
        
        // Show the extent.  Not required; just for show.
        var polylines = new Cesium.PolylineCollection();
        polylines.add({
            positions: Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray([
                new Cesium.Cartographic(west, south),
                new Cesium.Cartographic(west, north),
                new Cesium.Cartographic(east, north),
                new Cesium.Cartographic(east, south),
                new Cesium.Cartographic(west, south)])
        });
        scene.getPrimitives().add(polylines);
    }
    
    function eastNorthUp(scene) {
        var center = Cesium.Ellipsoid.WGS84.cartographicToCartesian(
            Cesium.Cartographic.fromDegrees(-75.59777, 40.03883));
        var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);

        // View in east-north-up frame
        var camera = scene.getCamera();
        camera.transform = transform;
        camera.controller.constrainedAxis = Cesium.Cartesian3.UNIT_Z;
        
        var controller = scene.getScreenSpaceCameraController();
        controller.setEllipsoid(Cesium.Ellipsoid.UNIT_SPHERE);
        controller.enableTilt = false;

        // Zoom in
        camera.controller.lookAt(
            new Cesium.Cartesian3(120000.0, 120000.0, 120000.0),
            Cesium.Cartesian3.ZERO,
            Cesium.Cartesian3.UNIT_Z);

        // Show reference frame.  Not required.
        var primitives = scene.getPrimitives();
        var polylines = new Cesium.PolylineCollection();
        polylines.modelMatrix = transform;
        
        var xAxis = {
                color : new Cesium.Color(1.0, 0.0, 0.0, 1.0),
                positions : [
                    Cesium.Cartesian3.ZERO,
                    new Cesium.Cartesian3(100000.0, 0.0, 0.0)
                ]
        };
        polylines.add(xAxis);
        
        var yAxis = {
                color : new Cesium.Color(0.0, 1.0, 0.0, 1.0),
                positions : [
                    Cesium.Cartesian3.ZERO,
                    new Cesium.Cartesian3(0.0, 100000.0, 0.0)
                ]
        };
        polylines.add(yAxis);
        
        var zAxis = {
                color : new Cesium.Color(0.0, 0.0, 1.0, 1.0),
                positions : [
                    Cesium.Cartesian3.ZERO,
                    new Cesium.Cartesian3(0.0, 0.0, 100000.0)
                ]
        };
        polylines.add(zAxis);
        
        primitives.add(polylines);
    }
    
    function reset(scene) {
        scene.getPrimitives().removeAll();
        scene.getAnimations().removeAll();
        
        var camera = scene.getCamera();
        if (camera.transform.equals(Cesium.Matrix4.IDENTITY)) {<commit_msg>Disable mouse input on camera flight in the Sandcastle examples.<commit_after><!DOCTYPE html>
<html lang="en">
<head>
    <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.">
    <title>Cesium Demo</title>
    <script type="text/javascript" src="../Sandcastle-header.js"></script>
    <script data-dojo-config="async: 1, tlmSiblingOfDojo: 0" src="../../../ThirdParty/dojo-release-1.7.2-src/dojo/dojo.js"></script>
    <script type="text/javascript">
    require({
        baseUrl : '../../..',
        packages: [
            { name: 'dojo', location: 'ThirdParty/dojo-release-1.7.2-src/dojo' },
            { name: 'dijit', location: 'ThirdParty/dojo-release-1.7.2-src/dijit' },
            { name: 'dojox', location: 'ThirdParty/dojo-release-1.7.2-src/dojox' },
            { name: 'Assets', location: 'Source/Assets' },
            { name: 'Core', location: 'Source/Core' },
            { name: 'DynamicScene', location: 'Source/DynamicScene' },
            { name: 'Renderer', location: 'Source/Renderer' },
            { name: 'Scene', location: 'Source/Scene' },
            { name: 'Shaders', location: 'Source/Shaders' },
            { name: 'ThirdParty', location: 'Source/ThirdParty' },
            { name: 'Widgets', location: 'Source/Widgets' },
            { name: 'Workers', location: 'Source/Workers' }
        ]
    });
    </script>
    <link rel="Stylesheet" href="../../../ThirdParty/dojo-release-1.7.2-src/dijit/themes/claro/claro.css" type="text/css">
    <link rel="Stylesheet" href="../../../Source/Widgets/Dojo/CesiumViewerWidget.css" type="text/css">
</head>
<body class="claro" data-sandcastle-bucket="bucket-dojo.html" data-sandcastle-title="Cesium + Dojo">
<style>
    body {
        background: #000;
        color: #eee;
        font-family: sans-serif;
        font-size: 9pt;
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    .fullSize {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        border: none;
        width: 100%;
        height: 100%;
        z-index: -1;
    }
    #toolbar {
        padding: 2px 5px;
        border-radius: 5px;
        position: absolute;
    }
</style>

<div id="cesiumContainer" class="fullSize"></div>
<div id="toolbar">Loading...</div>
<script id="cesium_sandcastle_script">
require([
    'Source/Cesium', 'Widgets/Dojo/CesiumWidget',
    'dojo/on', 'dojo/dom', 'dijit/form/Button'
], function(
    Cesium, CesiumWidget,
    on, dom, ToggleButton)
{
    "use strict";
    
    function disableInput(scene) {
        var controller = scene.getScreenSpaceCameraController();
        controller.enableTranslate = false;
        controller.enableZoom = false;
        controller.enableRotate = false;
        controller.enableTilt = false;
        controller.enableLook = false;
    }
    
    function enableInput(scene) {
        var controller = scene.getScreenSpaceCameraController();
        controller.enableTranslate = true;
        controller.enableZoom = true;
        controller.enableRotate = true;
        controller.enableTilt = true;
        controller.enableLook = true;
    }
    
    function flyToSanDiego(scene) {
        Sandcastle.declare(flyToSanDiego);    // For highlighting in Sandcastle.
        disableInput(scene);
        var destination = Cesium.Cartographic.fromDegrees(-117.16, 32.71, 15000.0);
        var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
            destination : destination,
            onComplete : function() {
                enableInput(scene);
            }
        });
        scene.getAnimations().add(flight);
    }
    
    function flyToMyLocation(scene) {
        Sandcastle.declare(flyToMyLocation);    // For highlighting in Sandcastle.
        function fly(position) {
            disableInput(scene);
            var destination = Cesium.Cartographic.fromDegrees(position.coords.longitude, position.coords.latitude, 1000.0);
            var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
                destination : destination,
                onComplete : function() {
                    enableInput(scene);
                }
            });
            scene.getAnimations().add(flight);
        }
        
        navigator.geolocation.getCurrentPosition(fly);
    }

    function viewAnExtent(scene) {
        Sandcastle.declare(viewAnExtent);   // 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.getCamera().controller.viewExtent(extent, Cesium.Ellipsoid.WGS84);
        
        // Show the extent.  Not required; just for show.
        var polylines = new Cesium.PolylineCollection();
        polylines.add({
            positions: Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray([
                new Cesium.Cartographic(west, south),
                new Cesium.Cartographic(west, north),
                new Cesium.Cartographic(east, north),
                new Cesium.Cartographic(east, south),
                new Cesium.Cartographic(west, south)])
        });
        scene.getPrimitives().add(polylines);
    }
    
    function eastNorthUp(scene) {
        var center = Cesium.Ellipsoid.WGS84.cartographicToCartesian(
            Cesium.Cartographic.fromDegrees(-75.59777, 40.03883));
        var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);

        // View in east-north-up frame
        var camera = scene.getCamera();
        camera.transform = transform;
        camera.controller.constrainedAxis = Cesium.Cartesian3.UNIT_Z;
        
        var controller = scene.getScreenSpaceCameraController();
        controller.setEllipsoid(Cesium.Ellipsoid.UNIT_SPHERE);
        controller.enableTilt = false;

        // Zoom in
        camera.controller.lookAt(
            new Cesium.Cartesian3(120000.0, 120000.0, 120000.0),
            Cesium.Cartesian3.ZERO,
            Cesium.Cartesian3.UNIT_Z);

        // Show reference frame.  Not required.
        var primitives = scene.getPrimitives();
        var polylines = new Cesium.PolylineCollection();
        polylines.modelMatrix = transform;
        
        var xAxis = {
                color : new Cesium.Color(1.0, 0.0, 0.0, 1.0),
                positions : [
                    Cesium.Cartesian3.ZERO,
                    new Cesium.Cartesian3(100000.0, 0.0, 0.0)
                ]
        };
        polylines.add(xAxis);
        
        var yAxis = {
                color : new Cesium.Color(0.0, 1.0, 0.0, 1.0),
                positions : [
                    Cesium.Cartesian3.ZERO,
                    new Cesium.Cartesian3(0.0, 100000.0, 0.0)
                ]
        };
        polylines.add(yAxis);
        
        var zAxis = {
                color : new Cesium.Color(0.0, 0.0, 1.0, 1.0),
                positions : [
                    Cesium.Cartesian3.ZERO,
                    new Cesium.Cartesian3(0.0, 0.0, 100000.0)
                ]
        };
        polylines.add(zAxis);
        
        primitives.add(polylines);
    }
    
    function reset(scene) {
        scene.getPrimitives().removeAll();
        scene.getAnimations().removeAll();
        enableInput(scene);
        
        var camera = scene.getCamera();
        if (camera.transform.equals(Cesium.Matrix4.IDENTITY)) {
{'fraction_non_alphanumeric': 0.13362909188680513, 'fraction_numerical': 0.02513947704510318, 'mean_word_length': 2.0739669421487603, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 57, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4209720', 'n_tokens_mistral': 4826, 'n_tokens_neox': 4475, 'n_words': 816}