Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
ccf0274e
Commit
ccf0274e
authored
9 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
preparing for a big refactor or cell classes
parent
ffafb8b5
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/cells/DMACell.js
+12
-2
12 additions, 2 deletions
js/cells/DMACell.js
js/cells/supercells/DMASuperCell.js
+2
-3
2 additions, 3 deletions
js/cells/supercells/DMASuperCell.js
js/models/AppState.js
+1
-1
1 addition, 1 deletion
js/models/AppState.js
with
15 additions
and
6 deletions
js/cells/DMACell.js
+
12
−
2
View file @
ccf0274e
...
...
@@ -12,7 +12,13 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState'],
function
DMACell
(
index
,
superCell
){
this
.
index
=
new
THREE
.
Vector3
(
index
.
x
,
index
.
y
,
index
.
z
);
if
(
superCell
)
this
.
superCell
=
superCell
;
if
(
superCell
)
{
this
.
superCell
=
superCell
;
}
else
if
(
!
this
.
cells
){
//lowest level child
this
.
material
=
lattice
.
get
(
"
materialType
"
);
}
//object 3d is parent to all 3d elements related to cell, parts, beams, nodes, etc
this
.
object3D
=
this
.
_buildObject3D
();
...
...
@@ -120,7 +126,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState'],
};
DMACell
.
prototype
.
getMaterial
=
function
(){
return
cell
Material
;
return
this
.
superCell
.
get
Material
()
;
};
DMACell
.
prototype
.
setOpacity
=
function
(
opacity
){
...
...
@@ -140,6 +146,9 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState'],
if
(
mode
===
undefined
)
mode
=
appState
.
get
(
"
cellMode
"
);
switch
(
mode
)
{
case
"
supercell
"
:
if
(
!
this
.
superCell
)
mode
=
"
cell
"
;
break
;
case
"
cell
"
:
break
;
case
"
part
"
:
...
...
@@ -216,6 +225,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState'],
};
DMACell
.
prototype
.
destroyParts
=
function
(){
if
(
!
this
.
parts
)
return
;
_
.
each
(
this
.
parts
,
function
(
part
){
if
(
part
)
part
.
destroy
();
});
...
...
This diff is collapsed.
Click to expand it.
js/cells/supercells/DMASuperCell.js
+
2
−
3
View file @
ccf0274e
...
...
@@ -9,7 +9,6 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'],
function
DMASuperCell
(
index
,
superCell
){
//supercells might have supercells
this
.
material
=
lattice
.
get
(
"
materialType
"
);
//todo move to dmacell
var
range
=
lattice
.
get
(
"
superCellRange
"
);
this
.
cells
=
this
.
_makeChildCells
(
index
,
range
);
//todo three dimensional array?
DMACell
.
call
(
this
,
index
,
superCell
);
...
...
@@ -51,8 +50,8 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cell'],
cell
.
setMode
(
mode
);
});
if
(
mode
==
"
cell
"
)
mode
=
"
supercell
"
;
if
(
mode
==
"
part
"
)
mode
=
"
object3D
"
;
if
(
mode
==
"
cell
"
||
mode
==
"
supercell
"
)
mode
=
"
supercell
"
;
else
mode
=
"
object3D
"
;
_
.
each
(
this
.
object3D
.
children
,
function
(
child
){
child
.
visible
=
child
.
name
==
mode
;
...
...
This diff is collapsed.
Click to expand it.
js/models/AppState.js
+
1
−
1
View file @
ccf0274e
...
...
@@ -33,7 +33,7 @@ define(['underscore', 'backbone'], function(_, Backbone){
deleteMode
:
false
,
highlightMode
:
true
,
extrudeMode
:
false
,
cellMode
:
"
cell
"
,
//s
how
cell
s vs
part
cellMode
:
"
cell
"
,
//s
upercell,
cell
,
part
, node, beam
cellsVisible
:
true
,
superCellIndex
:
0
,
//offset of superCell adds todo lattice?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment