Skip to content

Commit

Permalink
Merge pull request #49 from LinkunGao/pwa
Browse files Browse the repository at this point in the history
update 3d action
  • Loading branch information
LinkunGao authored Nov 22, 2024
2 parents 36c98c3 + 2afcfa9 commit e53d2e3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
34 changes: 19 additions & 15 deletions frontend/components/model/LeftModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,26 @@ export default {
}
},
onNavChange(modelName) {
if (this.navPanelName !== modelName) {
this.previoursCameras["left"][this.navPanelName] = {
"up": {
"x": this.scene.camera.up.x,
"y": this.scene.camera.up.y,
"z": this.scene.camera.up.z,
},
"position": {
"x": this.scene.camera.position.x,
"y": this.scene.camera.position.y,
"z": this.scene.camera.position.z,
}
};
}
this.navPanelName = modelName;
this.loadModel(this.modelUrlsArray[this.navPanelName][0], this.navPanelName+"left");
this.swicthDescription();
this.previoursCameras["left"][this.navPanelName] = {
"up": {
"x": this.scene.camera.up.x,
"y": this.scene.camera.up.y,
"z": this.scene.camera.up.z,
},
"position": {
"x": this.scene.camera.position.x,
"y": this.scene.camera.position.y,
"z": this.scene.camera.position.z,
}
};
},
start() {
Expand All @@ -151,8 +156,7 @@ export default {
this.scene = this.baseRenderer.getSceneByName(model_name);
if (this.scene === undefined) {
console.log("Creating new scene");
this.scene = this.baseRenderer.createScene(model_name);
this.scene.addLights();
this.scene.controls.rotateSpeed = 3.0;
Expand Down Expand Up @@ -196,7 +200,7 @@ export default {
this.previoursCameras["left"][this.navPanelName]["position"].y,
this.previoursCameras["left"][this.navPanelName]["position"].z
);
}, 200);
}, 300);
}
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/model/Model.vue
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,15 @@ export default {
this.previoursCameras["middle"][this.modelName]["position"].y,
this.previoursCameras["middle"][this.modelName]["position"].z
);
if(this.currentView === "2D Mammogram"){
}, 300);
if(this.currentView === "2D Mammogram"){
this.scene.controls.noRotate = true;
this.scene.controls.noPan = true;
this.removeContainerListener();
}else{
this.addContainerListener();
}
}, 200);
}
this.loadFirstTime = false;
this.scene.onWindowResize();
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/model/PanelControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ export default {
this.previoursCameras["right"][this.modelName]["position"].y,
this.previoursCameras["right"][this.modelName]["position"].z
);
this.addContainerListener();
}, 200);
}, 300);
this.addContainerListener();
}
this.scene.onWindowResize();
},
Expand Down

0 comments on commit e53d2e3

Please sign in to comment.