diff --git a/js/lattice/Lattice.js b/js/lattice/Lattice.js index 06cd6f9612dedf31255c9efb45b41bf3d6d788b5..e6444a228f1779029bb9d98a4409531d1cf54334 100644 --- a/js/lattice/Lattice.js +++ b/js/lattice/Lattice.js @@ -127,6 +127,28 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre + //cells array + + _parseSparseCell: function(){ + this.cells = [[[null]]]; + if (this.get("numCells") == 0) { + console.warn("no cells in assembly"); + return; + } + + var bounds = this.calculateBoundingBox(); + var size = bounds.max.sub(bounds.min); + console.log(size); + + }, + + + + + + + + //3d ui addHighlightableCell: function(cell){ @@ -152,6 +174,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre _navChanged: function(){ var currentNav = appState.get("currentNav"); if (currentNav != "navComposite" && this.compositeEditor && this.exitCompositeEditing) this.exitCompositeEditing(); + if ((currentNav == "electronicNavSim" || currentNav == "mechanicalNavSim" || currentNav == "navAssemble") + && appState.previous("currentNav") == "navDesign") this._parseSparseCell(); }, getCompositeData: function(){ diff --git a/js/lattice/LatticeBase.js b/js/lattice/LatticeBase.js index ef6c404a9b38e02bfe4e221a3ff6fec404b7d553..c0976ea0088406bf64b2b5def940e2ac9c54fe0f 100644 --- a/js/lattice/LatticeBase.js +++ b/js/lattice/LatticeBase.js @@ -419,6 +419,9 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre + + + //events _updatePartType: function(){ diff --git a/js/models/AppState.js b/js/models/AppState.js index d83de72886f4dcf1bc569fa99b75b25073dda54f..abe5cc9c082bf590fe715b04a513c16b29899103 100644 --- a/js/models/AppState.js +++ b/js/models/AppState.js @@ -39,7 +39,7 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu realisticColorScheme: false, materialType: null, - materialClass: "mechanical", + materialClass: null, stockSimulationPlaying: false, manualSelectOrigin: false//mode that allows user ot select origin from existing cell @@ -106,10 +106,10 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu if (navSelection == "navDesign") { this.set("basePlaneIsVisible", true); this.set("highlighterIsVisible", true); + } else if (navSelection == "electronicNavSim" || navSelection == "mechanicalNavSim"){ + this.set("highlighterIsVisible", false); } else if (navSelection == "navAssemble"){ - require(['cam']); } - }, _materialTypeChanged: function(){ var materialType = this.get("materialType"); diff --git a/js/plists/PList.js b/js/plists/PList.js index 584a21bac334f242317529952ce4f98ef1ca05e8..5fe339eb4ae518270e9aa6573397f8a1f97deed7 100644 --- a/js/plists/PList.js +++ b/js/plists/PList.js @@ -105,7 +105,7 @@ define(['three'], function(THREE){ vertex: 'mechanical' }, cube: { - face: 'mechanical', + face: 'electronic', gik: 'electronic' }, truncatedCube: {face: 'mechanical'}, diff --git a/todo b/todo index 689cbfd84a16b6b8be267e7757d9e95d2e7b202d..2206ba8f718a571880a83bf959ba423304cfaf7a 100644 --- a/todo +++ b/todo @@ -12,3 +12,6 @@ hierarchical material transformations -> change material of a cell, change in bulk rendering callbacks + + +highligher - check mode, do not add cells except in design/composite/material modes \ No newline at end of file