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

gik composite view is happy

parent a2147ef7
No related branches found
No related tags found
No related merge requests found
...@@ -245,7 +245,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' ...@@ -245,7 +245,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
switch(mode) { switch(mode) {
case "supercell": case "supercell":
if (!this.superCell && !this.cells) mode = "cell";//top level item if (this._isTopLayerCell()) mode = "cell";//top level item
setVisiblity(); setVisiblity();
break; break;
case "cell": case "cell":
...@@ -278,7 +278,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' ...@@ -278,7 +278,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
function setVisiblity(){ function setVisiblity(){
var visible = true; var visible = true;
if (mode == "supercell") visible = !(self.superCell && self.cells);//middle layers are always hidden in supercell mode if (mode == "supercell") visible = !self._isMiddleLayer();//middle layers are always hidden in supercell mode
_.each(self.object3D.children, function(child){ _.each(self.object3D.children, function(child){
if (child.name == "object3D") return; if (child.name == "object3D") return;
...@@ -293,6 +293,15 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' ...@@ -293,6 +293,15 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
} }
}; };
DMACell.prototype._isMiddleLayer = function(){
return false;
};
DMACell.prototype._isTopLayerCell = function(){
return this.superCell === null || this.superCell === undefined;
};
......
...@@ -95,6 +95,14 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], ...@@ -95,6 +95,14 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'],
}; };
DMASuperCell.prototype._isMiddleLayer = function(){
return this.superCell !== null && this.superCell !== undefined;
};
DMASuperCell.prototype._isTopLayerCell = function(){
return false;
};
......
...@@ -61,6 +61,14 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', ...@@ -61,6 +61,14 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell',
return "cell"; return "cell";
}; };
GIKSuperCell.prototype._isMiddleLayer = function(){
return false;
};
GIKSuperCell.prototype._isTopLayerCell = function(){
return this.superCell === null || this.superCell === undefined;
};
GIKSuperCell.prototype.toJSON = function(){ GIKSuperCell.prototype.toJSON = function(){
var data = DMASuperCell.prototype.toJSON.call(this); var data = DMASuperCell.prototype.toJSON.call(this);
if (!this.length) console.warn("no length assigned to gik supercell"); if (!this.length) console.warn("no length assigned to gik supercell");
......
...@@ -14,6 +14,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre ...@@ -14,6 +14,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
require([this.getHighlighterFile()], function(superCellHighlighter){ require([this.getHighlighterFile()], function(superCellHighlighter){
globals.highlighter = new superCellHighlighter(); globals.highlighter = new superCellHighlighter();
}); });
appState.set("superCellRange", new THREE.Vector3(appState.get("gikLength"), 1, 1));
}, },
getHighlighterFile: function(){ getHighlighterFile: function(){
......
...@@ -39,6 +39,11 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals', 'ma ...@@ -39,6 +39,11 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals', 'ma
lattice.compositeEditor._changeRandomColor(); lattice.compositeEditor._changeRandomColor();
}, },
getPropertyOwner: function($target){
if ($target.hasClass("compositeEditor")) return lattice.compositeEditor;
return null;
},
updateHex: function(hex){ updateHex: function(hex){
//update hex without rendering //update hex without rendering
$("#compositeColor").css("border-color", hex); $("#compositeColor").css("border-color", hex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment