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

fixes to conductor view

parent 3701619d
Branches
No related tags found
No related merge requests found
......@@ -245,8 +245,10 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
this.object3D.children[0].material = material;
};
DMACell.prototype.setWireframeVisibility = function(visible){
this.object3D.children[1].visible = visible;
DMACell.prototype.setWireframeVisibility = function(visible, mode){
if (visible && mode === undefined) mode = this.getConditionalMode(appState.get("cellMode"));
console.log(visible && this.object3D.children[1].name == mode);
this.object3D.children[1].visible = visible && this.object3D.children[1].name == mode;
};
DMACell.prototype.setTransparent = function(evalFunction){
......@@ -257,14 +259,20 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
this.setWireframeVisibility(!this.isTransparent);
};
DMACell.prototype.getConditionalMode = function(mode){
if (mode == "supercell" && this._isTopLayerCell()) return "cell";
return mode;
};
DMACell.prototype.setMode = function(mode, callback){
if (!mode || mode === undefined) mode = appState.get("cellMode");
var self = this;
mode = this.getConditionalMode(mode);
switch(mode) {
case "supercell":
if (this._isTopLayerCell()) mode = "cell";//top level item
setVisiblity();
break;
case "cell":
......@@ -299,12 +307,12 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
var visible = true;
if (mode == "supercell") visible = !self._isMiddleLayer();//middle layers are always hidden in supercell mode
self.setWireframeVisibility(!self.isTransparent);
_.each(self.object3D.children, function(child){
if (child.name == "object3D") return;
child.visible = visible && (child.name == mode);
});
self.setWireframeVisibility(!self.isTransparent, mode);
if (callback) {
callback();
return;
......
......@@ -102,7 +102,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
cellsMax: cellsMax,
elementaryChildren: materials.getChildCellTypes(this.sparseCells, true),
compositeChildren: materials.getChildCellTypes(this.sparseCells, false),
dimensions: _dimensions
dimensions: _dimensions,
properties: {
}
};
return data;
},
......
......@@ -65,6 +65,7 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell'], function(latti
_.extend(lattice, eSimMethods);
lattice.listenTo(appState, "change:currentTab", lattice._eSimTabChanged);
lattice.listenTo(eSim, "change:visibleConductorGroup", lattice._showConductors);
lattice._showConductors();
return lattice;
......
......@@ -5,7 +5,7 @@
<% if (allPartTypes[cellType][connectionType]){ %>
<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="beam" class="btn btn-primary btn-ribbon ribbonCellMode<% if (cellMode == "beam"){ %> ribbon-selected<% } %>" href="#">Beam</a>-->
<a class="btn btn-primary btn-ribbon ribbonDeleteMode<% if (deleteMode){ %> ribbon-selected"<% } %>"><span class="fui-cross"></span></a>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment