Skip to content

feat(ui): predefined camera enhancement, cardinalLayout area maximization and accordion menu fix

Didier WECKMANN requested to merge layout-enhancement into dev

Description

  • SPredefinedCamera can now have a predefined start position. Ex:
    <service uid="fixedInteractorAdp" type="sight::module::viz::scene3d::adaptor::SPredefinedCamera">
      <config mouseRotation="true" defaultPosition="frontal" />
      <positions>
        <position name="axial" />
        <position name="sagittal" ry="90.0" />
        <position name="frontal" rx="-90.0" />      
      </positions>
    </service>
  • Fix for accordion menu to allow correct display of all widgets (other than buttons).
  • SAction can now trigger custom parameter_t signals. Ex:
    <service uid="swapAct" type="sight::module::ui::base::SAction">
      <parameter key="swap" clicked="${WID_PARENT}" checked="xxx" unchecked="yyy" />
    </service>
  • Add a modifyLayout slot in IViewLayoutManager for custom layout actions. This allows implementing a "generic" maximization API. Ex:
    void CardinalLayoutManager::modifyLayout(const ui::base::parameter_t& parameter, const std::string& key)
    {
      if(key == "swap")
      {
        // Get the wid of the container to switch to central or maximize/restore.
        SIGHT_THROW_IF("WID parameter is missing.", !std::holds_alternative<std::string>(parameter));
        const auto& wid = std::get<std::string>(parameter);
    
        // Get the container from the registry.
        const auto& container = sight::ui::base::GuiRegistry::getWIDContainer(wid);
        SIGHT_THROW_IF("Cannot retrieve container '" << wid << "' in the registry.", !container);
    
        const auto& qt_container = sight::ui::qt::container::QtContainer::dynamicCast(container);
        SIGHT_ASSERT("Container '" << wid << "' is not a QtContainer.", qt_container);
    
        ...
      }
    }
  • Implements CardinalLayoutManager resizable="false" TODO from: "xxxx, il y a 13 ans (juillet 9th, 2010 5:15 ap.m.) "
  • Remove various unused constants which were breaking clang-15 build (Do not know why now...)

How to test it?

For SPredefinedCamera, SAction and modifyLayout, test third party application that use this features...

For accordion menu "fix":

  • Launch SightViewer, check that the accordion menu (landmarks, distance measurement) are correctly displayed.
  • In application that displays an editor instead of simple buttons, check that everything is correctly displayed.
Edited by Didier WECKMANN

Merge request reports