Create ruler and camera project reactions
Add Ruler and Camera Projection reaction. This function are similar to those implmented previously in applogic except:
- The ruler has the possibility to measure distance between 3D points as illustrated bellow.
Previous MR description (for documentation purpose only):
Implement the camera projection and ruler functionality as reactions.
The feature were previously implemented in python in applogic (removed by lidarview!34 (closed)). But this has some drawback:
- code duplication
- button could be out of sync with the real view state, as the code wasn't relying on signals.
- code coupling, as the buttons and ruler needed to be enabled/disabled and show/hide at different place to try to guaranty that they are synchronized with the view
@nicolas.cadart @melanie.carriere PTAL.
If you are new to the concept of behaviors and reactions, you can find some information here.
The new architecture pivots around two new concepts:
Reactions: these are action handlers. They implement logic to handle the triggering of an action. They also implement logic to keep the enable state for the action update-to-date based on current application state. eg. pqLoadStateReaction -- reaction of load state action, which encapsulates ParaView's response for load state action. Reactions require the QAction to which they are reacting to. Any custom user interface that wants a QAction to be behave exactly like Paraview's, simply instantiates the reaction for it and that's it! The rest it managed by the reaction.
Behaviors - these are abstract application behaviors eg. ParaView always remains connected to a server (builtin by default). This gets encapsulated into pqAlwaysConnectedBehavior. If any custom application wants to a particular behavior, simply instantiates the corresponding behavior!