Skip to content

Commit

Permalink
Updated documentation for Tuto01 and Tuto02.
Browse files Browse the repository at this point in the history
--HG--
branch : fw4spl_0.11.0
  • Loading branch information
emiliehar committed Jul 4, 2016
1 parent 7b6777b commit e68f873
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 94 deletions.
64 changes: 32 additions & 32 deletions Tutorials/src/Tuto01Basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@ This file describes the project information and requirements :
set( VERSION 0.1 ) # Version of the application
set( TYPE APP ) # Type APP represent "Application"
set( DEPENDENCIES ) # For an application we have no dependencies (libraries to link)
set( REQUIREMENTS # List of the bundles used by this application
set( REQUIREMENTS # The bundles used by this application
dataReg # to load the data registry
servicesReg # to load the service registry
gui # to load gui
guiQt # to load the Qt implementation of gui
launcher # executable of the application
appXml # to parse the application configuration
)
guiQt # to load qt implementation of gui
fwlauncher # executable to run the application
appXml2 # to parse the application configuration
)
# Set the configuration to use : 'tutoBasicConfig'
bundleParam(appXml PARAM_LIST config PARAM_VALUES tutoBasicConfig)
bundleParam(appXml2 PARAM_LIST config PARAM_VALUES tutoBasicConfig)
This file contains the minimal requirements to launch an application with a Qt user interface.

Expand All @@ -83,44 +84,43 @@ This file is in the ``rc/`` directory of the application. It defines the service
using the version defined in the Properties.cmake) -->
<plugin id="Tuto01Basic" version="@DASH_VERSION@">
<!-- The bundles in requirements are automatically started when this
Application is launched. -->
<requirement id="dataReg" />
<requirement id="servicesReg" />
<requirement id="guiQt" />
<!-- Defines the App-config -->
<extension implements="::fwServices::registry::AppConfig">
<extension implements="::fwServices::registry::AppConfig2">
<id>tutoBasicConfig</id><!-- identifier of the configuration -->
<config>
<object type="::fwData::Image"><!-- Main object -->
<!-- Frame service -->
<service uid="myFrame" impl="::gui::frame::SDefaultFrame">
<gui>
<frame>
<name>tutoBasicApplicationName</name>
<icon>Bundles/Tuto01Basic_0-1/tuto.ico</icon>
<minSize width="800" height="600" />
</frame>
</gui>
</service>
<start uid="myFrame" /><!-- start the frame service -->
</object>
<!-- Frame service -->
<service uid="myFrame" type="::gui::frame::SDefaultFrame">
<gui>
<frame>
<name>tutoBasicApplicationName</name>
<icon>@BUNDLE_PREFIX@/Tuto01Basic_0-1/tuto.ico</icon>
<minSize width="800" height="600" />
</frame>
</gui>
</service>
<start uid="myFrame" /><!-- start the frame service -->
</config>
</extension>
</plugin>
The ``::fwServices::registry::AppConfig`` extension defines the configuration of an application.
The ``::fwServices::registry::AppConfig2`` extension defines the configuration of an application.

**id**:
The configuration identifier.
**config**:
Contains the list of objects and services used by the application.

For this tutorial, we have only one object ``::fwData::Image`` and one service ``::gui::frame::DefaultFrame``.

The order of the elements in the configuration is important:
* <service> tags are into <object> tags
* <start> tags are after <service> tags
For this tutorial, we have no object and only one service ``::gui::frame::DefaultFrame``.

There are others tags that will be described in the next tutorials.

Expand All @@ -132,4 +132,4 @@ To run the application, you must call the following line into the install or bui

.. code::
bin/launcher Bundles/Tuto01Basic_0-1/profile.xml
bin/fwlauncher Bundles/Tuto01Basic_0-1/profile.xml
138 changes: 76 additions & 62 deletions Tutorials/src/Tuto02DataServiceBasic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ This file describes the project information and requirements :
visuVTK # loads VTK rendering library (fwRenderVTK).
visuVTKQt # containsthe vtk Renderer window interactor manager using Qt.
vtkSimpleNegato # contains a visualization service of medical image.
launcher
appXml
fwlauncher
appXml2
)
bundleParam(appXml PARAM_LIST config PARAM_VALUES tutoDataServiceBasicConfig)
bundleParam(appXml2 PARAM_LIST config PARAM_VALUES tutoDataServiceBasicConfig)
.. note::

Expand All @@ -64,66 +63,73 @@ This file is in the ``rc/`` directory of the application. It defines the service
<plugin id="Tuto02DataServiceBasic" version="@DASH_VERSION@">
<extension implements="::fwServices::registry::AppConfig">
<!-- The bundles in requirements are automatically started when this
Application is launched. -->
<requirement id="dataReg" />
<requirement id="servicesReg" />
<requirement id="visuVTKQt" />
<extension implements="::fwServices::registry::AppConfig2">
<id>tutoDataServiceBasicConfig</id>
<config>
<!-- In tutoDataServiceBasic, the central data object is a ::fwData::Image. -->
<object type="::fwData::Image">
<!--
Description service of the GUI:
The ::gui::frame::SDefaultFrame service automatically positions the various
containers in the application main window.
Here, it declares a container for the 3D rendering service.
-->
<service uid="myFrame" impl="::gui::frame::SDefaultFrame">
<gui>
<frame>
<name>tutoDataServiceBasic</name>
<icon>Bundles/Tuto02DataServiceBasic_0-1/tuto.ico</icon>
<minSize width="800" height="600" />
</frame>
</gui>
<registry>
<!-- Associate the container for the rendering service. -->
<view sid="myRendering" />
</registry>
</service>
<!--
Reading service:
The <file> tag defines the path of the image to load. Here, it is a relative
path from the repository in which you launch the application.
-->
<service uid="myReaderPathFile" impl="::ioVTK::SImageReader">
<file>./TutoData/patient1.vtk</file>
</service>
<!--
Visualization service of a 3D medical image:
This service will render the 3D image.
-->
<service uid="myRendering" impl="::vtkSimpleNegato::SRenderer" />
<!--
Definition of the starting order of the different services:
The frame defines the 3D scene container, so it must be started first.
The services will be stopped the reverse order compared to the starting one.
-->
<start uid="myFrame" />
<start uid="myReaderPathFile" />
<start uid="myRendering" />
<!--
Definition of the service to update:
The reading service load the data on the update.
The render update must be called after the reading of the image.
-->
<update uid="myReaderPathFile" />
<update uid="myRendering" />
</object>
<object uid="imageData" type="::fwData::Image" />
<!--
Description service of the GUI:
The ::gui::frame::SDefaultFrame service automatically positions the various
containers in the application main window.
Here, it declares a container for the 3D rendering service.
-->
<service uid="mainFrame" type="::gui::frame::SDefaultFrame">
<gui>
<frame>
<name>tutoDataServiceBasic</name>
<icon>@BUNDLE_PREFIX@/Tuto02DataServiceBasic_0-1/tuto.ico</icon>
<minSize width="800" height="600" />
</frame>
</gui>
<registry>
<!-- Associate the container for the rendering service. -->
<view sid="myRendering" />
</registry>
</service>
<!--
Reading service:
The <file> tag defines the path of the image to load. Here, it is a relative
path from the repository in which you launch the application.
-->
<service uid="myReaderPathFile" type="::ioVTK::SImageReader">
<inout key="image" uid="imageData" />
<file>../../data/patient1.vtk</file>
</service>
<!--
Visualization service of a 3D medical image:
This service will render the 3D image.
-->
<service uid="myRendering" type="::vtkSimpleNegato::SRenderer">
<in key="image" uid="imageData" />
</service>
<!--
Definition of the starting order of the different services:
The frame defines the 3D scene container, so it must be started first.
The services will be stopped the reverse order compared to the starting one.
-->
<start uid="mainFrame" />
<start uid="myReaderPathFile" />
<start uid="myRendering" />
<!--
Definition of the service to update:
The reading service load the data on the update.
The render update must be called after the reading of the image.
-->
<update uid="myReaderPathFile" />
<update uid="myRendering" />
</config>
</extension>
Expand All @@ -136,8 +142,16 @@ For this tutorial, we have only one object ``::fwData::Image`` and three service
* ``::ioVTK::ImageReaderService``: reader for 3D VTK image
* ``::vtkSimpleNegato::SRenderer``: render for 3D image

The order of the elements in the configuration is important:
#. <object>
#. <service>
#. <connect> (see :ref:`tuto04`)
#. <start>
#. <update>

.. note::
To avoid the ``<start uid="myRendering" />``, the frame service can automatically start the rendering service: you just need to add the attribute ``start="yes"`` in the <view> tag.
To avoid the ``<start uid="myRendering" />``, the frame service can automatically start the rendering service: you
just need to add the attribute ``start="yes"`` in the <view> tag.

Run
----
Expand All @@ -146,4 +160,4 @@ To run the application, you must call the following line in the install or build

.. code::
bin/launcher Bundles/Tuto02DataServiceBasic_0-1/profile.xml
bin/fwlauncher Bundles/Tuto02DataServiceBasic_0-1/profile.xml

0 comments on commit e68f873

Please sign in to comment.