Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AMOEBA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
AMOEBA
Commits
3c6c6862
Commit
3c6c6862
authored
Jun 20, 2016
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
materials visibility and stl export
parent
86af735f
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
83 additions
and
93 deletions
+83
-93
css/main.css
css/main.css
+14
-0
js/cells/DMACell.js
js/cells/DMACell.js
+5
-0
js/lattice/Lattice.js
js/lattice/Lattice.js
+4
-0
js/lattice/LatticeBase.js
js/lattice/LatticeBase.js
+7
-0
js/main.js
js/main.js
+1
-2
js/materials/DMAMaterial.js
js/materials/DMAMaterial.js
+18
-2
js/menus/SketchMenuView.js
js/menus/SketchMenuView.js
+4
-3
js/menus/contextMenu/ContextMenu.js
js/menus/contextMenu/ContextMenu.js
+0
-78
js/menus/contextMenu/MaterialsContextMenu.html
js/menus/contextMenu/MaterialsContextMenu.html
+0
-4
js/menus/templates/NavViewMenu.html
js/menus/templates/NavViewMenu.html
+1
-1
js/menus/templates/SketchMenuView.html
js/menus/templates/SketchMenuView.html
+29
-3
No files found.
css/main.css
View file @
3c6c6862
...
...
@@ -668,4 +668,18 @@ label {
#comingSoon
,
#genericModal
{
top
:
20%
;
}
.materialVisibility
{
display
:
block
;
position
:
relative
;
margin-bottom
:
12px
;
font-size
:
14px
;
line-height
:
1.5
;
min-height
:
20px
;
margin-top
:
10px
;
}
.leftOffset
{
left
:
30px
!important
;
}
\ No newline at end of file
js/cells/DMACell.js
View file @
3c6c6862
...
...
@@ -244,6 +244,10 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
DMACell
.
prototype
.
_setTransparent
=
function
(
transparent
){
if
(
transparent
==
this
.
isTransparent
)
return
;
this
.
isTransparent
=
transparent
;
this
.
refreshMaterial
();
};
DMACell
.
prototype
.
refreshMaterial
=
function
(){
this
.
_setTHREEMaterial
(
this
.
getMaterial
(
true
));
this
.
setWireframeVisibility
(
!
this
.
isTransparent
);
if
(
this
.
parts
)
{
...
...
@@ -270,6 +274,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
DMACell
.
prototype
.
getVisibleGeometry
=
function
(){
//for save stl
var
geometry
=
[];
if
(
this
.
isTransparent
)
return
geometry
;
if
(
this
.
getMaterial
().
isTransparent
())
return
geometry
;
if
(
!
this
.
object3D
.
visible
)
return
geometry
;
var
mesh
=
this
.
getVisibleMesh
();
if
(
mesh
.
visible
)
geometry
.
push
({
geo
:
mesh
.
geometry
,
offset
:
this
.
getPosition
(),
orientation
:
mesh
.
quaternion
.
clone
().
multiply
(
this
.
getOrientation
())});
...
...
js/lattice/Lattice.js
View file @
3c6c6862
...
...
@@ -334,6 +334,10 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'materialsPlis
return
cellsMax
.
clone
().
sub
(
cellsMin
).
divideScalar
(
2
).
add
(
cellsMin
);
},
_navChanged
:
function
(){
this
.
refreshCellsMaterial
();
},
...
...
js/lattice/LatticeBase.js
View file @
3c6c6862
...
...
@@ -440,6 +440,13 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
three
.
render
();
},
refreshCellsMaterial
:
function
(){
this
.
_loopCells
(
this
.
cells
,
function
(
cell
){
cell
.
refreshMaterial
();
});
three
.
render
();
},
setOpaque
:
function
(){
this
.
_loopCells
(
this
.
cells
,
function
(
cell
){
cell
.
setTransparent
(
false
);
...
...
js/main.js
View file @
3c6c6862
...
...
@@ -84,7 +84,6 @@ require.config({
ribbon
:
'
menus/otherUI/Ribbon
'
,
modalView
:
'
menus/otherUI/ModalView
'
,
console
:
'
menus/otherUI/Console
'
,
contextMenu
:
'
menus/contextMenu/ContextMenu
'
,
scriptView
:
'
menus/otherUI/ScriptView
'
,
menuWrapper
:
'
menus/MenuWrapperView
'
,
menuParent
:
'
menus/MenuParentView
'
,
...
...
@@ -166,7 +165,7 @@ require.config({
//init stuff
require
([
'
appState
'
,
'
lattice
'
,
'
navbar
'
,
'
threeModel
'
,
'
threeView
'
,
'
globals
'
,
'
flatUI
'
,
'
bootstrapSlider
'
,
'
ribbon
'
,
'
menuWrapper
'
,
'
scriptView
'
,
'
con
textMenu
'
,
'
con
sole
'
],
'
flatUI
'
,
'
bootstrapSlider
'
,
'
ribbon
'
,
'
menuWrapper
'
,
'
scriptView
'
,
'
console
'
],
function
(
appState
,
lattice
,
Navbar
,
three
,
ThreeView
,
globals
){
new
Navbar
({
model
:
appState
});
...
...
js/materials/DMAMaterial.js
View file @
3c6c6862
...
...
@@ -296,7 +296,9 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
color
:
randomColor
,
altColor
:
randomColor
,
noDelete
:
false
,
properties
:{}
properties
:{},
hidden
:
false
,
//global material visibility setting
transparent
:
false
//global material visibility setting
};
json
=
_
.
extend
(
defaults
,
json
);
this
.
set
(
json
,
true
);
...
...
@@ -442,6 +444,7 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
console
.
warn
(
"
no three material found for material
"
+
this
.
getID
());
return
null
;
}
if
(
this
.
isTransparent
())
return
this
.
getTransparentMaterial
();
return
this
.
threeMaterial
;
};
...
...
@@ -489,6 +492,17 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
return
!
this
.
noDelete
;
};
DMAMaterial
.
prototype
.
setTransparent
=
function
(
state
){
this
.
transparent
=
state
;
require
([
'
lattice
'
],
function
(
lattice
){
lattice
.
refreshCellsMaterial
();
});
};
DMAMaterial
.
prototype
.
isTransparent
=
function
(){
return
this
.
transparent
&&
appState
.
get
(
"
currentNav
"
)
==
"
navDesign
"
;
};
DMAMaterial
.
prototype
.
toJSON
=
function
(){
return
{
name
:
this
.
name
,
...
...
@@ -498,7 +512,9 @@ define(['underscore', 'appState', 'three'], function(_, appState, THREE){
noDelete
:
this
.
noDelete
,
properties
:
this
.
getProperties
(),
texture
:
this
.
texture
,
mesh
:
this
.
mesh
mesh
:
this
.
mesh
,
hidden
:
this
.
hidden
,
transparent
:
this
.
transparent
}
};
...
...
js/menus/SketchMenuView.js
View file @
3c6c6862
...
...
@@ -2,8 +2,8 @@
* Created by aghassaei on 1/26/15.
*/
define
([
'
jquery
'
,
'
underscore
'
,
'
menuParent
'
,
'
plist
'
,
'
text!menus/templates/SketchMenuView.html
'
,
'
globals
'
],
function
(
$
,
_
,
MenuParentView
,
plist
,
template
,
globals
){
define
([
'
jquery
'
,
'
underscore
'
,
'
menuParent
'
,
'
plist
'
,
'
text!menus/templates/SketchMenuView.html
'
,
'
globals
'
,
'
materialsPlist
'
,
"
materials
"
],
function
(
$
,
_
,
MenuParentView
,
plist
,
template
,
globals
,
materialsPlist
,
materials
){
return
MenuParentView
.
extend
({
...
...
@@ -17,11 +17,12 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'text!menus/templates/Ske
getPropertyOwner
:
function
(
$target
){
if
(
$target
.
hasClass
(
'
baseplane
'
))
return
globals
.
get
(
"
baseplane
"
);
if
(
$target
.
hasClass
(
'
material
'
))
return
materials
.
getMaterialForId
(
$target
.
data
(
"
id
"
));
return
null
;
},
_makeTemplateJSON
:
function
(){
return
_
.
extend
(
this
.
model
.
toJSON
(),
plist
,
globals
.
get
(
"
baseplane
"
).
toJSON
());
return
_
.
extend
(
this
.
model
.
toJSON
(),
plist
,
globals
.
get
(
"
baseplane
"
).
toJSON
()
,
materials
.
toJSON
(),
materialsPlist
);
},
_render
:
function
(){
...
...
js/menus/contextMenu/ContextMenu.js
deleted
100644 → 0
View file @
86af735f
/**
* Created by aghassaei on 10/23/15.
*/
define
([
'
jquery
'
,
'
underscore
'
,
'
backbone
'
,
'
text!menus/contextMenu/MaterialsContextMenu.html
'
],
function
(
$
,
_
,
Backbone
,
template
){
if
(
document
.
addEventListener
)
{
document
.
addEventListener
(
'
contextmenu
'
,
function
(
e
)
{
var
type
=
getContextMenuType
(
e
);
if
(
type
)
{
e
.
preventDefault
();
handleContextMenuEvent
(
e
,
type
);
}
},
false
);
}
else
{
document
.
attachEvent
(
'
oncontextmenu
'
,
function
()
{
var
type
=
getContextMenuType
(
window
.
event
);
if
(
type
)
{
window
.
event
.
returnValue
=
false
;
handleContextMenuEvent
(
e
,
type
);
}
});
}
var
$wrapper
=
$
(
"
#contextMenuWrapper
"
);
var
ContextMenu
=
Backbone
.
View
.
extend
({
el
:
'
#contextMenu
'
,
object
:
null
,
initialize
:
function
(){
},
renderMaterialsMenu
:
function
(
e
){
this
.
object
=
$
(
e
.
target
).
parents
(
"
label.colorSwatches
"
).
children
(
"
input
"
).
val
();
var
templateJSON
=
{};
this
.
$el
.
html
(
_
.
template
(
template
)(
templateJSON
));
this
.
showMenu
(
e
);
},
showMenu
:
function
(
e
){
var
padding
=
parseInt
(
$wrapper
.
css
(
"
padding
"
));
var
left
=
e
.
pageX
-
padding
;
if
(
$
(
'
body
'
).
width
()
-
200
<
left
)
left
-=
200
;
$wrapper
.
css
({
left
:
left
,
top
:
e
.
pageY
-
padding
});
$wrapper
.
show
();
},
hideMenu
:
function
(){
$wrapper
.
hide
();
}
});
var
contextMenu
=
new
ContextMenu
();
$wrapper
.
mouseleave
(
function
(){
contextMenu
.
hideMenu
();
});
function
getContextMenuType
(
e
){
var
$target
=
$
(
e
.
target
);
var
elem
=
$target
.
get
(
0
);
if
(
$target
.
parents
(
"
label.colorSwatches
"
).
length
==
1
){
return
"
materials
"
;
}
return
null
;
}
function
handleContextMenuEvent
(
e
,
type
){
if
(
type
==
"
materials
"
)
contextMenu
.
renderMaterialsMenu
(
e
);
}
});
\ No newline at end of file
js/menus/contextMenu/MaterialsContextMenu.html
deleted
100644 → 0
View file @
86af735f
<ul>
<li>
Set Transparent
</li>
<li>
Hide
</li>
</ul>
js/menus/templates/NavViewMenu.html
View file @
3c6c6862
...
...
@@ -10,7 +10,7 @@
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
>
3D UI
<span
class=
"pull-right fui-arrow-right"
></span></a>
<ul
class=
"dropdown-menu"
>
<li><a
class=
"appState boolProperty"
data-property=
"basePlaneIsVisible"
href=
"#"
>
S
ketch
Plane
</a></li>
<li><a
class=
"appState boolProperty"
data-property=
"basePlaneIsVisible"
href=
"#"
>
S
election
Plane
</a></li>
<li><a
class=
"appState boolProperty<% if (currentNav != "
navDesign
"){
%
>
disabled
<
%
}
%
>
" data-property="highlighterIsVisible" href="#">Hover Tool
</a></li>
<li><a
class=
"appState boolProperty"
data-property=
"axesAreVisible"
href=
"#"
>
Axes
</a></li>
<li><a
class=
"appState boolProperty"
data-property=
"focusOnLattice"
href=
"#"
>
Center on Lattice
</a></li>
...
...
js/menus/templates/SketchMenuView.html
View file @
3c6c6862
Orientation:
<div
class=
"btn-group"
>
Selection Plane
Orientation:
<div
class=
"btn-group"
>
<button
data-toggle=
"dropdown"
class=
"btn dropdown-toggle"
type=
"button"
><
%=
allBaseplaneTypes
[
planeType
]
%
><span
class=
"caret"
></span></button>
<ul
role=
"menu"
class=
"dropdown-menu"
>
<
%
_.each
(
allBaseplaneTypes
,
function
(
val
,
key
){
%
>
...
...
@@ -6,7 +6,7 @@ Orientation: <div class="btn-group">
<
%
});
%
>
</ul>
</div><br/><br/>
S
ketch
Plane Height:
<input
data-property=
"zIndex"
value=
"<%= zIndex %>"
placeholder=
"us"
class=
"form-control intInput baseplane"
type=
"text"
><br/>
S
election
Plane Height:
<input
data-property=
"zIndex"
value=
"<%= zIndex %>"
placeholder=
"us"
class=
"form-control intInput baseplane"
type=
"text"
><br/>
<label
class=
"checkbox"
for=
"showOneLayer"
>
<input
id=
"showOneLayer"
data-property=
"showOneLayer"
type=
"checkbox"
<%
if
(
showOneLayer
){
%
>
checked="checked"
<
%
}
%
>
value="" data-toggle="checkbox" class="appState custom-checkbox">
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
...
...
@@ -15,5 +15,31 @@ Sketch Plane Height: <input data-property="zIndex" value="<%= zIndex
<input
id=
"orientationFlipped"
data-property=
"orientationFlipped"
type=
"checkbox"
<%
if
(
orientationFlipped
){
%
>
checked="checked"
<
%
}
%
>
value="" data-toggle="checkbox" class="baseplane custom-checkbox">
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
Flip orientation
</label>
<br/>
Material Visibility:
<
%
_.each
(
_.keys
(
allMaterials
[
materialClass
]),
function
(
key
){
%
>
<
%
var
material =
materials[key];%
>
<label
class=
"checkbox colorSwatches materialVisibility"
>
<input
data-id=
"<%= key %>"
data-property=
"transparent"
type=
"checkbox"
<%
if
(!
material.transparent
){
%
>
checked="checked"
<
%
}
%
>
value="" data-toggle="checkbox" class="material custom-checkbox">
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
<!--<input data-property="<%= key %>" type="checkbox" <% if (material.hidden){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="leftOffset custom-checkbox">-->
<!--<span class="leftOffset icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>-->
<div
class=
"materialColorSwatch"
>
<div
style=
"background-color:<% if(realisticColorScheme){ %><%= material.color %><% }else{ %><%= material.altColor %><% } %>"
>
<
%
if
(
material.texture
)
{%
><img
src=
"assets/textures/<%= material.texture %>Thumb.png"
><
%
}
%
>
</div>
<span><span
class=
"materialListTitle"
><
%=
material.name
%
></span></span></div>
</label>
<
%
});
%
>
<
%
_.each
(
materials
,
function
(
material
,
key
){
%
>
<
%
if
(
material.noDelete
)
return
;
%
>
<label
class=
"checkbox colorSwatches materialVisibility"
>
<input
data-id=
"<%= key %>"
data-property=
"transparent"
type=
"checkbox"
<%
if
(!
material.transparent
){
%
>
checked="checked"
<
%
}
%
>
value="" data-toggle="checkbox" class="material custom-checkbox">
<span
class=
"icons"
><span
class=
"icon-unchecked"
></span><span
class=
"icon-checked"
></span></span>
<!--<input data-property="<%= key %>" type="checkbox" <% if (material.hidden){ %> checked="checked"<% } %> value="" data-toggle="checkbox" class="leftOffset custom-checkbox">-->
<!--<span class="leftOffset icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>-->
<div
class=
"materialColorSwatch"
>
<div
style=
"background-color:<% if(realisticColorScheme){ %><%= material.color %><% }else{ %><%= material.altColor %><% } %>"
></div>
<span><span><
%=
material.name
%
></span></span></div>
</label>
<
%
});
%
>
\ No newline at end of file
Write
Preview
Markdown
is supported
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