Commit c9028d2c authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

turn off on rendering

parent 54cae05b
......@@ -19,8 +19,9 @@
<li class="dropdown-submenu">
<a tabindex="-1">Rendering<span class="pull-right fui-arrow-right"></span></a>
<ul class="dropdown-menu">
<li><a class="appState boolProperty" data-property="renderAmbientOcclusion" href="#">Ambient Occlusion</a></li>
<!--<li><a class="appState boolProperty" data-property="renderAmbientOcclusion" href="#">Ambient Occlusion</a></li>-->
<li><a class="appState boolProperty" data-property="realisticColorScheme" href="#">Realistic Color Scheme</a></li>
<li><a class="appState boolProperty" data-property="turnOffRendering" href="#">Turn Off Rendering</a></li>
</ul>
</li>
<li class="dropdown-submenu">
......
......@@ -20,6 +20,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu
scriptIsVisible: false,
consoleIsVisible: false,
ribbonIsVisible: true,
turnOffRendering: false,
basePlaneIsVisible:true,
highlighterIsVisible:true,
......@@ -60,6 +61,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu
this.listenTo(this, "change:currentNav", this._navChanged);
this.listenTo(this, "change:materialType", this._materialTypeChanged);
this.listenTo(this, "change:gikLength", this._gikLengthChanged);
this.listenTo(this, "change:turnOffRendering", this._renderingOnOff);
this.downKeys = {};//track keypresses to prevent repeat keystrokes on hold
this.lastCellMode = this.get("cellMode");//store this to toggle on/off hide mode
......@@ -139,6 +141,11 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu
}
},
_renderingOnOff: function(){
if (!this.get("turnOffRendering")) three.render();
},
///////////////////////////////////////////////////////////////////////////////
/////////////////////KEY BINDINGS//////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
......
......@@ -9,6 +9,11 @@ define(['underscore', 'three'], function(_, THREE){
var scene = new THREE.Scene();
var renderer = new THREE.WebGLRenderer({antialias:true});//antialiasing is not supported in ff and on mac+chrome
var appState;
require(['appState'], function(globalAppState){
appState = globalAppState;
});
//store all meshes to highlight
var cells = [];
var compositeCells = [];
......@@ -122,7 +127,7 @@ define(['underscore', 'three'], function(_, THREE){
}
function startAnimationLoop(){
if (animationLoopRunning) return;
if (appState.get("turnOffRendering") || animationLoopRunning) return;
stopAnimationFlag = false;
animationLoopRunning = true;
console.log("animation started");
......@@ -145,7 +150,7 @@ define(['underscore', 'three'], function(_, THREE){
}
function render(){
if (animationLoopRunning) return;
if ((appState && appState.get("turnOffRendering")) || animationLoopRunning) return;
_render();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment