Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify tool code #421

Merged
merged 9 commits into from
Sep 18, 2023
Merged

Simplify tool code #421

merged 9 commits into from
Sep 18, 2023

Conversation

floryst
Copy link
Collaborator

@floryst floryst commented Sep 15, 2023

  • Some code refactoring for easier usage
  • useFrameOfReference encapsulates the frame of reference handling
  • usePlacingAnnotationTool provides a more readable API for managing the placing tool
  • added finishedTools to all annotation tools
  • simplified the point visibility code to make it more obvious as to what it's doing
  • removed the movePoint state from the polygon store

@floryst floryst requested a review from PaulHax September 15, 2023 16:58
@netlify
Copy link

netlify bot commented Sep 15, 2023

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit 45be61a
🔍 Latest deploy log https://app.netlify.com/sites/volview-dev/deploys/6508b86ffb1b9f0007cf28b0
😎 Deploy Preview https://deploy-preview-421--volview-dev.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@floryst
Copy link
Collaborator Author

floryst commented Sep 15, 2023

I've decided against making one giant composable for the Tool and Widget components. I think it's an unnecessary abstraction to deal with for now if the only goal is code deduplication. Maybe we can revisit it once we've added more tools, as reducing the bundle size may become a driving reason. My primary goal is to ensure readability of the tool logic while keeping flexibility.

Copy link
Collaborator

@PaulHax PaulHax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good cleanup. Small bug then good by me.

src/components/tools/polygon/PolygonTool.vue Outdated Show resolved Hide resolved
src/components/tools/ruler/RulerWidget2D.vue Outdated Show resolved Hide resolved
src/composables/annotationTool.ts Show resolved Hide resolved
@PaulHax
Copy link
Collaborator

PaulHax commented Sep 15, 2023

Guess we should remove this too https://github.com/Kitware/VolView/blob/main/src/types/polygon.ts#L11

@floryst
Copy link
Collaborator Author

floryst commented Sep 15, 2023

Updated to address comments.

@floryst floryst merged commit 5ce0d5a into main Sep 18, 2023
7 checks passed
@floryst floryst deleted the simplify-tool-code branch September 18, 2023 20:59
@PaulHax PaulHax mentioned this pull request Sep 22, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants