diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index d4d02ccea941d53233b806a1dccdebe53dcb0ad7..769988d75a578e95ce8dc9272e2408c9d68f79da 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -75,7 +75,8 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' return "cell"; }; - DMACell.prototype._buildWireframe = function(mesh, geometry){//for "cell" view + DMACell.prototype._buildWireframe = function(mesh, geometry, isBeam){//for "cell" view + if (isBeam) new THREE.Mesh(geometry, wireframeMaterial.clone());//todo fix this return new THREE.Mesh(geometry, wireframeMaterial); }; @@ -252,6 +253,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' break; case "part": if (!this.parts) { + console.log(this); this._initParts(function(parts){ self.parts = parts; setVisiblity(); @@ -324,10 +326,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' }; DMACell.prototype._initBeams = function(callback){ - if (this.cells) { - _.each(this.cells) - } - var wireframe = this._buildWireframe(this.object3D.children[0], this._getGeometry()); + var wireframe = this._buildWireframe(this.object3D.children[0], this._getGeometry(), true); wireframe.name = "beam"; if (wireframe.material.wireframeLinewidth) wireframe.material.wireframeLinewidth = 5; else wireframe.material.linewidth = 5; @@ -408,8 +407,8 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' var data = { materialName: this.materialName }; - if (materials[this.materialName].cells) return data;//material definition in material composites - if (this.cells) data.cells = this.cells; +// if (materials[this.materialName].sparseCells) return data;//material definition in material composites +// if (this.cells) data.cells = this.cells; return data; }; diff --git a/js/cells/supercells/DMASuperCell.js b/js/cells/supercells/DMASuperCell.js index 024c21e90d4baff642054af1132722b1771dd102..a2fe3a82bb3b58f1c9b0ce736649b05b8d739218 100644 --- a/js/cells/supercells/DMASuperCell.js +++ b/js/cells/supercells/DMASuperCell.js @@ -143,11 +143,5 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], }); }; - DMASuperCell.prototype.toJSON = function(){ - var data = DMACell.prototype.toJSON.call(this); - if (this.cells) data.cells = this.cells; - return data; - }; - return DMASuperCell; }); \ No newline at end of file diff --git a/js/lattice/LatticeBase.js b/js/lattice/LatticeBase.js index 74c430f3570c9b4fe3ae5224ee416fdd4506351d..5c264f4e5e00607b18eca561f3ad26bcfe84cbfb 100644 --- a/js/lattice/LatticeBase.js +++ b/js/lattice/LatticeBase.js @@ -489,7 +489,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre parseCellsJSON: function(sparseCells){ var cellsMin = this.get("cellsMin"); this._loopCells(sparseCells, function(cell, x, y, z, self){ - if (cell) self.addCellAtIndex((new THREE.Vector3(x, y, z)).add(cellsMin), true, true, cell.material); + if (cell) self.addCellAtIndex((new THREE.Vector3(x, y, z)).add(cellsMin), true, true, cell.materialName); }); },