Skip to content
Snippets Groups Projects
Commit 5c8c2617 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

min number of dimensions calls

parent 619c8b21
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,8 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'], ...@@ -14,7 +14,8 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'],
DMACell.call(this, json, superCell); DMACell.call(this, json, superCell);
var material = this.getMaterial(); var material = this.getMaterial();
var range = (new THREE.Vector3(1,1,1)).add(material.cellsMax).sub(material.cellsMin); var range = appState.get("superCellRange");
if (material.cellsMax) (new THREE.Vector3(1,1,1)).add(material.cellsMax).sub(material.cellsMin);
this.cells = this._makeChildCells(range, material); this.cells = this._makeChildCells(range, material);
DMACell.prototype.setMode.call(this, null, function(){ DMACell.prototype.setMode.call(this, null, function(){
......
...@@ -38,7 +38,7 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', ' ...@@ -38,7 +38,7 @@ define(['underscore', 'backbone', 'threeModel', 'appState', 'lattice', 'cell', '
_setRotation: function(direction){ _setRotation: function(direction){
if (lattice.connectionType == "gik"){ if (lattice.get("connectionType") == "gik"){
if (!this.highlightedObject) return; if (!this.highlightedObject) return;
var index = this.highlightedObject.getAbsoluteIndex(); var index = this.highlightedObject.getAbsoluteIndex();
......
...@@ -19,19 +19,15 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre ...@@ -19,19 +19,15 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
color: null color: null
}), }),
__bindEvents: function(){
},
__initialize: function(options, callback){ __initialize: function(options, callback){
if (!options.id || options.id == "") this.set("id", "super" + this.cid); if (!options.id || options.id == "") this.set("id", "super" + this.cid);
if (!options.color || options.color == "") this.set("color", makeRandomColor(), {silent:true}); if (!options.color || options.color == "") this.set("color", makeRandomColor(), {silent:true});
if (callback) callback(this); if (callback) callback(this);
}, },
initLatticeSubclass: function(subclass){
var self = this;
require([subclass], function(subclassObject){
_.extend(self, subclassObject);
});
},
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], function($, _, MenuParentView, plist, lattice, globals){ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], function($, _, MenuParentView, plist, lattice, globals){
var dimensions;
return MenuParentView.extend({ return MenuParentView.extend({
events: { events: {
...@@ -20,8 +22,13 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], fu ...@@ -20,8 +22,13 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], fu
console.warn("no composite editor inited"); console.warn("no composite editor inited");
return; return;
} }
this.listenTo(lattice.compositeEditor, "change", this.render); this.listenTo(lattice.compositeEditor, "change", function(){
if (lattice.compositeEditor.changedAttributes().numCells !== undefined) dimensions = lattice.compositeEditor.calculateBoundingBox();
this.render();
});
this.listenTo(lattice, "change", this.render); this.listenTo(lattice, "change", this.render);
dimensions = lattice.compositeEditor.calculateBoundingBox();
}, },
_changeRandomColor: function(e){ _changeRandomColor: function(e){
...@@ -75,7 +82,7 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], fu ...@@ -75,7 +82,7 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice', 'globals'], fu
{ {
materialClass:lattice.get("materialClass"), materialClass:lattice.get("materialClass"),
materialType:lattice.get("materialType"), materialType:lattice.get("materialType"),
dimensions: lattice.compositeEditor.calculateBoundingBox() dimensions: dimensions
}); });
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment