<plugin id="tuto02_data_service_basic">
    <!-- The modules in requirements are automatically started when this
         Application is launched. -->
    <requirement id="sight::module::service" />
    <requirement id="sight::module::ui::qt" />

    <extension implements="sight::app::extension::config">
        <id>TutoDataServiceBasic_AppCfg</id>
        <config>
            <!-- ******************************* Objects declaration ****************************** -->

            <!-- In tutoDataServiceBasic, the central data object is a sight::data::image. -->
            <object uid="imageData" type="sight::data::image" />

            <!-- ******************************* UI declaration *********************************** -->

            <!--
                Description service of the GUI:
                The sight::module::ui::frame service automatically positions the various
                containers in the application main window.
                Here, it declares a container for the 3D rendering service.
            -->
            <service uid="mainFrame" type="sight::module::ui::frame">
                <gui>
                    <frame>
                        <name>tuto02_data_service_basic</name>
                        <icon>tuto02_data_service_basic/tuto.ico</icon>
                        <minSize width="800" height="600" />
                    </frame>
                </gui>
                <registry>
                    <!-- Associate the container for the rendering service. -->
                    <view sid="imageRendereSrv" />
                </registry>
            </service>

            <!-- ******************************* Services ***************************************** -->

            <!--
                Reading service:
                The <resource> tag defines the resource path (/rc) of a module or application.
            -->
            <service uid="imageReaderSrv" type="sight::module::io::vtk::image_reader">
                <inout key="data" uid="imageData" />
                <resource>tuto02_data_service_basic/img-test.vtk</resource>
            </service>

            <!--
                Visualization service of a 3D medical image:
                This service will render the 3D image.
            -->
            <service uid="imageRendereSrv" type="sight::module::viz::sample::image">
                <in key="image" uid="imageData" />
            </service>

            <!-- ******************************* Start services ***************************************** -->

            <!--
                Definition of the starting order of the different services:
                The frame defines the 3D scene container, so it must be started first.
                The services will be stopped the reverse order compared to the starting one.
            -->
            <start uid="mainFrame" />
            <start uid="imageReaderSrv" />
            <start uid="imageRendereSrv" />

            <!-- ******************************* Update services ***************************************** -->

            <!--
                Definition of the service to update:
                The reading service load the data on the update.
                The render update must be called after the reading of the image.
            -->
            <update uid="imageReaderSrv" />
            <update uid="imageRendereSrv" />
        </config>
    </extension>
</plugin>
