<plugin id="Tuto05MesherC">

    <requirement id="servicesReg" />

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


        <!--  Composite data creation. -->
        <object type="::fwData::Composite">

            <!-- Frame & View -->

            <!--
                Service associated to the Composite data :
                main window creation.
            -->
            <service uid="myFrame" type="::fwGui::IFrameSrv" impl="::gui::frame::DefaultFrame" autoConnect="no">
                <gui>
                    <frame>
                        <name>Mesher</name>
                        <icon>Bundles/Tuto05MesherC_0-1/tuto.ico</icon>
                        <minSize width="800" height="600" />
                    </frame>
                    <menuBar />
                </gui>
                <registry>
                    <menuBar sid="myMenuBar" start="yes" />
                    <view sid="myDefaultView" start="yes" />
                </registry>
            </service>

            <service uid="myDefaultView" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no">
                <gui>
                    <layout type="::fwGui::CardinalLayoutManager">
                        <view caption="Image view" align="center" />
                        <view caption="Mesh 1 view" align="right" minWidth="500" minHeight="100" />
                        <view caption="Meshes view" align="right" minWidth="500" minHeight="100" />
                        <view caption="Mesh 2 view" align="right" minWidth="500" minHeight="100" />
                    </layout>
                </gui>
                <registry>
                    <view sid="RenderingImage" start="yes" />
                    <view sid="RenderingMesh1" start="yes" />
                    <view sid="RenderingMesh" start="yes" />
                    <view sid="RenderingMesh2" start="yes" />
                </registry>
            </service>


            <!-- Menu Bar, Menus & Actions -->


            <service uid="myMenuBar" type="::fwGui::IMenuBarSrv" impl="::gui::aspect::DefaultMenuBarSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menu name="File" />
                        <menu name="Mesher" />
                    </layout>
                </gui>
                <registry>
                    <menu sid="menuFile" start="yes" />
                    <menu sid="menuMesher" start="yes" />
                </registry>
            </service>


            <service uid="menuFile" type="::fwGui::IMenuSrv" impl="::gui::aspect::DefaultMenuSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menuItem name="Open image file" shortcut="Ctrl+O" />
                        <menuItem name="Save image" />
                        <separator />
                        <menuItem name="Quit" specialAction="QUIT" shortcut="Ctrl+Q" />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="actionOpenImageFile" start="yes" />
                    <menuItem sid="actionSaveImageFile" start="yes" />
                    <menuItem sid="actionQuit" start="yes" />
                </registry>
            </service>


            <service uid="menuMesher" type="::fwGui::IMenuSrv" impl="::gui::aspect::DefaultMenuSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menuItem name="Compute Mesh 1 (VTK)" />
                        <menuItem name="Compute Mesh 2 (VTK)" />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="actionCreateVTKMesh1" start="yes" />
                    <menuItem sid="actionCreateVTKMesh2" start="yes" />
                </registry>
            </service>

            <service uid="actionQuit" type="::fwGui::IActionSrv" impl="::gui::action::QuitAction" autoConnect="no" />



            <!--
                Service associated to the Composite data :
                menu services creation.
                Actions in relationship with images and meshe
            -->
            <service uid="actionOpenImageFile" type="::fwGui::IActionSrv" impl="::gui::action::StarterActionService" autoConnect="no">
                <start uid="readerPathImageFile" />
            </service>

            <service uid="actionSaveImageFile" type="::fwGui::IActionSrv" impl="::gui::action::StarterActionService" autoConnect="no">
                <start uid="writerImageFile" />
            </service>

            <service uid="actionCreateVTKMesh1" type="::fwGui::IActionSrv" impl="::opVTKMesh::action::VTKMeshCreation" autoConnect="no">
                <image uid="myImage" />
                <mesh uid="myMesh1" />
                <percentReduction value="0" />
            </service>

            <service uid="actionCreateVTKMesh2" type="::fwGui::IActionSrv" impl="::opVTKMesh::action::VTKMeshCreation" autoConnect="no">
                <image uid="myImage" />
                <mesh uid="myMesh2" />
                <percentReduction value="30" />
            </service>



            <service impl="::vtkCompositeMesh::RendererService" type="::fwRender::IRender" uid="RenderingMesh" autoConnect="yes" />

            <!--
                Image object creation Services contained between the tags <object> and </object>
                are associated to the Image data.
            -->
            <item key="myImage">
                <object uid="myImage" type="::fwData::Image">

                    <!--
                    Services associated to the Image data :
                    Visualization, reading and writing service creation.
                    -->
                    <service impl="::vtkSimpleNegato::RendererService" type="::fwRender::IRender" uid="RenderingImage" autoConnect="yes" />

                    <service impl="::uiIO::editor::IOSelectorService" type="::gui::editor::IDialogEditor" uid="readerPathImageFile" autoConnect="no">
                        <type mode="reader" />
                    </service>

                    <service impl="::uiIO::editor::IOSelectorService" type="::gui::editor::IDialogEditor" uid="writerImageFile" autoConnect="no">
                        <type mode="writer" />
                    </service>

                </object>
            </item>

            <!--
                Mesh object creation. Services contained between the tags <object> and </object> are
                associated to the Mesh data.
             -->
            <item key="myMesh1">
                <object uid="myMesh1" type="::fwData::Mesh">

                    <!--
                        Services associated to the Mesh data :
                        Visualization, reading and writing service creation.
                    -->
                    <service impl="::vtkSimpleMesh::RendererService" type="::fwRender::IRender" uid="RenderingMesh1" autoConnect="yes"/>

                </object>
            </item>

            <!--
                Mesh object creation. Services contained between the tags <object> and </object> are
                associated to the Mesh data.
             -->
            <item key="myMesh2">
                <object uid="myMesh2" type="::fwData::Mesh">

                    <!--
                        Services associated to the Mesh data :
                        Visualization, reading and writing service creation.
                    -->
                    <service impl="::vtkSimpleMesh::RendererService" type="::fwRender::IRender" uid="RenderingMesh2" autoConnect="yes"/>

                </object>
            </item>

            <!-- Connect RenderingMesh 'updateCamPosition' slot to receive 'camUpdated' signal from RenderingMesh1 and RenderingMesh2 -->
            <connect>
                <signal>RenderingMesh1/camUpdated</signal>
                <slot>RenderingMesh/updateCamPosition</slot>
            </connect>

            <connect>
                <signal>RenderingMesh2/camUpdated</signal>
                <slot>RenderingMesh/updateCamPosition</slot>
            </connect>

            <!-- Connect RenderingMesh 'receive' slot to receive 'objectModified' signal from myMesh1 and myMesh2 -->
            <connect>
                <signal>myMesh1/objectModified</signal>
                <slot>RenderingMesh/receive</slot>
            </connect>

            <connect>
                <signal>myMesh2/objectModified</signal>
                <slot>RenderingMesh/receive</slot>
            </connect>

            <!--
                In order to start the different services, it does not need to follow the objects creation order. Note that the services associated to the Image and Mesh data are not started
                between the tags corresponding to these two data definitions but, before the end of the Composite data definition.
            -->
            <start uid="myFrame" />

        </object>

        </config>
    </extension>
</plugin>
