Commit 65b78eb0 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

stopping pt

parent dcea419d
...@@ -29,11 +29,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre ...@@ -29,11 +29,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
__initialize: function(){ __initialize: function(){
this.listenTo(this, "change:partType change:latticeType", this._updatePartType); this.listenTo(this, "change:partType", this._updatePartType);
this.listenTo(this, "change:cellType change:connectionType", function(){ this.listenTo(this, "change:cellType change:connectionType change:latticeType", function(){
this._updateLatticeConfig();//pass no params this._updateLatticeConfig();//pass no params
}); });
this.listenTo(this, "change:latticeType", this._updateLatticeType);
this.listenTo(appState, "change:currentNav", this._navChanged); this.listenTo(appState, "change:currentNav", this._navChanged);
this.listenTo(this, "change:cellsMin change:cellsMax", function(){ this.listenTo(this, "change:cellsMin change:cellsMax", function(){
...@@ -54,24 +53,18 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre ...@@ -54,24 +53,18 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
_setToDefaultsSilently: function(){ _setToDefaultsSilently: function(){
var newCellType = this.get("cellType"); var newCellType = this.get("cellType");
var newConnectionType = this.get("connectionType"); var newConnectionType = this.get("connectionType");
var newLatticeType = this.get("latticeType");
if (newConnectionType == this.previous("connectionType")){ if (this.previous("cellType") !== undefined && newCellType != this.previous("cellType")){
newConnectionType = _.keys(plist.allLattices[newCellType].connection)[0]; newConnectionType = _.keys(plist.allLattices[newCellType].connection)[0];
this.set("connectionType", newConnectionType, {silent:true}); this.set("connectionType", newConnectionType, {silent:true});
} }
var newLatticeType = this.get("latticeType"); if (this.previous("connectionType") !== undefined && newConnectionType != this.previous("connectionType")){
if (newLatticeType === this.previous("latticeType")){
newLatticeType = _.keys(plist.allLattices[newCellType].connection[newConnectionType].type)[0]; newLatticeType = _.keys(plist.allLattices[newCellType].connection[newConnectionType].type)[0];
this.set("latticeType", newLatticeType, {silent:true}); this.set("latticeType", newLatticeType, {silent:true});
} }
var latticeData = this._getLatticePlistData();
var newPartType = null;
if (latticeData.parts) newPartType = _.keys(latticeData.parts)[0];
this.set("partType", newPartType, {silent:true});
this._updateLatticeType(); this._updateLatticeType();
}, },
...@@ -79,6 +72,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre ...@@ -79,6 +72,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var latticeData = this._getLatticePlistData(); var latticeData = this._getLatticePlistData();
this.set("aspectRatio", latticeData.aspectRatio.clone(), {silent:true}); this.set("aspectRatio", latticeData.aspectRatio.clone(), {silent:true});
var newPartType = null;
if (latticeData.parts) newPartType = _.keys(latticeData.parts)[0];
this.set("partType", newPartType, {silent:true});
var newMaterialClass = (latticeData.materialClasses || _.keys(plist.allMaterialClasses))[0]; var newMaterialClass = (latticeData.materialClasses || _.keys(plist.allMaterialClasses))[0];
appState.set("materialClass", newMaterialClass); appState.set("materialClass", newMaterialClass);
......
...@@ -56,8 +56,6 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex ...@@ -56,8 +56,6 @@ define(['jquery', 'underscore', 'plist', 'backbone', 'lattice', 'appState', 'tex
serialComm.openSerialMonitor(); serialComm.openSerialMonitor();
}); });
} }
console.log(e);
}, },
_updateString: function(e){ _updateString: function(e){
......
...@@ -12,7 +12,8 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen ...@@ -12,7 +12,8 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen
events: { events: {
"click a": "_makeSelection", "click a": "_makeSelection",
"click #reset3DView": "_reset3DNavigation" "click #reset3DView": "_reset3DNavigation",
"click #videoRendering": "_videoRenderingSetup"
}, },
initialize: function(){ initialize: function(){
...@@ -23,8 +24,9 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen ...@@ -23,8 +24,9 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen
_makeSelection: function(e){ _makeSelection: function(e){
e.preventDefault();
var $target = $(e.target); var $target = $(e.target);
if ($target.hasClass("customClick")) return;
e.preventDefault();
if ($target.prop("tagName") == "SPAN") $target = $target.parent(); if ($target.prop("tagName") == "SPAN") $target = $target.parent();
var property = $target.data("property"); var property = $target.data("property");
var value = $target.data("value"); var value = $target.data("value");
...@@ -47,6 +49,11 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen ...@@ -47,6 +49,11 @@ define(['jquery', 'underscore', 'backbone', 'plist', 'lattice', 'text!navViewMen
this.model.reset3DNavigation(); this.model.reset3DNavigation();
}, },
_videoRenderingSetup: function(e){
e.preventDefault();
window.resizeTo(1000, 700);
},
render: function(){ render: function(){
this.$el.html(this.template(_.extend(this.model.toJSON(), plist, lattice.toJSON()))); this.$el.html(this.template(_.extend(this.model.toJSON(), plist, lattice.toJSON())));
......
...@@ -34,4 +34,10 @@ ...@@ -34,4 +34,10 @@
<% }); %> <% }); %>
</ul> </ul>
</li> </li>
<li><a class="" href="#">Keyboard Shortcuts</a></li> <li><a class="" href="#">Keyboard Shortcuts</a></li>
\ No newline at end of file <li class="dropdown-submenu">
<a tabindex="-1">Amanda's Stuff<span class="pull-right fui-arrow-right"></span></a>
<ul class="dropdown-menu">
<li><a class="customClick" id="videoRendering" href="#">Video Rendering Setup</a></li>
</ul>
</li>
\ No newline at end of file
...@@ -216,12 +216,26 @@ define(['three'], function(THREE){ ...@@ -216,12 +216,26 @@ define(['three'], function(THREE){
name: "Micro LEGO (low res)" name: "Micro LEGO (low res)"
} }
}, },
aspectRatio: new THREE.Vector3(1,1,5),//1.28 aspectRatio: new THREE.Vector3(1,1,1.28),
materialClasses: ['electronic'], materialClasses: ['electronic'],
options: { options: {
gikLength: 4 gikLength: 4
} }
}, },
lego: {
name: "LEGO",
parts: {
lego: {
name: "LEGO Bricks"
}
},
aspectRatio: new THREE.Vector3(1,1,1.17),
materialClasses: ['mechanical'],
options: {
scale: 8.2,
units: "mm"
}
},
dnaBricks: { dnaBricks: {
name: "DNA Bricks", name: "DNA Bricks",
parts: { parts: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment