diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index a84ae82e42817ef73a4d9566624ed72dfa4ee4c6..e8fadf15227fe6f0efb7133952265370a714c315 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -65,16 +65,20 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals'], var meshes = []; var mesh = new THREE.Mesh(geometry, this.getMaterial()); - mesh.name = "cell"; + mesh.name = this._getMeshName(); meshes.push(mesh); var wireframe = this._buildWireframe(mesh, geometry); if (!wireframe) return meshes; - wireframe.name = "cell"; + wireframe.name = this._getMeshName(); meshes.push(wireframe); return meshes; }; + DMACell.prototype._getMeshName = function(){ + return "cell"; + }; + DMACell.prototype._buildWireframe = function(mesh, geometry){//for "cell" view return new THREE.Mesh(geometry, wireframeMaterial); }; diff --git a/js/cells/GIKCell.js b/js/cells/GIKCell.js index 8ce29634bb793e19074b18c34f97024d2c6b3b3b..64fe2ca20cb21c83c8649790c8118f2e7c803f99 100644 --- a/js/cells/GIKCell.js +++ b/js/cells/GIKCell.js @@ -19,6 +19,10 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'], return object3D; }; + GIKCell.prototype._getMeshName = function(){ + return null; + }; + GIKCell.prototype._initParts = function(){ if (!this.superCell) return; var self = this; diff --git a/js/cells/supercells/DMASuperCell.js b/js/cells/supercells/DMASuperCell.js index b245ce3ee6d2fe77d47c9bdc1b302b62f086ce5f..208a541a1c11918c8edf15b9f231c884de8f40d3 100644 --- a/js/cells/supercells/DMASuperCell.js +++ b/js/cells/supercells/DMASuperCell.js @@ -38,6 +38,10 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], return null;//override in subclasses }; + DMASuperCell.prototype._getMeshName = function(){ + return "supercell"; + }; + DMASuperCell.prototype.setMode = function(mode){ DMACell.prototype.setMode.call(this, mode); this._loopCells(function(cell){ diff --git a/js/cells/supercells/GIKSuperCell.js b/js/cells/supercells/GIKSuperCell.js index 818a6aa1c7e62de496293c9c11efb72bbcd934c6..85cd8e3e222c997c988c43dee1df3ec869983027 100644 --- a/js/cells/supercells/GIKSuperCell.js +++ b/js/cells/supercells/GIKSuperCell.js @@ -39,5 +39,9 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'superCell', return wireframe; }; + GIKSuperCell.prototype._getMeshName = function(){ + return "cell"; + }; + return GIKSuperCell; }); \ No newline at end of file