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
36a34bc9
Commit
36a34bc9
authored
10 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
more cleaning up
parent
e47a7638
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
js/main.js
+5
-3
5 additions, 3 deletions
js/main.js
js/views/fillGeometryView.js
+33
-0
33 additions, 0 deletions
js/views/fillGeometryView.js
js/views/threeView.js
+0
-13
0 additions, 13 deletions
js/views/threeView.js
main.html
+1
-0
1 addition, 0 deletions
main.html
with
39 additions
and
16 deletions
js/main.js
+
5
−
3
View file @
36a34bc9
...
...
@@ -7,13 +7,15 @@ $(function(){
window
.
workers
=
persistentWorkers
(
8
);
//init threeJS view
var
threeModel
=
new
ThreeModel
();
var
three
=
new
ThreeView
({
model
:
threeModel
});
//singleton, my threejs view
var
three
=
new
ThreeView
({
model
:
threeModel
});
//
init
models and views
//
backbone
models and views
var
fillGeometry
=
new
FillGeometry
();
//singleton, mesh to fill with lattice
new
ImportView
({
model
:
fillGeometry
});
three
.
set
FillGeometry
(
fillGeometry
);
new
FillGeometry
View
({
model
:
fillGeometry
,
three
:
threeModel
}
);
lattice
=
new
Lattice
();
...
...
This diff is collapsed.
Click to expand it.
js/views/fillGeometryView.js
0 → 100644
+
33
−
0
View file @
36a34bc9
/**
* Created by aghassaei on 1/16/15.
*/
FillGeometryView
=
Backbone
.
View
.
extend
({
events
:
{
},
initialize
:
function
(
options
){
this
.
three
=
options
.
three
;
//bind events
this
.
listenTo
(
this
.
model
,
"
change:geometry
"
,
this
.
replaceFillGeometry
);
this
.
listenTo
(
this
.
model
,
"
change:orientation
"
,
this
.
render
);
this
.
replaceFillGeometry
();
},
replaceFillGeometry
:
function
(){
if
(
this
.
model
.
previous
(
"
mesh
"
))
this
.
three
.
sceneRemove
(
this
.
model
.
previous
(
"
mesh
"
));
this
.
three
.
sceneAdd
(
this
.
model
.
get
(
"
mesh
"
));
this
.
three
.
render
();
},
render
:
function
(){
this
.
three
.
render
();
}
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/views/threeView.js
+
0
−
13
View file @
36a34bc9
...
...
@@ -20,19 +20,6 @@ ThreeView = Backbone.View.extend({
this
.
animate
();
},
setFillGeometry
:
function
(
fillGeometry
){
//call this once
this
.
fillGeometry
=
fillGeometry
;
this
.
listenTo
(
fillGeometry
,
"
change:geometry
"
,
this
.
replaceFillGeometry
);
this
.
listenTo
(
fillGeometry
,
"
change:orientation
"
,
this
.
model
.
render
);
this
.
replaceFillGeometry
();
},
replaceFillGeometry
:
function
(){
if
(
this
.
fillGeometry
.
previous
(
"
mesh
"
))
this
.
model
.
sceneRemove
(
this
.
fillGeometry
.
previous
(
"
mesh
"
));
this
.
model
.
sceneAdd
(
this
.
fillGeometry
.
get
(
"
mesh
"
));
this
.
model
.
render
();
},
animate
:
function
(){
requestAnimationFrame
(
this
.
animate
);
this
.
controls
.
update
();
...
...
This diff is collapsed.
Click to expand it.
main.html
+
1
−
0
View file @
36a34bc9
...
...
@@ -47,6 +47,7 @@
<!--views-->
<script
src=
"js/views/threeView.js"
></script>
<script
src=
"js/views/importView.js"
></script>
<script
src=
"js/views/fillGeometryView.js"
></script>
<script
src=
"js/main.js"
></script>
...
...
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