<plugin id="Tuto02DataServiceBasic" >

    <!-- 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::service::extension::AppConfig" >
        <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::base::SFrame 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::base::SFrame" >
                <gui>
                    <frame>
                        <name>Tuto02DataServiceBasic</name>
                        <icon>Tuto02DataServiceBasic/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::SImageReader" >
                <inout key="data" uid="imageData" />
                <resource>Tuto02DataServiceBasic/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::SImage" >
                <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>
