From 2b71e580f394589f398256000a6b86481b2baab8 Mon Sep 17 00:00:00 2001 From: Amanda Ghassaei <amandaghassaei@gmail.com> Date: Mon, 8 Jun 2015 21:35:07 -0700 Subject: [PATCH] workingon gik rendering --- js/cells/DMACell.js | 8 ++++++-- js/cells/GIKCell.js | 4 ++++ js/cells/supercells/DMASuperCell.js | 4 ++++ js/cells/supercells/GIKSuperCell.js | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index a84ae82e..e8fadf15 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 8ce29634..64fe2ca2 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 b245ce3e..208a541a 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 818a6aa1..85cd8e3e 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 -- GitLab