7 #include "visuVTKAdaptor/SResection.hpp" 9 #include "visuVTKAdaptor/SReconstruction.hpp" 11 #include <fwData/Reconstruction.hpp> 12 #include <fwData/Resection.hpp> 14 #include <fwServices/macros.hpp> 21 const ::fwServices::IService::KeyType SResection::s_RESECTION_INPUT =
"resection";
23 SResection::SResection() noexcept :
24 m_autoResetCamera(true)
30 SResection::~SResection() noexcept
40 const ConfigType config = this->
getConfigTree().get_child(
"config.<xmlattr>");
42 this->setClippingPlanes(config.get(
"clippingplanes",
""));
44 const std::string autoresetcamera = config.get<std::string>(
"autoresetcamera",
"yes");
45 SLM_ASSERT(
"'autoresetcamera' value must be 'yes' or 'no', actual: " + autoresetcamera,
46 autoresetcamera ==
"yes" || autoresetcamera ==
"no");
47 m_autoResetCamera = (autoresetcamera ==
"yes");
64 ::fwData::Resection::csptr resec = this->getInput< ::fwData::Resection >(s_RESECTION_INPUT);
66 if (resec->getIsVisible())
68 std::vector< ::fwData::Reconstruction::sptr > vReconst;
69 bool resectionIsValid = resec->getIsValid();
70 if(resec->getIsSafePart() || resectionIsValid)
72 vReconst = resec->getOutputs();
76 vReconst = resec->getInputs();
78 for (const ::fwData::Reconstruction::sptr& resec: vReconst)
82 this->registerService< ::visuVTKAdaptor::SReconstruction>(
"::visuVTKAdaptor::SReconstruction");
83 reconstAdaptor->registerInput(resec, SReconstruction::s_RECONSTRUCTION_INPUT,
true);
91 reconstAdaptor->setClippingPlanes( m_clippingPlanes );
93 reconstAdaptor->setAutoResetCamera(m_autoResetCamera);
94 reconstAdaptor->start();
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.
virtual VISUVTKADAPTOR_API KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
FWRENDERVTK_API void setVtkPipelineModified()
End-user have to call this method when a vtk structure has been modified, thus a render request will ...
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.
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) ...
VISUVTKADAPTOR_API void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
VISUVTKADAPTOR_API void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
FWRENDERVTK_API SRender::VtkObjectIdType getTransformId() const
Returns the identifier of the transform used by this adaptor.
This service displays a ResectionDB (it launchs Reconstruction adators)
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).
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_RECONSTRUCTION_ADDED_SIG
Key in m_signals map of signal m_sigReconstructionAdded.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_VISIBILITY_MODIFIED_SIG
Key in m_signals map of signal m_sigVisibilityModified.
VISUVTKADAPTOR_API void configuring() override
Configure the service before starting. Apply the configuration to service.
VISUVTKADAPTOR_API void starting() override
Initialize the service activity.
static FWSERVICES_APIconst::fwCom::Slots::SlotKeyType s_UPDATE_SLOT
Slot to call start method.
Base class for VTK adaptors.
FWSERVICES_API ConfigType getConfigTree() const
Return the configuration, in an boost property tree.