<plugin id="Tuto10MatrixTransformInGS">

    <requirement id="servicesReg" />

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

        <object type="::fwData::Composite" >
        
            <service uid="myFrame" type="::fwGui::IFrameSrv" impl="::gui::frame::DefaultFrame" autoConnect="no" >
                <gui>
                    <frame>
                        <name>Tuto10MatrixTransformInGS</name>
                        <icon>Bundles/Tuto10MatrixTransformInGS_0-1/tuto.ico</icon>
                        <minSize width="800" height="600"/>
                    </frame>
                    <menuBar />
                </gui>
                <registry>
                    <menuBar sid="myMenuBar" start="yes" />
                    <view sid="multiView" start="yes" />
                </registry>
            </service>

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

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

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

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


            <service uid="multiView" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no" >
                <gui>
                    <layout type="::fwGui::CardinalLayoutManager" >
                        <view align="center" />
                        <view align="bottom" minHeight="40" position="0" />
                    </layout>
                </gui>
                <registry>
                    <view sid="genericScene" start="yes" />
                    <view sid="matrixEditor" start="yes" />
                </registry>
            </service>

            <service uid="genericScene" impl="::fwRenderVTK::VtkRenderService" type="::fwRender::IRender" autoConnect="yes">
                <scene>

                    <renderer id="default" background="0.0" />

                    <picker id="myPicker" vtkclass="fwVtkCellPicker" />

                    <vtkObject id="mat1" class="vtkTransform" />
                    <vtkObject id="mat2" class="vtkTransform" />
                    <vtkObject id="mat3" class="vtkTransform" />
                    <vtkObject id="mat4" class="vtkTransform" />
                    <vtkObject id="mat5" class="vtkTransform" />
                    
                    <!-- mat5 = mat5 x mat1 x mat4 -->
                    <vtkObject id="mat6" class="vtkTransform" >
                        <vtkTransform>
                            <concatenate>mat5</concatenate>
                            <concatenate>mat1</concatenate>
                            <concatenate>mat4</concatenate>
                        </vtkTransform>
                    </vtkObject>
                    
                    <!-- mat6 = mat5 x mat2 x mat5 x mat5 x mat5 x mat4 x mat4 -->
                    <vtkObject id="mat7" class="vtkTransform" >
                        <vtkTransform>
                            <concatenate inverse="yes">mat5</concatenate>
                            <concatenate>mat2</concatenate>
                            <concatenate>mat5</concatenate>
                            <concatenate>mat5</concatenate>
                            <concatenate>mat5</concatenate>
                            <concatenate>mat4</concatenate>
                            <concatenate>mat4</concatenate>
                        </vtkTransform>
                    </vtkObject>
                    
                    <!-- mat7 = mat3 x mat5 x mat4 x mat4 x mat4 -->
                    <vtkObject id="mat8" class="vtkTransform" >
                        <vtkTransform>
                            <concatenate>mat3</concatenate>
                            <concatenate>mat5</concatenate>
                            <concatenate>mat4</concatenate>
                            <concatenate>mat4</concatenate>
                            <concatenate>mat4</concatenate>
                        </vtkTransform>
                    </vtkObject>
                    
                    

                    <adaptor id="MatrixAdatorA" class="::visuVTKAdaptor::Transform" objectId="matrixA">
                        <config renderer="default" picker="" transform="mat1" />
                    </adaptor>

                    <adaptor id="MatrixAdatorB" class="::visuVTKAdaptor::Transform" objectId="matrixB">
                        <config renderer="default" picker="" transform="mat2" />
                    </adaptor>
                    
                    <adaptor id="MatrixAdatorC" class="::visuVTKAdaptor::Transform" objectId="matrixC">
                        <config renderer="default" picker="" transform="mat3" />
                    </adaptor>
                    
                    <adaptor id="MatrixAdatorD" class="::visuVTKAdaptor::Transform" objectId="matrixD">
                        <config renderer="default" picker="" transform="mat4" />
                    </adaptor>
                    
                    <adaptor id="MatrixAdatorE" class="::visuVTKAdaptor::Transform" objectId="matrixE">
                        <config renderer="default" picker="" transform="mat5" />
                    </adaptor>
                    
                    
                    
                    <adaptor id="Renderer" class="::visuVTKAdaptor::Render" objectId="self">
                        <config renderer="default" picker="" />
                    </adaptor>

                    <adaptor id="TMAdaptor1" class="::visuVTKAdaptor::Mesh" objectId="mesh">
                        <config renderer="default" picker="" />
                    </adaptor>

                    <adaptor id="TMAdaptor2" class="::visuVTKAdaptor::Mesh" objectId="mesh">
                        <config renderer="default" picker="" transform="mat6" />
                    </adaptor>
                    
                    <adaptor id="TMAdaptor3" class="::visuVTKAdaptor::Mesh" objectId="mesh">
                        <config renderer="default" picker="" transform="mat7" />
                    </adaptor>
                    
                    <adaptor id="TMAdaptor4" class="::visuVTKAdaptor::Mesh" objectId="mesh">
                        <config renderer="default" picker="" transform="mat8" />
                    </adaptor>

                </scene>
            </service>
            
            <item key="matrixA">
                <object uid="matrixA" type="::fwData::TransformationMatrix3D">
                    <matrix>
                        1 0 0 2
                        0 1 0 0
                        0 0 1 0
                        0 0 0 1 
                    </matrix>
                </object>
            </item>
            
            <item key="matrixB">
                <object uid="matrixB" type="::fwData::TransformationMatrix3D">
                    <matrix>
                        1 0 0 4
                        0 1 0 0
                        0 0 1 0
                        0 0 0 1 
                    </matrix>
                </object>
            </item>
            
            <item key="matrixC">
                <object uid="matrixC" type="::fwData::TransformationMatrix3D">
                    <matrix>
                        1 0 0 0
                        0 1 0 0
                        0 0 1 2
                        0 0 0 1 
                    </matrix>
                </object>
            </item>
            
            <item key="matrixD">
                <object uid="matrixD" type="::fwData::TransformationMatrix3D">
                    <matrix>
                        0.75 0 0 0
                        0 0.75 0 0
                        0 0 0.75 0
                        0 0 0 1 
                    </matrix>
                </object>
            </item>
            
            <item key="matrixE">
                <object uid="matrixE" type="::fwData::TransformationMatrix3D">
                    <service uid="matrixEditor" impl="::uiVisu::TransformationMatrixEditor" type="::gui::editor::IEditor" autoConnect="yes" />
                </object>
            </item>

            <item key="mesh">
                <object uid="mesh" type="::fwData::Mesh">
                    <service uid="myReaderPathFile" impl="::uiIO::editor::IOSelectorService" type="::gui::editor::IDialogEditor" autoConnect="no" />
                </object>
            </item>
            
            <start uid="myFrame" />
            
            

        </object>

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