<plugin id="Tuto14MeshGenerator">

<requirement id="servicesReg" />

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

        <object type="::fwData::Composite">
            <service uid="MyIHM" impl="::gui::frame::DefaultFrame" type="::fwGui::IFrameSrv" autoConnect="no">
                <gui>
                    <frame>
                        <name>Tuto14MeshGenerator</name>
                        <icon>Bundles/Tuto14MeshGenerator_0-1/tuto.ico</icon>
                    </frame>
                    <menuBar />
                </gui>
                <registry>
                    <menuBar sid="myMenuBar" start="yes" />
                    <view sid="multiView_scene1" start="yes" />
                </registry>
            </service>
            
            <service uid="myMenuBar" type="::fwGui::IMenuBarSrv" impl="::gui::aspect::DefaultMenuBarSrv" autoConnect="no" >
                <gui>
                    <layout>
                        <menu name="File" />
                        <menu name="Modify" />
                    </layout>
                </gui>
                <registry>
                    <menu sid="menu_File" start="yes" />
                    <menu sid="menu_Modifier" start="yes" />
                </registry>
            </service>

            <service uid="menu_File" type="::fwGui::IMenuSrv" impl="::gui::aspect::DefaultMenuSrv" autoConnect="no" >
                <gui>
                    <layout>
                        <menuItem name="Open file" shortcut="Ctrl+O" />
                        <menuItem name="Save file" shortcut="Ctrl+S" />
                        <separator />
                        <menuItem name="Quit" specialAction="QUIT" shortcut="Ctrl+Q" />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="action_openFile" start="yes" />
                    <menuItem sid="action_saveFile" start="yes" />
                    <menuItem sid="action_quit" start="yes" />
                </registry>
            </service>

            <service uid="menu_Modifier" type="::fwGui::IMenuSrv" impl="::gui::aspect::DefaultMenuSrv" autoConnect="no" >
                <gui>
                    <layout>
                        <menuItem name="Shake mesh point" shortcut="Q" />
                        <separator />
                        <menuItem name="Colorize mesh point" shortcut="U" />
                        <menuItem name="Colorize mesh cells" shortcut="I" />
                        <separator />
                        <menuItem name="Compute point normals" shortcut="O" />
                        <menuItem name="Compute cell normals" shortcut="P" />
                        <separator />
                        <menuItem name="Shake point normals" shortcut="L" />
                        <menuItem name="Shake cell normals" shortcut="M" />
                        <separator />
                        <menuItem name="Show point normals" style="radio" shortcut="2" />
                        <menuItem name="Show cell normals" style="radio" shortcut="1" />
                        <menuItem name="Hide normals" style="radio" shortcut="0" />
                        <separator />
                        <menuItem name="Show point colors" style="radio" shortcut="4" />
                        <menuItem name="Show cell colors" style="radio" shortcut="5" />
                        <menuItem name="Hide colors" style="radio" shortcut="6" />
                        <separator />
                        <menuItem name="mesh deformation" shortcut="D"/>
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="action_shakeMeshPoint" start="yes" />
                    <menuItem sid="action_colorizeMeshPoints" start="yes" />
                    <menuItem sid="action_colorizeMeshCells" start="yes" />
                    <menuItem sid="action_computePointNormals" start="yes" />
                    <menuItem sid="action_computeCellNormals" start="yes" />
                    <menuItem sid="action_shakePointNormals" start="yes" />
                    <menuItem sid="action_shakeCellNormals" start="yes" />

                    <menuItem sid="action_showPointNormals" start="yes" />                    
                    <menuItem sid="action_showCellNormals" start="yes" />                    
                    <menuItem sid="action_hideNormals" start="yes" />
                    
                    <menuItem sid="action_showPointColors" start="yes" />                    
                    <menuItem sid="action_showCellColors" start="yes" />                    
                    <menuItem sid="action_hideColors" start="yes" />
                    
                    <menuItem sid="action_meshDeformation" start="yes" />
                                        
                </registry>
            </service>
            
            <service uid="action_openFile" type="::fwGui::IActionSrv" impl="::gui::action::StarterActionService" autoConnect="no">
                <start uid="myReaderMesh" />
            </service>
            <service uid="action_saveFile" type="::fwGui::IActionSrv" impl="::gui::action::StarterActionService" autoConnect="no">
                <start uid="myWriterMesh" />
            </service>
            <service uid="action_quit" type="::fwGui::IActionSrv" impl="::gui::action::QuitAction" autoConnect="no" />

            <service uid="multiView_scene1" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no" >
                <gui>
                    <layout type="::fwGui::CardinalLayoutManager" >
                        <view align="center" />
                        <view align="bottom" minWidth="400" minHeight="30" resizable="no" />
                    </layout>
                </gui>
                <registry>
                    <view sid="genericScene" start="yes" />
                </registry>
            </service>

            <!-- CompositeVisu description -->
            <item key="myCompositeVisu">
                <object uid="myCompositeVisu" type="::fwData::Composite">

                    <service uid="genericScene" impl="::fwRenderVTK::VtkRenderService" type="::fwRender::IRender" autoConnect="yes">
                        <scene>
                            <picker id="myPicker" vtkclass="fwVtkCellPicker" />

                            <renderer id="default" background="0.0" />
                            <adaptor id="myRenderAdaptor" class="::visuVTKAdaptor::Render" objectId="self">
                                <config renderer="default" picker="" />
                            </adaptor>
                            <adaptor id="myTrianAdaptor" class="::visuVTKAdaptor::TriangularMesh" objectId="myTrianMesh">
                                <config renderer="default" picker="" />
                            </adaptor>
                            <adaptor id="myMeshAdaptor" class="::visuVTKAdaptor::Mesh" objectId="myMesh">
                                <config renderer="default" picker="" />
                            </adaptor>
                            <adaptor id="myMeshNormalsAdaptor" class="::visuVTKAdaptor::MeshNormals" objectId="myMesh">
                                <config renderer="default" picker="" normal="CELL" />
                            </adaptor>
                        </scene>
                    </service>

                    <item key="myMesh">
                        <object type="::fwData::Mesh">
                            <service uid="myReaderMesh" impl="::uiIO::editor::IOSelectorService" type="::gui::editor::IDialogEditor" autoConnect="no">
                                <type mode="reader" />
                            </service>
                            <service uid="myWriterMesh" impl="::uiIO::editor::IOSelectorService" type="::gui::editor::IDialogEditor" autoConnect="no">
                                <type mode="writer" />
                            </service>
                            <service uid="action_shakeMeshPoint" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ShakeMeshPoint" />
                            </service>
                            <service uid="action_colorizeMeshPoints" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ColorizeMeshPoints" />
                            </service>
                            <service uid="action_colorizeMeshCells" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ColorizeMeshCells" />
                            </service>
                            <service uid="action_computePointNormals" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ComputePointNormals" />
                            </service>
                            <service uid="action_computeCellNormals" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ComputeCellNormals" />
                            </service>
                            <service uid="action_shakePointNormals" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ShakePointNormals" />
                            </service>
                            <service uid="action_shakeCellNormals" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="ShakeCellNormals" />
                            </service>
                            <service uid="action_showCellNormals" impl="::gui::action::ActionNotifyService" type="::fwGui::IActionSrv" autoConnect="no" >
                                <state active="true" />
                                <notify type="::fwComEd::MeshMsg" event="SHOW_CELL_NORMALS" />
                            </service>
                            <service uid="action_showPointNormals" impl="::gui::action::ActionNotifyService" type="::fwGui::IActionSrv" autoConnect="no">
                                <notify type="::fwComEd::MeshMsg" event="SHOW_POINT_NORMALS" />
                            </service>
                            <service uid="action_hideNormals" impl="::gui::action::ActionNotifyService" type="::fwGui::IActionSrv" autoConnect="no">
                                <notify type="::fwComEd::MeshMsg" event="HIDE_NORMALS" />
                            </service>
                            
                            <service uid="action_meshDeformation" impl="::ioData::action::SMeshModifier" type="::fwGui::IActionSrv" autoConnect="no">
                                <config functor="MeshDeformation" />
                            </service>
                            
                            <service uid="action_showPointColors" impl="::gui::action::ActionNotifyService" type="::fwGui::IActionSrv" autoConnect="no">
                                <notify type="::fwComEd::MeshMsg" event="SHOW_POINT_COLORS" />
                            </service>
                            <service uid="action_showCellColors" impl="::gui::action::ActionNotifyService" type="::fwGui::IActionSrv" autoConnect="no">
                                <notify type="::fwComEd::MeshMsg" event="SHOW_CELL_COLORS" />
                            </service>
                            <service uid="action_hideColors" impl="::gui::action::ActionNotifyService" type="::fwGui::IActionSrv" autoConnect="no">
                                <notify type="::fwComEd::MeshMsg" event="HIDE_COLORS" />
                            </service>
                                                        
                            <service uid="msgWrapper" impl="::ctrlSelection::wrapper::MsgWrapperSrv" type="::ctrlSelection::IWrapperSrv" autoConnect="yes">
                                <wrapper onEvent="ObjectMsg::UPDATED_OBJECT" toEvent="NEW_MESH" toMsgType="::fwComEd::MeshMsg" />
                            </service>
                            
                        </object>
                    </item>
                    
                    <item key="myTrianMesh">
                        <object type="::fwData::TriangularMesh">
                            
                        </object>
                    </item>
                </object>
            </item>

            <start uid="MyIHM" />
            <start uid="msgWrapper" />
            
        </object>
        
    </config>
</extension>

</plugin>
