7 #include "uiVisu/action/CrossTypeAction.hpp" 9 #include <fwCom/Signal.hpp> 10 #include <fwCom/Signal.hxx> 11 #include <fwCom/Signals.hpp> 13 #include <fwCore/base.hpp> 15 #include <fwData/Float.hpp> 16 #include <fwData/Image.hpp> 18 #include <fwRuntime/ConfigurationElement.hpp> 19 #include <fwRuntime/operations.hpp> 21 #include <fwServices/IService.hpp> 22 #include <fwServices/macros.hpp> 23 #include <fwServices/op/Get.hpp> 25 #include <boost/algorithm/string.hpp> 26 #include <boost/algorithm/string/trim.hpp> 28 #include <boost/assign/list_of.hpp> 38 static const ::fwCom::Signals::SignalKeyType s_CROSS_TYPE_MODIFIED_SIG =
"crossTypeModified";
40 std::map< std::string, float >
41 CrossTypeAction::m_scaleConversion
42 = ::boost::assign::map_list_of(std::string(
"full"),1.0)
43 (std::string(
"half"),0.5)
44 (std::string(
"hide"),0.0);
48 m_sigCrossTypeModified = newSignal< CrossTypeModifiedSignalType >(s_CROSS_TYPE_MODIFIED_SIG);
82 std::vector < ConfigurationType > vectConfig = this->
m_configuration->find(
"crossType");
83 SLM_ASSERT(
"Missing <crossType> tag!", !vectConfig.empty());
84 m_crossType = vectConfig.at(0)->getValue();
85 ::boost::algorithm::trim(m_crossType);
86 ::boost::algorithm::to_lower(m_crossType);
87 SLM_ASSERT(
"Unknown crossType", m_scaleConversion.find(m_crossType) != m_scaleConversion.end());
95 m_sigCrossTypeModified->asyncEmit(m_scaleConversion[m_crossType]);
FWGUI_API void actionServiceStarting()
Method called when the action service is starting.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
virtual void starting() override
Starts action.
FWGUI_API void actionServiceStopping()
Method called when the action service is stopping.
void updating() override
Notifies message to change cross type.
UIVISU_API CrossTypeAction() noexcept
Constructor. Do nothing.
Defines the service interface managing the menu items.
The namespace uiVisu contains action to modifies cross type and 3D camera orientation.
virtual UIVISU_API ~CrossTypeAction() noexcept
Destructor. Do nothing.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
FWGUI_API void initialize()
Initialize the action.
void swapping() override
Does nothing.
::fwRuntime::ConfigurationElement::sptr m_configuration
Configuration element used to configure service internal state using a generic XML like structure TOD...
This action allows change the cross type.
virtual void info(std::ostream &_sstream) override
Write information in a stream.
void configuring() override
Configure action.
This class defines an image.
virtual void stopping() override
Stops action.