Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
2ecbf2e3
Commit
2ecbf2e3
authored
May 02, 2017
by
amandaghassaei
Browse files
edge vis
parent
d30fa6c6
Changes
5
Show whitespace changes
Inline
Side-by-side
index.html
View file @
2ecbf2e3
...
...
@@ -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"
>
...
...
js/controls.js
View file @
2ecbf2e3
...
...
@@ -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
();
});
...
...
js/crease.js
View file @
2ecbf2e3
...
...
@@ -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
);
...
...
js/globals.js
View file @
2ecbf2e3
...
...
@@ -14,8 +14,12 @@ function initGlobals(){
color1
:
"
ec008b
"
,
color2
:
"
dddddd
"
,
edgesVisible
:
true
,
mtnsVisible
:
true
,
valleysVisible
:
true
,
panelsVisible
:
true
,
passiveEdgesVisible
:
true
,
meshVisible
:
true
,
ambientOcclusion
:
tru
e
,
ambientOcclusion
:
fals
e
,
//flags
fixedHasChanged
:
false
,
...
...
js/model.js
View file @
2ecbf2e3
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment