<plugin id="Tuto02DataServiceBasic">

<requirement id="servicesReg" />

<extension implements="::fwServices::registry::AppConfig">
        <id>tutoDataServiceBasicConfig</id>
        <type>parameters</type>
        <config>
        

    <!-- In tutoDataServiceBasic, the central data  object is a ::fwData::Image type.-->
    <object type="::fwData::Image">

        <!-- Reading service. Here, the service unique identifier (uid) is set to the myReaderPathFile value.
        In this tutorial, this service does not need to receive information about its linked data. Therefore the autoConnect is set to no.
        We are going to see in detail the use of communications in the tutoComChannel tutorial.
        Furthermore, in the filename tag, an attribut (id) allows also to clarify the location of the 3D medical image file. 
        In our case, the image must be stored in the MyInstallDir directory, in a sub-directory named TutoData.
--> 
        <service impl="::ioVTK::ImageReaderService" type="::io::IReader" uid="myReaderPathFile" autoConnect="no" >
            <file>./TutoData/patient1.vtk</file>
        </service>
     
        <!-- Visualization service of a 3D medical image.
        Here, the value of the service unique identifier (uid) is myRenderingTuto.
        In our tutorial, this service needs to receive information about its linked data,
        indeed, it has to receive a message when the image is effectively loaded. Therefore, the autoConnect value is fixed to yes.
        Furthermore, a guiContainerId attribut is also associated to the service.-->
        <service impl="::vtkSimpleNegato::RendererService" type="::fwRender::IRender" uid="myRenderingTuto" autoConnect="yes" />
        
        <!-- Description service of the HMI.
        Here, the container will be used by the 3D visualization service previously described. 
        The ::gui::frame::MainFrame service automaticly positions the different containers in the application main window.
        In our tutorial, this service does not need to receive information about its linked data. Therefore the autoConnect is set to no.
        Remember we will see in details the use of communications in the tutoComChannel tutorial.-->
        <service uid="myFrame" type="::fwGui::IFrameSrv" impl="::gui::frame::DefaultFrame" autoConnect="no">
            <gui>
                <frame>
                    <name>tutoDataServiceBasic</name>
                    <icon>Bundles/Tuto02DataServiceBasic_0-1/tuto.ico</icon>
                    <minSize width="800" height="600" />
                </frame>
            </gui>
            <registry>
                <view sid="myRenderingTuto" start="yes" />
            </registry>
        </service>
        
        <!-- Definition of the starting and closing order of the different services.
        Here, the three services ::fwGui::IFrameSrv, and myReaderPathFile are started,
        nevertheless, only the myReaderPathFile service is updated after the launching.
        Indeed, as the image location is known (contained in the configuration file),
        the image can be loaded since the application starting. It corresponds to the update flag for myReaderPathFile.
        The HMI service must be started first, then the rendering service, and finaly the reading service.
        The stopping of the services is done in the reverse order compared to the starting one.
-->
        
        <start uid="myFrame" />
        <start uid="myReaderPathFile"/>

        <update uid="myReaderPathFile"/>

    </object>

        </config>
    </extension>

</plugin>
