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

more material types

parent 1a917810
Branches
No related tags found
No related merge requests found
...@@ -8,6 +8,10 @@ html, body { ...@@ -8,6 +8,10 @@ html, body {
height: 100%; height: 100%;
} }
.checkbox input[type="checkbox"].custom-checkbox:checked + .icons .icon-checked, .radio input[type="checkbox"].custom-checkbox:checked + .icons .icon-checked, .checkbox input[type="radio"].custom-radio:checked + .icons .icon-checked, .radio input[type="radio"].custom-radio:checked + .icons .icon-checked {
color: #888;
}
.navbar { .navbar {
margin-bottom:0; margin-bottom:0;
z-index: 2; z-index: 2;
...@@ -333,3 +337,24 @@ label { ...@@ -333,3 +337,24 @@ label {
text-overflow: ellipsis; text-overflow: ellipsis;
-o-text-overflow: ellipsis; -o-text-overflow: ellipsis;
} }
.materialColorSwatch{
height: 30px;
width: 100%;
}
.materialColorSwatch>div {
width: 30px;
height: 30px;
display: inline-block;
margin-right: 10px;
}
.materialColorSwatch>span{
display: inline-block;
vertical-align: middle;
padding-bottom: 20px;
}
label.colorSwatches>span.icons{
margin: 5px 0;
}
\ No newline at end of file
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
*/ */
var cellBrassMaterial = new THREE.MeshLambertMaterial({color:"#b5a642"});
var cellFiberGlassMaterial = new THREE.MeshLambertMaterial({color:"#fff68f"});
GIKSuperCell = function(length, range, cells){ GIKSuperCell = function(length, range, cells){
if (range) this.indices = _.clone(range.max); if (range) this.indices = _.clone(range.max);
this.material = globals.lattice.get("materialType"); this.material = globals.lattice.get("materialType");
...@@ -60,9 +57,8 @@ GIKSuperCell.prototype._buildWireframe = function(mesh){ ...@@ -60,9 +57,8 @@ GIKSuperCell.prototype._buildWireframe = function(mesh){
}; };
GIKSuperCell.prototype.getMaterial = function(){ GIKSuperCell.prototype.getMaterial = function(){
var material = cellBrassMaterial; var material = globals.plist.allMaterialTypes[globals.lattice.get("cellType")][globals.lattice.get("connectionType")][globals.lattice.get("materialType")];
if (this.material == "fiberGlass") material = cellFiberGlassMaterial; return new THREE.MeshLambertMaterial({color:material.color});
return material;
}; };
GIKSuperCell.prototype.setMode = function(mode){ GIKSuperCell.prototype.setMode = function(mode){
......
...@@ -41,26 +41,19 @@ PartMenuView = Backbone.View.extend({ ...@@ -41,26 +41,19 @@ PartMenuView = Backbone.View.extend({
<br/><br/>--><br/>\ <br/><br/>--><br/>\
<% if (allMaterialTypes[cellType][connectionType]){ %> \ <% if (allMaterialTypes[cellType][connectionType]){ %> \
Materials:<br/>\ Materials:<br/>\
<label class="checkbox" for="realisticColorScheme">\
<input id="realisticColorScheme" data-property="realisticColorScheme" type="checkbox" <% if (realisticColorScheme){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="appState custom-checkbox">\
<span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\
Use realistic color scheme</label><br/>\
\
<% _.each(_.keys(allMaterialTypes[cellType][connectionType]), function(key){ %>\ <% _.each(_.keys(allMaterialTypes[cellType][connectionType]), function(key){ %>\
<label class="radio">\ <label class="radio colorSwatches">\
<input type="radio" <%if (key == materialType){ %>checked<%}%> name="materialType" value="<%= key %>" data-toggle="radio" class="custom-radio lattice"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\ <input type="radio" <%if (key == materialType){ %>checked<%}%> name="materialType" value="<%= key %>" data-toggle="radio" class="custom-radio lattice"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\
<%= allMaterialTypes[cellType][connectionType][key].name %>\ <div class="materialColorSwatch">\
<div style="background-color:<%= allMaterialTypes[cellType][connectionType][key].color %>"></div>\
<span><%= allMaterialTypes[cellType][connectionType][key].name %></span></div>\
</label>\ </label>\
<% }); %>\ <% }); %>\
<br/><br/>\ <br/>\
<div class="btn-group">\ <label class="checkbox" for="realisticColorScheme">\
<button data-toggle="dropdown" class="btn dropdown-toggle" type="button"><%= allMaterialTypes[cellType][connectionType][materialType].name %><span class="caret"></span></button>\ <input id="realisticColorScheme" data-property="realisticColorScheme" type="checkbox" <% if (realisticColorScheme){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="appState custom-checkbox">\
<ul role="menu" class="dropdown-menu">\ <span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>\
<% _.each(_.keys(allMaterialTypes[cellType][connectionType]), function(key){ %>\ Use realistic color scheme</label>\
<li><a class="materialType" data-type="<%= key %>" href="#"><%= allMaterialTypes[cellType][connectionType][key].name %></a></li>\
<% }); %>\
</ul>\
</div><br/><br/>\
<% } %>\ <% } %>\
<br/>\ <br/>\
') ')
......
...@@ -91,11 +91,23 @@ function AppPList(){ ...@@ -91,11 +91,23 @@ function AppPList(){
gik: { gik: {
brass:{ brass:{
name: "Brass", name: "Brass",
color: "#b5a642" color: "#b5a642",
altColor: "#e67e22"
}, },
fiberGlass: { fiberGlass: {
name: "Fiberglass", name: "Fiberglass",
color: "#fef1b5" color: "#fef1b5",
altColor: "#ecf0f1"
},
carbonFiber: {
name: "Carbon Fiber",
color: "#222",
altColor: "#000"
},
silicon: {
name: "Silicon",
color: "#bcc6cc",
altColor: "#34495e"
} }
} }
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment