7 #include "Tuto02DataServiceBasicCtrl/Plugin.hpp" 9 #include <fwRuntime/operations.hpp> 10 #include <fwRuntime/utils/GenericExecutableFactoryRegistrar.hpp> 12 #include <fwServices/op/Add.hpp> 13 #include <fwServices/registry/ObjectService.hpp> 18 static ::fwRuntime::utils::GenericExecutableFactoryRegistrar<Plugin> registrar(
"::Tuto02DataServiceBasicCtrl::Plugin");
43 m_image = ::fwData::Image::New();
46 m_readerSrv = ::fwServices::add(
"::ioVTK::SImageReader");
47 m_readerSrv->registerInOut(m_image,
"data");
49 ::fwServices::IService::ConfigType readerCfg;
50 readerCfg.put(
"file",
"../../data/patient1.vtk");
51 m_readerSrv->setConfiguration( readerCfg );
52 m_readerSrv->configure();
55 m_renderSrv = ::fwServices::add(
"::vtkSimpleNegato::SRenderer");
56 m_renderSrv->registerInput(m_image,
"image");
57 m_renderSrv->setID(
"myRenderingTuto" );
58 m_renderSrv->configure();
61 m_frameSrv = ::fwServices::add(
"::gui::frame::SDefaultFrame");
64 ::fwServices::IService::ConfigType frameConfig;
65 frameConfig.put(
"gui.frame.name",
"tutoDataServiceBasicCtrl");
66 frameConfig.put(
"gui.frame.icon",
"Tuto02DataServiceBasicCtrl-0.1/tuto.ico");
67 frameConfig.put(
"gui.frame.minSize.<xmlattr>.width",
"800");
68 frameConfig.put(
"gui.frame.minSize.<xmlattr>.height",
"600");
70 frameConfig.put(
"registry.view.<xmlattr>.sid",
"myRenderingTuto");
72 m_frameSrv->setConfiguration( frameConfig );
73 m_frameSrv->configure();
81 m_readerSrv->update();
82 m_renderSrv->update();
101 ::fwServices::OSR::unregisterService( m_readerSrv );
102 ::fwServices::OSR::unregisterService( m_frameSrv );
103 ::fwServices::OSR::unregisterService( m_renderSrv );
TUTO02DATASERVICEBASICCTRL_API void uninitialize() noexcept
Notifies the plugin about its uninitialisation.
TUTO02DATASERVICEBASICCTRL_API void start()
Overrides start method. .
TUTO02DATASERVICEBASICCTRL_API void initialize()
Notifies the plugin about its initialisation.
TUTO02DATASERVICEBASICCTRL_API void stop() noexcept
Overrides stop method. Do nothing.
TUTO02DATASERVICEBASICCTRL_API Plugin() noexcept
Constructor.
TUTO02DATASERVICEBASICCTRL_API ~Plugin() noexcept
Destructor. Do nothing.