Skip to content
Snippets Groups Projects
  1. Apr 30, 2025
  2. Apr 29, 2025
  3. Apr 25, 2025
  4. Apr 11, 2025
  5. Apr 10, 2025
    • Flavien BRIDAULT's avatar
      3301b508
    • Didier WECKMANN's avatar
      feat(io): joystick support · 3a00ce19
      Didier WECKMANN authored
      - Updated the docker image and the sight-gitlab references
      - Implemented `sight::io::joystick::interactor`, `sight::io::joystick::detail::event_loop` and a module `sight::modules::io::joystick`.
      
      #### sight::modules::io::joystick module
      
      Controls the global joystick `event_loop` instance.
      
      Basically, it starts it when `sight::modules::io::joystick::plugin::start()` is called and stops it on `sight::modules::io::joystick::plugin::stop()`. Once started, registered `interactor` will start receiving joystick events.
      
      There is a unit test (`sight::module::io::joystick::ut`) which demonstrates basic usage, the support of module unloading, etc..
      
      #### sight::io::joystick::detail::event_loop class
      
      This is where the whole implementation is. It is a singleton that uses a timer to poll for SDL events on the main thread. When one is catch, it is simply forwarded to the registered `interactor` with specific callback functions. It implies that all callback functions are executed on the main thread, so you may have to protect the access if your service runs on a specific worker.
      
      The code of `instance()` could have been simpler, but, since we are dealing with posted tasks on the main thread, special care has been needed to let the instance die without making waiting tasks crash.
      
      #### sight::io::joystick::interactor interface
      
      This register / unregister automatically to the `event_loop` any class that inherits from it. Then, these callbacks will be available:
      
      ``` c++ 
          void joystick_axis_motion_event(const axis_motion_event& _event);
          void joystick_axis_direction_event(const axis_direction_event& _event);
          void joystick_hat_motion_event(const hat_motion_event& _event);
          void joystick_ball_motion_event(const ball_motion_event& _event);
          void joystick_button_pressed_event(const button_event& _event);
          void joystick_button_released_event(const button_event& _event);
          void joystick_added_event(const joystick_event& _event);
          void joystick_removed_event(const joystick_event& _event);
      ```
      
      All callbacks use "event" structures, which should provides all needed information (device name, index, guid, axis, buttons, ...). Indeed, almost all of what is available from SDL is forwarded.
      Additionally, it is possible to list all attached devices with `devices()` and to temporary stop receiving event with `block_events(bool)`.
      
      > `joystick_axis_direction_event` is derived from `joystick_axis_motion_event`, but instead of sending the axis values on every change, it converts it to "up" or "down", and is only trigered once, until the axis goes back to neutral.
      3a00ce19
  6. Apr 09, 2025
    • Flavien BRIDAULT's avatar
      fix(viz): error in selected material pass · 69aae543
      Flavien BRIDAULT authored
      We need to set the material permutation before generating any subsequent rendering pass, otherwise these passes, like the selected material, may end-up with the wrong vertex/fragment program.
      69aae543
  7. Apr 08, 2025
  8. Apr 07, 2025
    • Flavien BRIDAULT's avatar
      enh(io): use VTK SMP TBB backend by default · cb4555f1
      Flavien BRIDAULT authored
      Under windows, we previously used standard threads which is significantly slower, in particular for vtkImageReslice. We now built TBB support in our VCPkg which allows us to switch to the TBB backend on both platforms.
      cb4555f1
    • Flavien BRIDAULT's avatar
      feat(core): make object validator generic, add service to validate · 592d6d75
      Flavien BRIDAULT authored
      A new service `sight::module::data::validate` was implemented to validate objects in a generic way. Here is an example to check that an image is filled:
      
      ```xml
      <service uid="..." type="sight::module::data::validate" >
          <in key="data" uid="image"/>
          <config id="sight::data::validator::filled" />
      </service>
      ```
      
      It provides the following signals in XML, which can be connected to your application logic:
      
      * valid()
      * invalid()
      * is_valid(bool)
      * is_invalid(bool)
      
      Also, a new validator `sight::data::validator::has_fiducials` was implemented to check if a series contains at least one fiducial.
      592d6d75
  9. Mar 27, 2025
  10. Mar 26, 2025
  11. Mar 25, 2025
  12. Mar 24, 2025
  13. Mar 22, 2025
  14. Mar 20, 2025
  15. Mar 17, 2025
  16. Mar 13, 2025
    • Marc SCHWEITZER's avatar
      enh(ui): add frameless window mode in frame · b7b72fca
      Marc SCHWEITZER authored and Marc SCHWEITZER's avatar Marc SCHWEITZER committed
      * add new qss class to round background as toolbar
      b7b72fca
    • Didier WECKMANN's avatar
      fix(ui): ensure the application and GUI test is correctly closed · e6984faa
      Didier WECKMANN authored
      This _should_ stabilize GUI tests a bit. This roughly fixes a kind of race condition in the GUI test start and stop code.
      
      When test instructions are posted in the GUI thread (because we must do that to manipulate GUI stuff), mutexes are used to allow the test thread to wait until the current test instruction is processed on the GUI thread event loop. This mechanism works well, ...until the last window is closed, which exit the application. In that case, the GUI event loop is stopped straight, which is not problematic most of the time in a real application, but unfortunately in a GUI test, if something that should have been processed is still in the event loop, like the synchronization mutex unlock, the calling thread will simply expire, making the test fail.
      
      This MR try to work around that, we try to avoid closing the window in the GUI event loop, we try to close _ALL_ window, including modal dialogs, and we try to flush the GUI event loop before exiting the test thread.
      e6984faa
  17. Mar 11, 2025
    • Flavien BRIDAULT's avatar
      enh(core): add a toggle state in module::ui::qt::signal_shortcut · 59ec7f53
      Flavien BRIDAULT authored
      `sight::module::ui::qt::signal_shortcut` provides a signal that can be connected in XML, triggered by a keyboard shortcut.
      
      We added an optional toggle state, offering a similar signal/slots interface as a `sight::module::ui::action`:
       - is_checked(bool): Emitted when the state is checked or unchecked.
       - checked(): Emitted when the state is checked.
       - unchecked(): Emitted when the state is unchecked..
       - set_checked(bool): sets whether the state is checked.
       - check(): check the state.
       - uncheck(): uncheck the state.
      
      On top of that, three other improvements were made:
      - a comma or semi-colon-separated list of shortcuts can be given
      - the `QShortcut` are now only created when the state is enabled, which allows to have multiple services running at the same time on the same shortcut, but of course, only one can be enabled at once, and it will be up to the developer to ensure that
      - the unit test has been really implemented, testing previous and new features
      59ec7f53
Loading