8 #include "fwGui/builder/ISlideViewBuilder.hpp" 10 #include <boost/lexical_cast.hpp> 17 const ISlideViewBuilder::RegistryKeyType ISlideViewBuilder::REGISTRY_KEY =
"::fwGui::SlideViewBuilder";
38 SLM_ASSERT(
"Bad configuration name " + configuration->getName() +
", must be 'slideView'",
39 configuration->getName() ==
"slideView");
42 if (configuration->hasAttribute(
"align"))
44 std::string aligment = configuration->getExistingAttributeValue(
"align");
45 if (aligment ==
"top")
49 else if (aligment ==
"bottom")
53 else if (aligment ==
"right")
57 else if (aligment ==
"left")
63 SLM_FATAL(
"Wrong value '"+ aligment +
"' for 'align' attribute (require top, bottom, right or left)");
67 if (configuration->hasAttribute(
"opacity"))
69 std::string opacity = configuration->getExistingAttributeValue(
"opacity");
70 m_opacity = std::stod(opacity);
71 SLM_ASSERT(
"Opacity must be in [0 - 1]; actual: " + opacity, m_opacity >= 0. && m_opacity <= 1.);
74 if (configuration->hasAttribute(
"size"))
76 std::string size = configuration->getExistingAttributeValue(
"size");
77 m_size = std::stoi(size);
78 SLM_ASSERT(
"Size must not be negative", m_size >= 0.);
81 ::fwRuntime::ConfigurationElement::csptr styleCfg = configuration->findConfigurationElement(
"styleSheet");
84 m_styleSheet = styleCfg->getValue();
The namespace fwGui contains the base interface for IHM services.
virtual FWGUI_API::fwGui::container::fwContainer::sptr getContainer() const
Returns the builded tool bar.
virtual FWGUI_API void initialize(::fwRuntime::ConfigurationElement::sptr configuration)
Initialize the tool bar.
#define SLM_FATAL(message)
virtual FWGUI_API ~ISlideViewBuilder()
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 ISlideViewBuilder()
Constructor. Do nothing.