Commit 2ecbf2e3 authored by amandaghassaei's avatar amandaghassaei
Browse files

edge vis

parent d30fa6c6
......@@ -464,6 +464,24 @@
<input id="edgesVisible" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Edges Visible
</label>
<div id="edgeVisOptions" class="indent">
<label class="checkbox" for="mtnsVisible">
<input id="mtnsVisible" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Mountains
</label>
<label class="checkbox" for="valleysVisible">
<input id="valleysVisible" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Valleys
</label>
<label class="checkbox" for="panelsVisible">
<input id="panelsVisible" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Panel Creases
</label>
<label class="checkbox" for="passiveEdgesVisible">
<input id="passiveEdgesVisible" data-toggle="checkbox" class="custom-checkbox layersSelector" type="checkbox"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
Undriven Edges
</label>
</div>
</div><br/>
Rendering:
<div class="indent">
......
......@@ -232,6 +232,24 @@ function initControls(globals){
setCheckbox("#edgesVisible", globals.edgesVisible, function(val){
globals.edgesVisible = val;
if (globals.edgesVisible) $("#edgeVisOptions").show();
else $("#edgeVisOptions").hide();
globals.model.updateEdgeVisibility();
});
setCheckbox("#mtnsVisible", globals.mtnsVisible, function(val){
globals.mtnsVisible = val;
globals.model.updateEdgeVisibility();
});
setCheckbox("#valleysVisible", globals.valleysVisible, function(val){
globals.valleysVisible = val;
globals.model.updateEdgeVisibility();
});
setCheckbox("#panelsVisible", globals.panelsVisible, function(val){
globals.panelsVisible = val;
globals.model.updateEdgeVisibility();
});
setCheckbox("#passiveEdgesVisible", globals.passiveEdgesVisible, function(val){
globals.passiveEdgesVisible = val;
globals.model.updateEdgeVisibility();
});
......
......@@ -7,7 +7,6 @@ function Crease(edge, face1Index, face2Index, targetTheta, type, node1, node2, i
//face1 corresponds to node1, face2 to node2
this.edge = edge;
if (targetTheta>0) this.edge.highlight();
for (var i=0;i<edge.nodes.length;i++){
edge.nodes[i].addInvCrease(this);
}
......@@ -84,6 +83,15 @@ Crease.prototype.getNodeIndex = function(node){
return 0;
};
Crease.prototype.setVisibility = function(){
var vis = false;
if (this.type==0) vis = globals.panelsVisible;
else {
vis = (this.targetTheta>0 && globals.mtnsVisible) || (this.targetTheta<0 && globals.valleysVisible);
}
this.edge.setVisibility(vis);
};
Crease.prototype.destroy = function(){
this.node1.removeCrease(this);
this.node2.removeCrease(this);
......
......@@ -14,8 +14,12 @@ function initGlobals(){
color1: "ec008b",
color2: "dddddd",
edgesVisible: true,
mtnsVisible: true,
valleysVisible: true,
panelsVisible: true,
passiveEdgesVisible: true,
meshVisible: true,
ambientOcclusion: true,
ambientOcclusion: false,
//flags
fixedHasChanged: false,
......
......@@ -23,7 +23,14 @@ function initModel(globals){
function updateEdgeVisibility(){
for (var i=0;i<edges.length;i++){
edges[i].setVisibility(globals.edgesVisible);
edges[i].setVisibility(false);
}
if (!globals.edgesVisible) return;
for (var i=0;i<edges.length;i++){
edges[i].setVisibility(globals.passiveEdgesVisible);
}
for (var i=0;i<creases.length;i++){
creases[i].setVisibility();
}
}
......@@ -229,6 +236,10 @@ function initModel(globals){
return allNodeObject3Ds;
}
function updateEdgeVis(){
}
return {
pause: pause,
resume: resume,
......
Markdown is supported
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