diff --git a/css/main.css b/css/main.css index 51164b9326056cb2f3b065f3eda7593309eb061c..2dff4b3522f069007ae830bbc7467406aaeb9794 100644 --- a/css/main.css +++ b/css/main.css @@ -405,6 +405,10 @@ label { margin-right:10px; } +#navViewMenu { + width: 200px; +} + .CodeMirror { opacity: 0.6; margin: 0 20px 0 -10px; diff --git a/index.html b/index.html index 477e8c5aed66452db3776d6bb83c70e03ba553ce..8808cde8e06689345557255bba57605f13feda37 100644 --- a/index.html +++ b/index.html @@ -39,12 +39,32 @@ <li><a class="saveJSON" href="#">Save Assembly     (CTRL/⌘ + S)</a></li> <li><a data-toggle="modal" data-target="#saveAsModel" href="#">Save Assembly As...     (CTRL/⌘ + Shift + S)</a></li> <li><a class="importJSON" href="#">Open Assembly...     (CTRL/⌘ + O)</a></li> + <li class="divider"></li> + <li class="dropdown-submenu"> + <a tabindex="-1">Keyboard Shortcuts<span class="pull-right fui-arrow-right"></span></a> + <ul class="dropdown-menu"> + <li><a>Hold D - Delete Mode</a></li> + <li><a>Hold V - Voxel Mode</a></li> + <li><a>Hold H - Hierarchical Mode</a></li> + <li><a>Hold P - Part Mode</a></li> + <li><a>Hold O - Hide Assembly</a></li> + <li><a>CTRL/⌘ + Shift + P - Save SVG Screenshot</a></li> + <li><a>CTRL/⌘ + S - Save</a></li> + <li><a>CTRL/⌘ + Shift + S - Save As</a></li> + <li><a>CTRL/⌘ + O - Open</a></li> + <li><a>Q/W - Composite Cell Placement X Offset</a></li> + <li><a>A/S - Composite Cell Placement Y Offset</a></li> + <li><a>Z/X - Composite Cell Placement Z Offset</a></li> + <li><a>Spacebar - Play/Pause Simulation</a></li> + <li><a>1-9 - Lego Length</a></li> + </ul> + </li> + <li class="divider"></li> <li class="dropdown-submenu"> <a tabindex="-1">Demo Files<span class="pull-right fui-arrow-right"></span></a> <ul class="dropdown-menu"> <li><a href="#">n/a</a></li> </ul></li> - <li class="divider"></li> <li class="dropdown-submenu"> <a tabindex="-1">Load User Data<span class="pull-right fui-arrow-right"></span></a> <ul class="dropdown-menu"> @@ -63,8 +83,6 @@ </li> </ul> </li> - <li class="divider"></li> - <li><a id="exportSTL" href="#">Export STL</a></li> </ul> </li> <li><a data-menu-id="navDesign" class="menuHoverControls" href="#">Design</a></li> diff --git a/js/menus/templates/NavViewMenu.html b/js/menus/templates/NavViewMenu.html index b79aa5f2a2299ebc24d5faa170e1adbaf981d111..c1f0f9dba4147b64fefa6218a1a2f2a02eb444a2 100644 --- a/js/menus/templates/NavViewMenu.html +++ b/js/menus/templates/NavViewMenu.html @@ -34,4 +34,3 @@ <% }); %> </ul> </li> -<li><a class="" href="#">Keyboard Shortcuts</a></li> \ No newline at end of file diff --git a/js/models/AppState.js b/js/models/AppState.js index 4aa973bb44fcc71b0efd97f6d4b4018c0f80a288..d1a466d7ea9eabc8c848a698a1ce5e2f5e0975bc 100644 --- a/js/models/AppState.js +++ b/js/models/AppState.js @@ -211,10 +211,17 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu case 68://d delete mode this.set("deleteMode", state); break; - case 72://h hide mode + case 86://cell (voxel) mode if (state) { this.lastCellMode = this.get("cellMode"); - this.set("cellMode", "hide"); + this.set("cellMode", "cell"); + } + else this.set("cellMode", this.lastCellMode); + break; + case 72://h hierarchical mode + if (state) { + this.lastCellMode = this.get("cellMode"); + this.set("cellMode", "supercell"); } else this.set("cellMode", this.lastCellMode); break; @@ -222,17 +229,19 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu // if (currentTab != "sketch") return; // this.set("extrudeMode", state); break; - case 80://p part mode - if (e.ctrlKey || e.metaKey){//command + case 80://p + if (e.ctrlKey || e.metaKey){//command + shift + p = print svg screenshot if (e.shiftKey){ e.preventDefault(); three.saveSVG(); return; } } - var cellMode = this.get("cellMode"); - if (cellMode == "part") this.set("cellMode", "cell"); - else if (cellMode == "cell") this.set("cellMode", "part"); + if (state) {//p part mode + this.lastCellMode = this.get("cellMode"); + this.set("cellMode", "part"); + } + else this.set("cellMode", this.lastCellMode); break; case 83://s save if (e.ctrlKey || e.metaKey){//command @@ -251,7 +260,13 @@ define(['underscore', 'backbone', 'threeModel', 'three', 'plist', 'globals'], fu if (e.ctrlKey || e.metaKey){//command e.preventDefault(); $("#jsonInput").click(); + return; } + if (state) {//hide mode + this.lastCellMode = this.get("cellMode"); + this.set("cellMode", "hide"); + } + else this.set("cellMode", this.lastCellMode); break; case 32://space bar (play/pause simulation) e.preventDefault(); diff --git a/js/plists/PList.js b/js/plists/PList.js index 83c957ab5c5a5959c902682582bc78d251c74bc3..845d2cff031790539cd37afa36842dba11adbc16 100644 --- a/js/plists/PList.js +++ b/js/plists/PList.js @@ -358,10 +358,10 @@ define(['three'], function(THREE){ }, allCellModes:{//supercell, cell, part, node, beam - supercell: "Hierarchical Mode", - cell: "Voxel Mode", - part: "Part Mode", - hide: "Hide Cells" + supercell: "Hierarchical Mode (H)", + cell: "Voxel Mode (V)", + part: "Part Mode (P)", + hide: "Hide Cells (O)" }, diff --git a/todo b/todo index c68559e19f9c876d3508fb412b6e302adef5648d..4f82b6a5ecec694fc6d86c6055861c865e8faea1 100644 --- a/todo +++ b/todo @@ -1,11 +1,8 @@ -import - offset, scale, rotation - +import stl fill - offset, scale, rotation hierarchical - - single layer gik throwing error on parse - origin - rotation - - load composite materials - change bounding box - placement ui 3D @@ -13,8 +10,6 @@ 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 - part stl import and orientation - settings to json -same for machine \ No newline at end of file +same for machine +