enh(viz): shorten scene3d layer configuration
Description
We believe the configuration of the 3D scene could be slightly improved, by making the layer configuration simpler and clearer.
Proposal
Instead of this configuration:
<service uid="genericSceneSrv" type="sight::viz::scene3d::SRender" >
<scene>
<background topColor="#36393E" bottomColor="#36393E" />
<layer id="first" order="1" />
<layer id="second" order="2" />
<adaptor uid="trackballInteractorAdp" />
<adaptor uid="negatoAdp" />
</scene>
</service>
<service uid="trackballInteractorAdp" type="sight::module::viz::scene3d::adaptor::STrackballCamera" >
<config layer="first" priority="0" />
</service>
<!-- 3D image negatoscope adaptor -->
<service uid="second" type="sight::module::viz::scene3d::adaptor::SNegato3D" autoConnect="true" >
<in key="image" uid="image" />
<inout key="tf" uid="tf" />
<config layer="default" sliceIndex="axial" interactive="true" />
</service>
we propose the following, that puts the <adaptor>
as children of <layer/>
, which replaces the <config layer="">
attribute.
<service uid="genericSceneSrv" type="sight::viz::scene3d::SRender" >
<scene>
<background topColor="#36393E" bottomColor="#36393E" />
<layer id="first" order="1" />
<adaptor uid="trackballInteractorAdp" />
</layer>
<layer id="second" order="2" />
<adaptor uid="negatoAdp" />
</layer>
</scene>
</service>
<service uid="trackballInteractorAdp" type="sight::module::viz::scene3d::adaptor::STrackballCamera" >
<config priority="0" />
</service>
<!-- 3D image negatoscope adaptor -->
<service uid="negatoAdp" type="sight::module::viz::scene3d::adaptor::SNegato3D" autoConnect="true" >
<in key="image" uid="image" />
<inout key="tf" uid="tf" />
<config sliceIndex="axial" interactive="true" />
</service>
Functional specifications
- Add support for the new syntax.
- Keep compatibility with the current syntax.
Technical specifications
- We need to extend the current adaptor registry to also store the layer name.
- We need to add support to parse the new syntax
- We raise an error if the configuration uses both the new syntax and the old syntax.
Test plan
- Port one or two samples, possibly SightViewer to use the new syntax.
- The GUI tests will ensure the apps still launch whatever the syntax they use.