Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
vEXP
Commits
e7c56ebd
Commit
e7c56ebd
authored
May 11, 2020
by
legoc
Browse files
Prepare new scale for trajectories
parent
be755fdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/client/utils/shapes/trajectory-line.js
View file @
e7c56ebd
...
...
@@ -19,6 +19,7 @@ class TrajectoryLine {
this
.
_type
=
type
;
this
.
_center
=
center
.
clone
();
this
.
_data
=
[];
this
.
_scale
=
1.0
;
this
.
_deltaSphereGroup
=
new
THREE
.
Group
();
...
...
@@ -73,6 +74,10 @@ class TrajectoryLine {
}
}
get
type
()
{
return
this
.
_type
;
}
set
type
(
value
)
{
this
.
_type
=
value
;
...
...
@@ -179,6 +184,10 @@ class TrajectoryLine {
this
.
updateDataGroup
();
}
scale
(
value
)
{
this
.
_scale
=
value
;
}
calculateSegmentMatrix
(
start
,
end
)
{
let
d
=
end
.
clone
().
sub
(
start
).
normalize
();
...
...
js/client/views/3D/trajectory-view.js
View file @
e7c56ebd
...
...
@@ -202,6 +202,20 @@ class TrajectoryView3D extends View3D {
let
dE
=
this
.
calculateDE
();
this
.
_energyTranslationGroup
.
translateZ
(
-
scalarWorldToView
(
dE
));
}
scaleEnergy
(
value
)
{
// Iterate on the trajectory lines.
for
(
let
id
in
this
.
_trajectoryLines
)
{
let
hklLine
=
this
.
_trajectoryLines
[
id
].
hkl
;
// Scale only lines that are ki or kf.
if
(
hklLine
.
type
===
'
ki
'
||
hklLine
.
type
===
'
kf
'
)
{
let
energyLine
=
this
.
_trajectoryLines
[
id
].
energy
;
energyLine
.
scale
(
value
);
}
}
}
changeDisplayMode
()
{
if
(
displayMode
.
view
==
Constants
.
DisplayMode
.
SPE
)
{
...
...
@@ -323,7 +337,7 @@ class TrajectoryView3D extends View3D {
* Clear all trajectories from the view.
*/
clearTrajectories
()
{
for
(
let
id
in
this
.
_trajectoryLines
)
{
for
(
let
id
in
this
.
_trajectoryLines
)
{
this
.
deleteTrajectory
(
id
);
}
}
...
...
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