<extension implements="::fwServices::registry::AppConfig">
    <id>2DVisualization</id>
    <type>parameters</type>
    <parameters>
        <param name="WID_PARENT" />
        <param name="GENERIC_UID" />
        <param name="SERIESDB" />
        <param name="AS_UID" />
        <param name="imageUid" />
    </parameters>
    <config>

        <object type="::fwData::Composite">

            <service uid="${GENERIC_UID}_mainView" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no">
                <gui>
                    <layout type="::fwGui::CardinalLayoutManager">
                        <view caption="Negato1" align="center" />
                        <view caption="Negato2" align="right" minWidth="350" />
                        <view caption="Negato3" align="right" minWidth="350" />
                    </layout>
                    <toolBar />
                </gui>
                <registry>
                    <parent wid="${WID_PARENT}" />
                    <toolBar sid="${GENERIC_UID}_toolBar" start="yes" />
                    <view wid="${GENERIC_UID}_view_negato1" />
                    <view wid="${GENERIC_UID}_view_negato2" />
                    <view wid="${GENERIC_UID}_view_negato3" />
                </registry>
            </service>

            <service uid="${GENERIC_UID}_toolBar" type="::fwGui::IToolBarSrv" impl="::gui::aspect::DefaultToolBarSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menuItem name="New landmark" icon="Bundles/media_0-1/icons/Add-landmark.png" />
                        <menuItem name="Remove landmark" icon="Bundles/media_0-1/icons/Remove-landmark.png" />
                        <menuItem name="Load landmark" icon="Bundles/media_0-1/icons/Load-landmark.png" />
                        <menuItem name="Save landmark" icon="Bundles/media_0-1/icons/Save-landmark.png" />
                        <menuItem name="Focus landmark" icon="Bundles/media_0-1/icons/Find-landmark.png" />
                        <menuItem name="Hide/Show landmark" icon="Bundles/media_0-1/icons/View-landmark.png" />
                        <separator />
                        <menuItem name="Add distance" icon="Bundles/media_0-1/icons/distance.png" />
                        <menuItem name="Remove distance" icon="Bundles/media_0-1/icons/RemoveDistance.png" />
                        <menuItem name="Hide distance" icon="Bundles/media_0-1/icons/HideDistance.png" style="check" />
                        <separator />
                        <menuItem name="Hide cross" icon="Bundles/media_0-1/icons/HideCross.png" style="radio" />
                        <menuItem name="Show normal cross" icon="Bundles/media_0-1/icons/NormalCross.png" style="radio" />
                        <menuItem name="Show full cross" icon="Bundles/media_0-1/icons/FullCross.png" style="radio" />
                        <separator />
                        <menuItem name="Export Activity" icon="Bundles/media_0-1/icons/Export.svg"  />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="${GENERIC_UID}_ActionNewLandmark" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionRemoveLandmark" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionLoadLandmark" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionSaveLandmark" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionFocusLandmark" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionHideLandmark" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionAddDistance" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionRemoveDistance" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionHideDistance" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionHideCross" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionShowNormalCross" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionShowFullCross" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionExportActivity" start="yes" />
                </registry>
            </service>

            <item key="seriesDB">
                <object uid="${SERIESDB}" src="ref" type="::fwMedData::SeriesDB">
                    <service uid="${GENERIC_UID}_ActionExportActivity" type="::fwGui::IActionSrv" impl="::uiMedData::action::SExportSeries" autoConnect="yes">
                        <seriesId>${AS_UID}</seriesId>
                    </service>
                </object>
            </item>
            
            <item key="activitySeries">
                <object uid="${AS_UID}" src="ref" type="::fwMedData::ActivitySeries" />
            </item>

            <item key="imageKey">
                <object uid="${imageUid}" src="ref" type="::fwData::Image">
                    <service uid="${GENERIC_UID}_MedicalImageSrv" impl="::ctrlSelection::MedicalImageSrv" type="::fwServices::IController" autoConnect="no" />

                    <service uid="${GENERIC_UID}_cfgNegato1" impl="::fwServices::SConfigController" autoConnect="no">
                        <config>
                            <appConfig id="2DNegato" >
                                <parameters>
                                    <parameter replace="imageUid" by="self"  />
                                    <parameter replace="orientation" by="axial"  />
                                    <parameter replace="WID_PARENT" by="${GENERIC_UID}_view_negato1"  />
                                </parameters>
                            </appConfig>
                        </config>
                    </service>

                    <service uid="${GENERIC_UID}_cfgNegato2" impl="::fwServices::SConfigController" autoConnect="no">
                        <config>
                            <appConfig id="2DNegato" >
                                <parameters>
                                    <parameter replace="imageUid" by="self"  />
                                    <parameter replace="orientation" by="frontal"  />
                                    <parameter replace="WID_PARENT" by="${GENERIC_UID}_view_negato2"  />
                                </parameters>
                            </appConfig>
                        </config>
                    </service>

                    <service uid="${GENERIC_UID}_cfgNegato3" impl="::fwServices::SConfigController" autoConnect="no">
                        <config>
                            <appConfig id="2DNegato" >
                                <parameters>
                                    <parameter replace="imageUid" by="self"  />
                                    <parameter replace="orientation" by="sagittal"  />
                                    <parameter replace="WID_PARENT" by="${GENERIC_UID}_view_negato3"  />
                                </parameters>
                            </appConfig>
                        </config>
                    </service>


                    <service uid="${GENERIC_UID}_ActionFocusLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::FocusLandmark" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionNewLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::AddLandmark" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionRemoveLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::RemoveLandmark" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionLoadLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::LoadLandmark" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionSaveLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::SaveLandmark" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionHideLandmark" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::ShowLandmark" autoConnect="yes" />
                    <service uid="${GENERIC_UID}_ActionAddDistance" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::AddDistance" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionRemoveDistance" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::RemoveDistance" autoConnect="no" />
                    <service uid="${GENERIC_UID}_ActionHideDistance" type="::fwGui::IActionSrv" impl="::uiMeasurement::action::ShowDistance" autoConnect="yes" />
                    <service uid="${GENERIC_UID}_ActionHideCross" type="::fwGui::IActionSrv" impl="::uiVisu::action::CrossTypeAction" autoConnect="no">
                        <crossType>hide</crossType>
                    </service>
                    <service uid="${GENERIC_UID}_ActionShowNormalCross" type="::fwGui::IActionSrv" impl="::uiVisu::action::CrossTypeAction" autoConnect="no">
                        <crossType>half</crossType>
                        <state active="true" />
                    </service>
                    <service uid="${GENERIC_UID}_ActionShowFullCross" type="::fwGui::IActionSrv" impl="::uiVisu::action::CrossTypeAction" autoConnect="no">
                        <crossType>full</crossType>
                    </service>
                </object>
            </item>


            <!-- START AND STOP SERVICES -->
            <start uid="${GENERIC_UID}_mainView" />
            <start uid="${GENERIC_UID}_MedicalImageSrv" />

            <start uid="${GENERIC_UID}_cfgNegato1" />
            <start uid="${GENERIC_UID}_cfgNegato2" />
            <start uid="${GENERIC_UID}_cfgNegato3" />

        </object>

    </config>
</extension>
