From e792637556f90f90d57f75b79a4b4745020408ec Mon Sep 17 00:00:00 2001
From: Amanda Ghassaei <amandaghassaei@gmail.com>
Date: Fri, 30 Jan 2015 11:57:53 -0500
Subject: [PATCH] scene remove working again

---
 js/fea/dmaCell.js          | 2 +-
 js/fea/dmaPart.js          | 2 +-
 js/models/fillGeometry.js  | 2 +-
 js/threeViews/threeView.js | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/js/fea/dmaCell.js b/js/fea/dmaCell.js
index f38bcb30..9690ce5f 100644
--- a/js/fea/dmaCell.js
+++ b/js/fea/dmaCell.js
@@ -147,7 +147,7 @@
 
     DMACell.prototype.destroy = function(){
         if (this.cellMesh) {
-            window.three.sceneRemove(this.cellMesh);
+            window.three.sceneRemove(this.cellMesh, "cell");
             this.cellMesh.myCell = null;
 //            this.cellMesh.dispose();
 //            geometry.dispose();
diff --git a/js/fea/dmaPart.js b/js/fea/dmaPart.js
index 0ece1745..833117b3 100644
--- a/js/fea/dmaPart.js
+++ b/js/fea/dmaPart.js
@@ -93,7 +93,7 @@
 
     DMAPart.prototype.destroy = function(){
         if (this.mesh) {
-            window.three.sceneRemove(this.mesh);
+            window.three.sceneRemove(this.mesh, "part");
 //            this.mesh.dispose();
 //            geometry.dispose();
 //            material.dispose();
diff --git a/js/models/fillGeometry.js b/js/models/fillGeometry.js
index 4c487024..8980a1a3 100644
--- a/js/models/fillGeometry.js
+++ b/js/models/fillGeometry.js
@@ -60,7 +60,7 @@ FillGeometry = Backbone.Model.extend({
 
     remove: function(){
         if (!this.get("mesh")) return;
-        window.three.sceneRemove(this.get("mesh"));
+        window.three.sceneRemove(this.get("mesh"), null);
         this.set("mesh", null);
         window.three.render();
     },
diff --git a/js/threeViews/threeView.js b/js/threeViews/threeView.js
index 7b33d5a4..141369ac 100644
--- a/js/threeViews/threeView.js
+++ b/js/threeViews/threeView.js
@@ -172,7 +172,7 @@ ThreeView = Backbone.View.extend({
 
     _drawBasePlane: function(){
 
-        if (this.basePlane) window.three.sceneRemove(this.basePlane);
+        if (this.basePlane) window.three.sceneRemove(this.basePlane, "basePlane");
 
         var type = this.lattice.get("cellType");
         var connectionType = this.lattice.get("connectionType");
-- 
GitLab