Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
DMDesign
Commits
296ee53c
Commit
296ee53c
authored
Sep 15, 2015
by
Amanda Ghassaei
Browse files
delete material
parent
ab9187c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
js/cells/DMACell.js
View file @
296ee53c
...
...
@@ -158,7 +158,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', '
DMACell
.
prototype
.
setDeleteMode
=
function
(
state
){
var
material
;
if
(
!
state
&&
!
this
.
materialName
)
return
;
//cell may be deleted by now
if
(
state
)
material
=
materials
.
list
.
deleteMaterial
.
thre
eMaterial
;
if
(
state
)
material
=
materials
.
getDelet
eMaterial
()
;
else
material
=
this
.
getMaterial
(
true
);
if
(
!
material
)
return
;
//no material object found
if
(
this
.
object3D
.
children
[
0
].
material
==
material
)
return
;
...
...
js/materials/DMAMaterials.js
View file @
296ee53c
...
...
@@ -76,6 +76,10 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu
return
materialsList
[
id
];
}
function
getDeleteMaterial
(){
return
materialsList
.
deleteMaterial
.
threeMaterial
;
}
...
...
@@ -260,6 +264,7 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu
getChildCellTypes
:
getChildCellTypes
,
setToDefaultMaterial
:
setToDefaultMaterial
,
setEditingMaterial
:
setEditingMaterial
,
getEditingMaterial
:
getEditingMaterial
getEditingMaterial
:
getEditingMaterial
,
getDeleteMaterial
:
getDeleteMaterial
};
});
\ No newline at end of file
js/parts/DNAStraightPart.js
View file @
296ee53c
...
...
@@ -3,13 +3,12 @@
*/
define
([
'
underscore
'
,
'
stlLoader
'
,
'
gikPart
'
],
function
(
_
,
THREE
,
GIKPart
){
define
([
'
underscore
'
,
'
stlLoader
'
,
'
gikPart
'
,
'
materials
'
],
function
(
_
,
THREE
,
GIKPart
,
materials
){
var
zScale
=
1.08
/
8
;
var
unitGeo
=
new
THREE
.
BoxGeometry
(
0.2
,
0.2
,
zScale
);
var
bridgeGeo
=
new
THREE
.
BoxGeometry
(
0.3
,
0.4
,
zScale
);
console
.
log
(
bridgeGeo
);
bridgeGeo
.
vertices
[
4
].
y
=
0
;
bridgeGeo
.
vertices
[
5
].
y
=
0
;
bridgeGeo
.
vertices
[
2
].
y
=
-
0.1
;
...
...
@@ -65,6 +64,11 @@ define(['underscore', 'stlLoader', 'gikPart'], function(_, THREE, GIKPart){
return
GIKPart
.
prototype
.
getMaterial
.
call
(
this
,
returnTHREEObject
);
};
DNAStraightPart
.
prototype
.
setMaterial
=
function
(
material
){
if
(
material
!=
materials
.
getDeleteMaterial
())
material
=
this
.
getMaterial
(
true
);
this
.
mesh
.
material
=
material
;
};
DNAStraightPart
.
prototype
.
_translatePart
=
function
(
mesh
){
if
(
this
.
_isBridge
){
mesh
.
translateX
(
0.15
+
0.2
);
...
...
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