7 #include "visuVTKAdaptor/SResectionDB.hpp" 9 #include "visuVTKAdaptor/SResection.hpp" 11 #include <fwData/Resection.hpp> 12 #include <fwData/ResectionDB.hpp> 14 #include <fwServices/macros.hpp> 21 static const ::fwServices::IService::KeyType s_RESECTIONDB_INPUT =
"resectionDB";
25 SResectionDB::SResectionDB() noexcept
31 SResectionDB::~SResectionDB() noexcept
41 const ConfigType config = this->
getConfigTree().get_child(
"config.<xmlattr>");
43 this->setClippingPlanes(config.get(
"clippingplanes",
""));
45 const std::string autoresetcamera = config.get<std::string>(
"autoresetcamera",
"yes");
46 SLM_ASSERT(
"'autoresetcamera' value must be 'yes' or 'no', actual: " + autoresetcamera,
47 autoresetcamera ==
"yes" || autoresetcamera ==
"no");
48 m_autoResetCamera = (autoresetcamera ==
"yes");
65 ::fwData::ResectionDB::csptr resecDB = this->getInput< ::fwData::ResectionDB >(s_RESECTIONDB_INPUT);
67 for( const ::fwData::Resection::sptr& resection : resecDB->getResections())
70 auto resecSrv = this->registerService< ::visuVTKAdaptor::SResection>(
"::visuVTKAdaptor::SResection");
71 resecSrv->registerInput(resection, SResection::s_RESECTION_INPUT,
true);
78 resecSrv->setClippingPlanes( m_clippingPlanes );
79 resecSrv->setAutoResetCamera(m_autoResetCamera);
85 ::fwData::Resection::sptr resec = resecDB->getSafeResection();
89 auto service = this->registerService< ::visuVTKAdaptor::SResection>(
"::visuVTKAdaptor::SResection");
90 service->registerInput(resec, SResection::s_RESECTION_INPUT,
true);
96 service->setAutoResetCamera(m_autoResetCamera);
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_SAFE_PART_ADDED_SIG
Key in m_signals map of signal m_sigSafePartAdded.
virtual VISUVTKADAPTOR_API KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
This class is a helper to define the connections of a service and its data.
The namespace visuVTKAdaptor contains the list of adaptors available for the generic scene...
FWRENDERVTK_API void configureParams()
Parse the xml configuration for renderer, picker and transform.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_RESECTION_ADDED_SIG
Key in m_signals map of signal m_sigResectionAdded.
FWRENDERVTK_API SRender::sptr getRenderService() const
Returd the associated render service.
FWRENDERVTK_API SRender::PickerIdType getPickerId() const
Gets the identifier of the picker used by this adaptor.
VISUVTKADAPTOR_API void starting() override
Initialize the service activity.
FWSERVICES_API void unregisterServices(const std::string &_implType="")
Unregister all services linked to this service, optionally matches only a given type of services...
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
FWRENDERVTK_API SRender::VtkObjectIdType getTransformId() const
Returns the identifier of the transform used by this adaptor.
VISUVTKADAPTOR_API void configuring() override
Configure the service before starting. Apply the configuration to service.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_MODIFIED_SIG
Key in m_signals map of signal m_sigModified.
FWRENDERVTK_API SRender::RendererIdType getRendererId() const
Returns the renderer identifier.
FWRENDERVTK_API void initialize()
Initialize the adaptor with the associated render service. (must be call in starting).
This service displays a ResectionDB (it launchs Resection adators)
VISUVTKADAPTOR_API void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_SLOT
Slot to call start method.
Base class for VTK adaptors.
VISUVTKADAPTOR_API void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
FWSERVICES_API ConfigType getConfigTree() const
Return the configuration, in an boost property tree.