2 Commits

Author SHA1 Message Date
Christopher Root
07c948fb60
Enforces cross-section line draw rule by only allowing one drawn cross section at a time (#611)
* A bit better generalization of the lasso tools by adding a lasso tool
type identifier to each tool subclass.

* Add some new events for when lasso tool buttons are activated or
deactivated. This may be useful to check the case that a cross section
line was deleted as a result of the user drawing a new line.

* Adds a more general-purpose fireEvent utility method to the base
ShapeHandler class that will auto-tag the event with the current
lasso_tool_type. This allows for a more preferred way to check whether
a created shape is a result of a specific tool or not.

* Tags lasso tool shapes with the tool type which may be useful in
callback handlers

* Enforces the restriction that only one cross-section line can be drawn
at a time. It does this by deleting any previously existing line shapes
on a new "create" click.

* Adds an emum that adds more flexibility as to when a ShapeHandler's
destroy() method might be called so derived classes can do more
context-aware destroys, i.e. all shapes being destroyed as a result of
a "cancel", or just the temporary shapes being destroyed after a shape
is successfully completed.

* Fill out the remaining pieces of throwing a DRAW STOPPED event signal
with a reason (cancelled, completed, reset, or deactivated)
2022-12-05 09:30:18 -08:00
Christopher Root
05fe33dca9
Adds Cross Section-ready line draw tool to the suite of lasso tools (#609)
* Adds a first pass of a LatLonPolyLine class that will be used to draw
the single line segment for a cross-section.

* Adds an LineCrossSection example.

* Adds some initial lasso-specific event handling for lasso shapes. This
currently captures lasso shape create, delete, and draggable edit begin,
end.

* Adds a new onDrawEvent() method to raster-draw-mixin that's used as a
conduit to adding event callbacks to the drawEngine instance that 
manages all the drawn lasso shapes. There's room for improvement here
tho.

* Adds new LassoToolSetTypes bitflag enum to control the visibility of
which lasso tools you want to display on a raster-draw-mixin enabled
chart.
2022-12-01 16:22:48 -08:00