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

Annotation - polygon tool #41

Open
jacksonjacobs1 opened this issue Nov 8, 2024 · 0 comments
Open

Annotation - polygon tool #41

jacksonjacobs1 opened this issue Nov 8, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request v2.0 Pertains to the v2.0 branch

Comments

@jacksonjacobs1
Copy link
Collaborator

Annotation - Polygon Tool

Description

Implement a new polygon annotation tool to allow users to create, edit, and manage polygon shapes with undo/redo functionalities.

Feature Details

The feature will use an object called CurrentAnnotation to store the current annotation’s state information, supporting undo/redo operations and interactions with other tools.

CurrentAnnotation Fields

  • data: reference to a data element in the ground truth layer
  • undoStack: Stack to track previous states for undo actions.
  • redoStack: Stack to track reverted states for redo actions.

State Change Conditions

CurrentAnnotation will reset on deselection, delete, and multi-selection events. Undo and redo actions will respectively pop the latest item from undoStack or redoStack and update CurrentAnnotation.

Tool Behaviors

On mousedown

  • Identify the relevant polygon and check if it matches the CurrentAnnotation.
  • If creating a new polygon, initialize CurrentAnnotation with default values.

On mousemove

  • Polygon Tool: Draw a polyline that updates as the mouse moves.

On mouseup

  • Save the currentState in undoStack and update the drawing based on the tool used.
  • Commit the updated data to the backend.

Implementation Notes

  • Library: Use polygon-clipping for handling complex shape operations.
  • Redraw and State Management: Ensure the UI reflects the CurrentAnnotation updates accurately.

Acceptance Criteria

  1. Users can create, edit, and delete polygon annotations.
  2. Undo/Redo actions work consistently.
  3. Mouse interactions update polygon annotations as described.
  4. Brush and erase tools work without self-intersections in the final shape.

References:

@jacksonjacobs1 jacksonjacobs1 added enhancement New feature or request v2.0 Pertains to the v2.0 branch labels Nov 8, 2024
@jacksonjacobs1 jacksonjacobs1 self-assigned this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.0 Pertains to the v2.0 branch
Projects
None yet
Development

No branches or pull requests

1 participant