Skip to content
Snippets Groups Projects
Commit 4b4b5ce9 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

hide mode toggle

parent 13c45a8d
Branches
No related tags found
No related merge requests found
......@@ -432,6 +432,18 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
_updateForMode: function(){
var cellMode = appState.get("cellMode");
var numCells = this.get("numCells");
if (cellMode == "hide"){
this._iterCells(this.sparseCells, function(cell){
if (cell) cell.hide();
});
three.render();
return;
}
if (appState.previous("cellMode") == "hide"){
this._iterCells(this.sparseCells, function(cell){
if (cell) cell.show();
});
}
this._iterCells(this.sparseCells, function(cell){
if (cell) cell.setMode(cellMode, function(){
if (--numCells <= 0) three.render();
......
......@@ -48,7 +48,7 @@
</label>
<% }); %>
<% if(visibleStaticSim != "none"){ %>
Simulation Z Height: &nbsp;&nbsp;<input data-property="simZHeight" value="<%= simZHeight %>" placeholder="Height" class="form-control intInput eSim" type="text"><br/><br/>
Simulation Z Height (up/down arrows): &nbsp;&nbsp;<input data-property="simZHeight" value="<%= simZHeight %>" placeholder="Height" class="form-control intInput eSim" type="text"><br/><br/>
<% } %>
<% } else { %>
<div class="inlineWarning">No conductive groups detected, please navigate to previous tab and calculate.</div>
......
......@@ -6,6 +6,7 @@
<a data-type="part" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "part"){ %> ribbon-selected<% } %>" href="#"><img data-type="part" src="assets/imgs/part-sm.png"></a>
<% } %>
<!--<a data-type="beam" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "beam"){ %> ribbon-selected<% } %>" href="#">Beam</a>-->
<a data-type="hide" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "hide"){ %> ribbon-selected"<% } %>">Hide</a>
<a class="btn btn-primary btn-ribbon ribbonDeleteMode<% if (deleteMode){ %> ribbon-selected"<% } %>"><span class="fui-cross"></span></a>
</div>
</div>
......
......@@ -62,6 +62,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu
this.listenTo(this, "change:gikLength", this._gikLengthChanged);
this.downKeys = {};//track keypresses to prevent repeat keystrokes on hold
this.lastCellMode = this.get("cellMode");//store this to toggle on/off hide mode
if (this.isMobile()) this.set("menuIsVisible", false);
},
......@@ -170,6 +171,13 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu
case 68://d delete mode
this.set("deleteMode", state);
break;
case 72://h hide mode
if (state) {
this.lastCellMode = this.get("cellMode");
this.set("cellMode", "hide");
}
else this.set("cellMode", this.lastCellMode);
break;
case 69://e
// if (currentTab != "sketch") return;
this.set("extrudeMode", state);
......
......@@ -5,7 +5,7 @@
//hold and display data for various fields
define(['underscore', 'threeModel'], function(_, three){
define(['underscore', 'threeModel', 'lattice'], function(_, three, lattice){
function ESimField(data, offset, resolution, height, dataRange){
......@@ -36,7 +36,7 @@ define(['underscore', 'threeModel'], function(_, three){
};
ESimField.prototype._setObject3DPosition = function(offset, resolution, height){
this._object3D.position.set(offset.x, offset.y, offset.z+height/resolution);
this._object3D.position.set(offset.x, offset.y, offset.z+height*lattice.zScale()/resolution);
};
ESimField.prototype._createThreeObjects = function(data, offset, size, height, object3D){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment