diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index ec0ff0ecd11d07698f75d61f3d0149d3fd404bee..97fca56ca3af2538445fd0bbc75f89bcaf0ebaf0 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -52,9 +52,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre this._updateLatticeType(false); }, - //////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////ADD/REMOVE CELLS///////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //add/remove cells addCellsInRange: function(range){//add a block of cells (extrude) this.checkForMatrixExpansion(this.cells, range.max, range.min); @@ -156,9 +158,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre return {min:min, max:max}; }, - //////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////FILL GEOMETRY//////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //fill geometry subtractMesh: function(mesh){ //todo this is specific to octa face @@ -209,9 +213,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre }, - //////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////CELLS ARRAY////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //cells array checkForMatrixExpansion: function(cells, indicesMax, indicesMin){ @@ -310,9 +316,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre return false; }, - //////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////EVENTS////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //events _updatePartType: function(){ this._iterCells(this.cells, function(cell){ @@ -378,9 +386,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre }); }, - //////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////CONNECTION TYPE////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //lattice type _updateLatticeType: function(loadingFromFile){//do not clear cells if loading from file (cells array contains important metadata) @@ -464,9 +474,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre } }, - //////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////UTILS/////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //utils _iterCells: function(cells, callback){ _.each(cells, function(cellLayer){ @@ -565,9 +577,11 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre return {x:xScale, y:yScale, z:zScale}; }, - //////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////UI/////////////////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////////////// + + + + + //save/load toJSON: function(){//a minimal toJSON for ui stuff - no need to parse all cells return _.omit(this.attributes, ["cells", "nodes"]);//omit makes a copy