diff --git a/js/fea/DMASuperCell.js b/js/fea/DMASuperCell.js index 29290b8cb301df18182d76cf9397f50882b5cfa1..c964f37f7fec2e78e1569e81f30d93f5c391f58a 100644 --- a/js/fea/DMASuperCell.js +++ b/js/fea/DMASuperCell.js @@ -37,6 +37,10 @@ DMASuperCell.prototype.setScale = function(scale){ this._setPosition(this.index); }; +DMASuperCell.prototype.setVisibility = function(visible){ + this.mesh.visible = visible; +}; + DMASuperCell.prototype.destroy = function(){ if (this.destroyStarted) return;//prevents loop destroy from cells this.destroyStarted = true; diff --git a/js/fea/DmaCellOther.js b/js/fea/DmaCellOther.js index 44c56035f75222cd395fc49c5bcc4f2851899d79..f860da2a7663bb7e3c595af7d25e4526414e9f20 100644 --- a/js/fea/DmaCellOther.js +++ b/js/fea/DmaCellOther.js @@ -75,6 +75,7 @@ var cellMaterial = [new THREE.MeshNormalMaterial()]; DMAGIKCell.prototype._setCellMeshVisibility = function(visible){ this.cellMesh.visible = false; + if (this.superCell) this.superCell.setVisibility(visible); }; DMAGIKCell.prototype.setSuperCell = function(superCell, index, length){ diff --git a/js/main.js b/js/main.js index 3e99751012595c8c1beabb7db4e7c2a9408ad2ed..fd52e31d80ac1de9038a6e2db0a22bcb0d74aca4 100644 --- a/js/main.js +++ b/js/main.js @@ -26,5 +26,5 @@ $(function(){ //threeJS View new ThreeView({model:dmaGlobals.three, appState:dmaGlobals.appState}); - dmaGlobals.lattice.addCellAtIndex({x:0,y:0,z:0});//add a cell + if (dmaGlobals.lattice.get("connectionType") != "gik") dmaGlobals.lattice.addCellAtIndex({x:0,y:0,z:0});//add a cell });