Improved operations and fixed pick block #223
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously operations were very limited and all of the rendering and behaviour logic was done in the parent tool.
This changes that and moves all the logic into the operation itself.
The
OperationUI
class has been stripped back to a bare API and the logic has been moved into the subclassDefaultOperationUI
.If you want to retain the default behaviour (including rendering, camera movement and some other things) you will need to switch the class that you subclass.
If instead you want to define your own interaction and rendering behaviour you can do so by subclassing
OperationUI
and adding on the behaviour.The
unload
method is nowdisable
to make it have the same API as tools so you will need to rename those methods.Finally
EVT_BOX_CLICK
has been removed. The trigger for it was removed a while back but it has stayed because things were still importing it. This logic can be achieved by listening toEVT_INPUT_PRESS
on the canvas and checking theaction_id
of the event.If you are using
DefaultOperationUI
that logic has been handled for you and the method_on_box_click
will be run when this action is run. Define this method in the subclass to run the desired code.With these changes to give the operations more control it is now possible to re-implement the pick block tool.