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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
bc65cf0d
Commit
bc65cf0d
authored
Jun 12, 2015
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
bounding box calc
parent
32e9705c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/lattice/LatticeBase.js
+2
-8
2 additions, 8 deletions
js/lattice/LatticeBase.js
js/menus/CompositeMenu.js
+28
-11
28 additions, 11 deletions
js/menus/CompositeMenu.js
js/menus/MenuParentView.js
+1
-1
1 addition, 1 deletion
js/menus/MenuParentView.js
with
31 additions
and
20 deletions
js/lattice/LatticeBase.js
+
2
−
8
View file @
bc65cf0d
...
...
@@ -182,14 +182,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
},
calculateBoundingBox
:
function
(){
var
scale
=
this
.
_allAxesScales
();
var
min
=
_
.
clone
(
this
.
get
(
"
cellsMin
"
));
var
max
=
_
.
clone
(
this
.
get
(
"
cellsMax
"
));
_
.
each
(
_
.
keys
(
scale
),
function
(
key
){
min
[
key
]
*=
scale
[
key
];
max
[
key
]
*=
scale
[
key
];
});
return
{
min
:
min
,
max
:
max
};
if
(
!
this
.
get
(
"
cellsMax
"
)
||
!
this
.
get
(
"
cellsMin
"
))
return
new
THREE
.
Vector3
(
0
,
0
,
0
);
return
(
new
THREE
.
Vector3
()).
subVectors
(
this
.
get
(
"
cellsMax
"
),
this
.
get
(
"
cellsMin
"
)).
add
(
new
THREE
.
Vector3
(
1
,
1
,
1
));
},
...
...
This diff is collapsed.
Click to expand it.
js/menus/CompositeMenu.js
+
28
−
11
View file @
bc65cf0d
...
...
@@ -2,7 +2,7 @@
* Created by aghassaei on 6/10/15.
*/
define
([
'
jquery
'
,
'
underscore
'
,
'
menuParent
'
,
'
plist
'
,
'
lattice
'
],
function
(
$
,
_
,
MenuParentView
,
plist
,
lattice
){
define
([
'
jquery
'
,
'
underscore
'
,
'
menuParent
'
,
'
plist
'
,
'
lattice
'
,
'
globals
'
],
function
(
$
,
_
,
MenuParentView
,
plist
,
lattice
,
globals
){
return
MenuParentView
.
extend
({
...
...
@@ -23,12 +23,6 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
this
.
listenTo
(
lattice
.
compositeEditor
,
"
change
"
,
this
.
render
);
},
_updateDimensions
:
function
(
cells
){
this
.
material
.
dimensions
.
x
=
cells
.
length
;
this
.
material
.
dimensions
.
y
=
cells
[
0
].
length
;
this
.
material
.
dimensions
.
z
=
cells
[
0
][
0
].
length
;
},
_changeRandomColor
:
function
(
e
){
e
.
preventDefault
();
lattice
.
compositeEditor
.
_changeRandomColor
();
...
...
@@ -76,7 +70,12 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
},
_makeTemplateJSON
:
function
(){
return
_
.
extend
(
lattice
.
compositeEditor
.
toJSON
());
return
_
.
extend
(
plist
,
this
.
model
.
toJSON
(),
globals
,
lattice
.
compositeEditor
.
toJSON
(),
{
materialClass
:
lattice
.
get
(
"
materialClass
"
),
materialType
:
lattice
.
get
(
"
materialType
"
),
dimensions
:
lattice
.
compositeEditor
.
calculateBoundingBox
()
});
},
template
:
_
.
template
(
'
\
...
...
@@ -84,10 +83,28 @@ define(['jquery', 'underscore', 'menuParent', 'plist', 'lattice'], function($, _
<a id="saveComposite" href="#" class="btn btn-halfWidth btn-lg pull-right btn-default">Save Composite</a><br/><br/>
\
Name: <input id="compositeName" data-property="name" value="<%= name %>" placeholder="Enter Name" class="seventyFiveWidth form-control textInput compositeEditor" type="text"><br/><br/>
\
Num Cells: <%= numCells %><br/><br/>
\
Bounding Box:
()
<br/><br/>
\
Bounding Box:
<%= dimensions.x %> x <%= dimensions.y %> x <%= dimensions.z %>
<br/><br/>
\
Display Color:
\
<input id="compositeColor" style="border-color: <%= color %> ;" data-property="color" value="<%= color %>" placeholder="Enter HEX" class="halfWidth compositeEditor form-control hexInput" type="text"><br/><br/>
\
<a id="newRandomColor" href="#" class="btn btn-block btn-lg btn-default">New Random Color</a><br/><br/>
\
<a id="newRandomColor" href="#" class="btn btn-block btn-lg btn-default">New Random Color</a><br/>
\
Available Materials:<br/>
\
<% _.each(_.keys(allMaterials[materialClass]), function(key){ %>
\
<label class="radio colorSwatches">
\
<input type="radio" <%if (key == materialType){ %>checked<%}%> name="materialType" value="<%= key %>" data-toggle="radio" class="custom-radio lattice"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
\
<div class="materialColorSwatch">
\
<div style="background-color:<% if(realisticColorScheme){ %><%= allMaterials[materialClass][key].color %><% }else{ %><%= allMaterials[materialClass][key].altColor %><% } %>"></div>
\
<span><%= allMaterials[materialClass][key].name %></span></div>
\
</label>
\
<% }); %>
\
<% _.each(_.keys(materials.compositeMaterials), function(key){
\
if (key == id) return; %>
\
<label class="radio colorSwatches">
\
<input type="radio" <%if (key == materialType){ %>checked<%}%> name="materialType" value="<%= key %>" data-toggle="radio" class="custom-radio lattice"><span class="icons"><span class="icon-unchecked"></span><span class="icon-checked"></span></span>
\
<div class="materialColorSwatch">
\
<div style="background-color:<% if(realisticColorScheme){ %><%= materials.compositeMaterials[key].color %><% }else{ %><%= materials.compositeMaterials[key].altColor %><% } %>"></div>
\
<span><%= materials.compositeMaterials[key].name %></span></div>
\
</label>
\
<% }); %><br/>
\
<a id="finishComposite" href="#" class="btn btn-block btn-lg btn-success">Finish Composite</a><br/>
\
<a id="cancelComposite" href="#" class="btn btn-halfWidth btn-lg btn-default">Cancel / Exit</a>
\
<a id="deleteComposite" href="#" class="btn btn-halfWidth pull-right btn-lg btn-default"><span class="fui-trash"></span> Delete</a><br/>
\
...
...
This diff is collapsed.
Click to expand it.
js/menus/MenuParentView.js
+
1
−
1
View file @
bc65cf0d
...
...
@@ -19,7 +19,7 @@ define(['jquery', 'underscore', 'backbone'], function($, _, Backbone){
render
:
function
(){
if
(
this
.
model
.
changedAttributes
()[
"
currentNav
"
])
return
;
if
(
$
(
"
input[type=text]
"
).
is
(
"
:focus
"
))
return
;
this
.
$el
.
html
(
this
.
template
(
this
.
_makeTemplateJSON
())
);
if
(
this
.
_preRender
)
this
.
_preRender
(
);
this
.
$el
.
html
(
this
.
template
(
this
.
_makeTemplateJSON
()));
if
(
this
.
_render
)
this
.
_render
();
},
...
...
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