You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Users can create, edit, and delete polygon annotations.
Undo/Redo actions work consistently.
Mouse interactions update polygon annotations as described.
Brush and erase tools work without self-intersections in the final shape.
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
FieldsState Change Conditions
CurrentAnnotation
will reset on deselection, delete, and multi-selection events. Undo and redo actions will respectively pop the latest item fromundoStack
orredoStack
and updateCurrentAnnotation
.Tool Behaviors
On
mousedown
CurrentAnnotation
.CurrentAnnotation
with default values.On
mousemove
On
mouseup
currentState
inundoStack
and update the drawing based on the tool used.Implementation Notes
CurrentAnnotation
updates accurately.Acceptance Criteria
References:
The text was updated successfully, but these errors were encountered: