From 0dc7dbd29829942186a636530d5f0c0d52ba60a9 Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Fri, 15 May 2015 19:27:47 -0400
Subject: [PATCH] super cell length

---
 js/fea/DmaCell.js      | 5 +++++
 js/fea/DmaCellOther.js | 1 +
 2 files changed, 6 insertions(+)

diff --git a/js/fea/DmaCell.js b/js/fea/DmaCell.js
index 8e2ae2a1..709d0ff6 100644
--- a/js/fea/DmaCell.js
+++ b/js/fea/DmaCell.js
@@ -76,6 +76,8 @@ DMACell.prototype.updateForScale = function(scale, cellMode, partType){
     this._setMeshPosition(this.cellMesh, position);
     this.cellMesh.scale.set(scale, scale, scale);//must do this so highlighting works properly in part mode
 
+    if (this.superCell && this.superCellIndex == 0) this.superCell.setScale(scale);
+
     //only update visible object to scale
     if (!cellMode) cellMode = dmaGlobals.appState.get("cellMode");
     if (!partType)  partType = dmaGlobals.lattice.get("partType");
@@ -249,6 +251,9 @@ DMACell.prototype.destroy = function(){
     this.indices = null;
     this.nodes = null;
     this.beams = null;
+    this.superCell = null;
+    this.superCellIndex = null;
+    this.superCellLength = null;
 };
 
 DMACell.prototype.toJSON = function(){
diff --git a/js/fea/DmaCellOther.js b/js/fea/DmaCellOther.js
index adcd7cae..44c56035 100644
--- a/js/fea/DmaCellOther.js
+++ b/js/fea/DmaCellOther.js
@@ -78,6 +78,7 @@ var cellMaterial = [new THREE.MeshNormalMaterial()];
     };
 
     DMAGIKCell.prototype.setSuperCell = function(superCell, index, length){
+        this.superCell = superCell;
         this.superCellIndex = index;
         this.superCellLength = length;
     };
-- 
GitLab