7 #include <fwCom/Signal.hpp> 8 #include <fwCom/Signal.hxx> 10 #include <fwCore/base.hpp> 12 #include <fwData/location/SingleFile.hpp> 14 #include <fwRuntime/ConfigurationElement.hpp> 15 #include <fwRuntime/operations.hpp> 17 #include <fwServices/macros.hpp> 19 #include <fwGui/dialog/LocationDialog.hpp> 21 #include "uiVisu/action/SSnapshot.hpp" 28 const ::fwCom::Signals::SignalKeyType SSnapshot::s_SNAPPED_SIG =
"snapped";
35 m_sigSnapped = newSignal< SnappedSignalType >(s_SNAPPED_SIG);
69 std::string filename = this->requestFileName();
73 m_sigSnapped->asyncEmit(filename);
92 std::string SSnapshot::requestFileName()
94 std::string fileName =
"";
97 dialogFile.
setTitle(
"Save snapshot as");
98 dialogFile.
addFilter(
"Image file",
"*.jpg *.jpeg *.bmp *.png *.tiff");
99 dialogFile.
addFilter(
"jpeg",
"*.jpg *.jpeg");
104 dialogFile.
setOption(::fwGui::dialog::ILocationDialog::WRITE);
106 ::fwData::location::SingleFile::sptr result;
107 result = ::fwData::location::SingleFile::dynamicCast( dialogFile.
show() );
110 fileName = result->getPath().string();
FWGUI_API void actionServiceStarting()
Method called when the action service is starting.
virtual void info(std::ostream &_sstream) override
Write information in a stream.
virtual void stopping() override
Stops action.
FWGUI_API void actionServiceStopping()
Method called when the action service is stopping.
FWGUI_API::fwGui::dialog::ILocationDialog & setOption(::fwGui::dialog::ILocationDialog::Options option) override
allow to set option to the file dialog mode=READ/WRITE, check=FILE_MUST_EXIST
FWGUI_API::fwData::location::ILocation::sptr show() override
Display the dialog.
void updating() override
Show a file dialog and notify the scene which must be printed.
FWGUI_API void addFilter(const std::string &filterName, const std::string &wildcardList) override
specify some filtering when browsing files:
Defines the service interface managing the menu items.
void swapping() override
Does nothing.
The namespace uiVisu contains action to modifies cross type and 3D camera orientation.
virtual UIVISU_API ~SSnapshot() noexcept
Destructor. Do nothing.
virtual void starting() override
Starts action.
FWGUI_API void initialize()
Initialize the action.
Base class for each data object.
This action allows to snapshot a generic scene.
FWGUI_API void setTitle(const std::string &title) override
Set the title for the dialog.
Defines the generic file/folder selector dialog for IHM.
UIVISU_API SSnapshot() noexcept
Constructor. Do nothing.
void configuring() override
Configure action.