From 5cf7bb1f6fd7b1a94dbdd709bf2549cba5b95b8e Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Mon, 20 Jul 2015 00:42:16 +0400
Subject: [PATCH] gik connectivity

---
 js/cells/GIKCell.js       | 12 ++++++++++++
 js/lattice/Lattice.js     |  1 -
 js/lattice/LatticeBase.js |  1 -
 js/lattice/LatticeEsim.js |  5 +++--
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/js/cells/GIKCell.js b/js/cells/GIKCell.js
index b62c2a58..bd4352ab 100644
--- a/js/cells/GIKCell.js
+++ b/js/cells/GIKCell.js
@@ -33,5 +33,17 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'],
         }
     };
 
+    //todo move this somewhere else
+    GIKCell.prototype.propagateConductorGroupNum = function(num){
+        if (!this.isConductive()) return;
+        if (num === undefined) num = this._eSimConductorGroup;
+        var self = this;
+        this.superCell._loopCells(function(cell){
+            if (cell == self) return;
+            if (cell) cell.setConductorGroupNum(num);
+        });
+        CubeCell.prototype.propagateConductorGroupNum.call(this, num);
+    };
+
     return GIKCell;
 });
\ No newline at end of file
diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js
index 78eac68f..46286d2a 100644
--- a/js/lattice/Lattice.js
+++ b/js/lattice/Lattice.js
@@ -143,7 +143,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
             }
 
             var bounds = this.calculateBoundingBox();
-            console.log(bounds);
             this.set("denseCellsMin", bounds.min.clone().add(this.get("cellsMin")));
             var size = bounds.max.sub(bounds.min);
 
diff --git a/js/lattice/LatticeBase.js b/js/lattice/LatticeBase.js
index 2fd8bea6..88ce0c20 100644
--- a/js/lattice/LatticeBase.js
+++ b/js/lattice/LatticeBase.js
@@ -215,7 +215,6 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
                             if (element == -1) padding[key] = 1;
                         });
                         subCellRange.add(padding);
-                        console.log(subCellRange);
                         dimMax.max(subCellRange);
                         dimMin.min(subCellRange);
                     }
diff --git a/js/lattice/LatticeEsim.js b/js/lattice/LatticeEsim.js
index 19b5c6b9..80061c6e 100644
--- a/js/lattice/LatticeEsim.js
+++ b/js/lattice/LatticeEsim.js
@@ -56,12 +56,13 @@ define(['lattice', 'appState', 'threeModel', 'eSim', 'eSimCell', 'eSimSuperCell'
             var xLength = this.cells.length;
             var yLength = this.cells[0].length;
             var zLength = this.cells[0][0].length;
+            if (index.z+1 < zLength) callback(this.cells[index.x][index.y][index.z+1]);
+            if (index.z-1 >= 0) callback(this.cells[index.x][index.y][index.z-1]);
+            if (this.get("connectionType") == "gik") return;
             if (index.x+1 < xLength) callback(this.cells[index.x+1][index.y][index.z]);
             if (index.x-1 >= 0) callback(this.cells[index.x-1][index.y][index.z]);
             if (index.y+1 < yLength) callback(this.cells[index.x][index.y+1][index.z]);
             if (index.y-1 >= 0) callback(this.cells[index.x][index.y-1][index.z]);
-            if (index.z+1 < zLength) callback(this.cells[index.x][index.y][index.z+1]);
-            if (index.z-1 >= 0) callback(this.cells[index.x][index.y][index.z-1]);
         }
 
     };
-- 
GitLab