Skip to content

Commit

Permalink
Add read-only flag, and update tests to use new flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed Sep 9, 2014
1 parent b8bb6e0 commit b72081d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,19 @@ define([
}
},

/**
* Gets whether or not the scene has order independent translucency enabled.
* Note that this only reflects the original construction option, and there are
* other factors that could prevent OIT from functioning on a given system configuration.
* @memberof Scene.prototype
* @type {Boolean}
*/
orderIndependentTranslucency : {
get : function() {
return defined(this._oit);
}
},

/**
* Gets the unique identifier for this scene.
* @memberof Scene.prototype
Expand Down
4 changes: 2 additions & 2 deletions Specs/Widgets/CesiumWidget/CesiumWidgetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ defineSuite([
widget = new CesiumWidget(container, {
orderIndependentTranslucency : true
});
expect(widget.scene._oit).toBeDefined();
expect(widget.scene.orderIndependentTranslucency).toBe(true);
});

it('can disable Order Independent Translucency', function() {
widget = new CesiumWidget(container, {
orderIndependentTranslucency : false
});
expect(widget.scene._oit).not.toBeDefined();
expect(widget.scene.orderIndependentTranslucency).toBe(false);
});

it('throws if no container provided', function() {
Expand Down
4 changes: 2 additions & 2 deletions Specs/Widgets/Viewer/ViewerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ defineSuite([
viewer = new Viewer(container, {
orderIndependentTranslucency : true
});
expect(viewer.scene._oit).toBeDefined();
expect(viewer.scene.orderIndependentTranslucency).toBe(true);
});

it('can disable Order Independent Translucency', function() {
viewer = new Viewer(container, {
orderIndependentTranslucency : false
});
expect(viewer.scene._oit).not.toBeDefined();
expect(viewer.scene.orderIndependentTranslucency).toBe(false);
});

it('can set scene mode', function() {
Expand Down

0 comments on commit b72081d

Please sign in to comment.