7 #include "uiMeasurement/action/ShowLandmark.hpp" 9 #include <fwCom/Signal.hpp> 10 #include <fwCom/Signal.hxx> 11 #include <fwCom/Slot.hpp> 12 #include <fwCom/Slot.hxx> 13 #include <fwCom/Slots.hpp> 14 #include <fwCom/Slots.hxx> 16 #include <fwCore/base.hpp> 18 #include <fwData/Boolean.hpp> 20 #include <fwDataTools/fieldHelper/Image.hpp> 21 #include <fwDataTools/fieldHelper/MedicalImageHelpers.hpp> 23 #include <fwServices/macros.hpp> 24 #include <fwServices/registry/ObjectService.hpp> 35 static const ::fwCom::Slots::SlotKeyType s_SHOW_LANDMARK_SLOT =
"showLandmark";
39 ShowLandmark::ShowLandmark( ) noexcept
41 newSlot(s_SHOW_LANDMARK_SLOT, &ShowLandmark::showLandmark,
this);
46 ShowLandmark::~ShowLandmark() noexcept
54 _sstream <<
"Action for show distance" << std::endl;
63 ::fwData::Image::sptr image = this->getObject< ::fwData::Image >();
71 ::fwData::Boolean::sptr showLandmarks = image->getField<
::fwData::Boolean >(
"ShowLandmarks", ::fwData::Boolean::New(
73 bool isShown = showLandmarks->
value();
75 bool toShow = !isShown;
76 image->setField(
"ShowLandmarks", ::fwData::Boolean::New(toShow));
78 auto services = ::fwServices::OSR::getServices < ::fwServices::IService > (image);
86 sig->asyncEmit(isShown);
95 ::fwData::Image::csptr img = this->getObject< ::fwData::Image >();
96 ::fwData::Boolean::sptr showLandmarks =
97 img->getField<
::fwData::Boolean >(
"ShowLandmarks", ::fwData::Boolean::New(
true));
105 void ShowLandmark::showLandmark(
bool)
This class is a helper to define the connections of a service and its data.
FWGUI_API void actionServiceStarting()
Method called when the action service is starting.
void starting() override
Initialize the service activity.
Class allowing to block a Connection.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
The namespace uiMeasurement contains actions to add/show/remove distances and landmarks.
UIMEASUREMENT_API void info(std::ostream &_sstream) override
Write information in a stream.
FWGUI_API void actionServiceStopping()
Method called when the action service is stopping.
#define FW_DEPRECATED_MSG(message, version)
Use this macro when deprecating a function to warn the developer.
This action allows to show/hide image landmarks.
Defines the service interface managing the menu items.
void stopping() override
Uninitialize the service activity. The stop() method is always invoked before destroying a service...
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_LANDMARK_DISPLAYED_SIG
Type of signal when image's buffer is added.
T & value() noexcept
Get the value (mutable version).
void configuring() override
Configure the service before starting. Apply the configuration to service.
virtual FWGUI_API void setIsActive(bool isActive)
Set the action service is active/inactive.
FWGUI_API void initialize()
Initialize the action.
void updating() override
Perform some computations according to object (this service is attached to) attribute values and its ...
This class defines an image.
virtual UIMEASUREMENT_API::fwServices::IService::KeyConnectionsMap getAutoConnections() const override
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
This class contains a boolean value.
UIMEASUREMENT_API void swapping() override
Swap the service from associated object to another object.