7 #include "uiMeasurement/SManageLandmark.hpp" 9 #include <fwCom/Signal.hpp> 10 #include <fwCom/Signal.hxx> 11 #include <fwCom/Slots.hxx> 13 #include <fwData/PointList.hpp> 14 #include <fwData/String.hpp> 16 #include <fwDataTools/fieldHelper/Image.hpp> 18 #include <fwServices/macros.hpp> 24 const ::fwServices::IService::KeyType s_LANDMARKS_INOUT =
"landmarks";
26 const ::fwCom::Slots::SlotKeyType SManageLandmark::s_CREATE_LANDMARK_SLOT =
"createLandmark";
27 const ::fwCom::Slots::SlotKeyType SManageLandmark::s_CLEAR_SLOT =
"clearPointlist";
34 newSlot(s_CREATE_LANDMARK_SLOT, &SManageLandmark::createLandmark,
this);
35 newSlot(s_CLEAR_SLOT, &SManageLandmark::clearPointlist,
this);
66 if (info.
m_eventId == ::fwDataTools::PickingInfo::Event::MOUSE_LEFT_UP &&
69 auto pointList = this->getInOut< ::fwData::PointList >(s_LANDMARKS_INOUT);
71 m_counter = pointList->getPoints().size();
75 ::fwData::String::sptr label = ::fwData::String::New(std::to_string(m_counter));
78 pointList->getPoints().push_back(point);
82 sig->asyncEmit(point);
88 void SManageLandmark::clearPointlist()
90 auto pointList = this->getInOut< ::fwData::PointList >(s_LANDMARKS_INOUT);
94 pointList->getPoints().clear();
95 ::fwData::Point::sptr
point;
98 sig->asyncEmit(point);
UIMEASUREMENT_API void stopping() override
Does nothing.
The namespace uiMeasurement contains actions to add/show/remove distances and landmarks.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_ADDED_SIG
Signal emitted when a Point is added.
UIMEASUREMENT_API void configuring() override
This method is used to configure the service.
This interface defines control service API. Does nothing particularly, can be considered as a default...
UIMEASUREMENT_API void updating() override
Does nothing.
UIMEASUREMENT_API SManageLandmark() noexcept
Constructor.
This class defines a list of points.
SManageLandmark adds a point into a pointlist on ctrl-left click.
UIMEASUREMENT_API void starting() override
This method is used to initialize the service.
virtual FWSERVICES_API void info(std::ostream &_sstream)
Write information in a stream.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_POINT_REMOVED_SIG
Signal emitted when a Point is added.