Skip to content

Commit

Permalink
fix listener bugs in 2d and 3d
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkunGao committed Sep 30, 2024
1 parent d84e5c0 commit 11286a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
24 changes: 9 additions & 15 deletions frontend/components/model/Model.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ export default {
},
created: async function () {
this.$nuxt.$on("send-emitter-data", (data) => {
console.log(data);
});
// this.$nuxt.$on("send-emitter-data", (data) => {
// console.log(data);
// });
},
computed: {
Expand All @@ -90,20 +90,14 @@ export default {
this.modelData = this.$modelData();
this.container = this.$refs.baseDomObject;
this.modelName = this.$model().name;
this.$nuxt.$emit("onNavChange", this.modelName);
if(["cyst", "fibroadenoma", "calcifications", "fat_necrosis", "dcis", "lobular", "ductal"].includes(this.modelName)){
this.modelName = "normal";
}
// setTimeout(() => {
// this.mdAndUp
// ? (baseContainer.style.height = "100vh")
// : (baseContainer.style.height = "100vw");
// this.container.appendChild(baseContainer);
// this.start();
// }, 100);
this.$nuxt.$emit("onNavChange", this.modelName);
this.container.appendChild(this.baseContainer);
this.start();
this.start();
window.addEventListener("resize", () => {
setTimeout(() => {
Expand Down Expand Up @@ -219,7 +213,7 @@ export default {
},
removeContainerListener() {
if(this.mouseActions !== null){
this.container.addEventListener("mousemove", this.mouseActions.mouseMove);
this.container.removeEventListener("mousemove", this.mouseActions.mouseMove);
this.container.removeEventListener("mousedown", this.mouseActions.mouseDown);
this.container.removeEventListener("mouseup", this.mouseActions.mouseUp);
}
Expand Down
5 changes: 4 additions & 1 deletion frontend/components/model/PanelControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export default {
this.container.appendChild(this.baseContainer);
// Write code after mount this component
this.modelName = this.$model().name;
if(["cyst", "fibroadenoma", "calcifications", "fat_necrosis", "dcis", "lobular", "ductal"].includes(this.modelName)){
this.modelName = "normal";
}
this.start();
Expand All @@ -69,7 +72,7 @@ export default {
},
methods: {
async start() {
start() {
this.loadNrrd(this.modelUrlsArray[this.modelName][0], this.modelName+"right_mri");
},
Expand Down
1 change: 1 addition & 0 deletions frontend/plugins/copper.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const raycaster = (scene, container, nrrdSliceZ, nrrdMesh, nrrdMaxIndex) => {
}
const mouseMove = (event) => {
const a = scene.pickSpecifiedModel(nrrdMesh, {x: event.offsetX, y: event.offsetY});

if(!!a.intersectedObject){
if(!findMesh){
scene.controls.noRotate = true;
Expand Down

0 comments on commit 11286a6

Please sign in to comment.