Commit be755fdd authored by legoc's avatar legoc
Browse files

Added sphere radius setting (not functional)

parent 9acaa763
......@@ -272,7 +272,7 @@ class TrajectoryController extends Controller {
}
updateTrajectorySettings(values) {
this._trajectory3D.scaleEnergy(values.energyScale);
this._trajectory3D.changeSettings(values);
}
updateTrajectoryData() {
......
......@@ -188,9 +188,9 @@ class TrajectoryView3D extends View3D {
this._energyViewGroup.applyMatrix(matrix4);
}
scaleEnergy(value) {
changeSettings(values) {
// Change the scale on the z direction to change the length of the energy lines.
this._energyScaleGroup.scale.z = value;
this._energyScaleGroup.scale.z = values.energyScale;
}
update3DLocal() {
......
......@@ -12,6 +12,11 @@ class TrajectorySettingsPanelView {
<input class='col-sm-4' type='text' name='energyScale' id='energyScale' />
<div class='col-sm-4'/>
</div>
<div class='row'>
<label class='col-sm-4' for='sphereRadius'>Sphere Radius</label>
<input class='col-sm-4' type='text' name='sphereRadius' id='sphereRadius' />
<div class='col-sm-4'/>
</div>
</div>`;
// Using lambda function does not work here.
......@@ -34,6 +39,17 @@ class TrajectorySettingsPanelView {
PubSub.publish('update-trajectory-settings', this.getInputs());
}
});
// Init sphere radius with 1.0.
$('#sphereRadius').val(1.0);
// When the view is initialised, we can access to the html elements.
$("#sphereRadius").keypress((event) => {
if (event.which == 13 || event.keyCode == 13) {
PubSub.publish('update-trajectory-settings', this.getInputs());
}
});
}
render() {
......@@ -44,7 +60,8 @@ class TrajectorySettingsPanelView {
*/
getInputs() {
return {
energyScale: parseFloat($("#energyScale").val())
energyScale: parseFloat($("#energyScale").val()),
sphereRadius: parseFloat($("#sphereRadius").val())
};
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment