7 #include "ioData/TransformationMatrix3DWriterService.hpp" 9 #include <fwCom/Signal.hpp> 10 #include <fwCom/Signal.hxx> 12 #include <fwCore/base.hpp> 14 #include <fwData/location/Folder.hpp> 15 #include <fwData/location/SingleFile.hpp> 16 #include <fwData/TransformationMatrix3D.hpp> 18 #include <fwDataIO/writer/TransformationMatrix3DWriter.hpp> 20 #include <fwGui/dialog/LocationDialog.hpp> 22 #include <fwServices/macros.hpp> 24 #include <boost/filesystem/operations.hpp> 42 _sstream << std::endl <<
" TransformationMatrix3D object writer";
71 static ::boost::filesystem::path _sDefaultPath(
"");
76 dialogFile.
addFilter(
"TRF files",
"*.trf");
77 dialogFile.
setOption(::fwGui::dialog::ILocationDialog::WRITE);
79 ::fwData::location::SingleFile::sptr result;
80 result = ::fwData::location::SingleFile::dynamicCast( dialogFile.
show() );
83 _sDefaultPath = result->getPath().parent_path();
85 this->
setFile(result->getPath());
109 ::fwData::TransformationMatrix3D::csptr matrix =
110 this->getInput< ::fwData::TransformationMatrix3D >(::fwIO::s_DATA_KEY);
114 matrix = this->getObject< ::fwData::TransformationMatrix3D >();
118 ::fwDataIO::writer::TransformationMatrix3DWriter::sptr writer =
119 ::fwDataIO::writer::TransformationMatrix3DWriter::New();
120 writer->setObject( matrix );
121 writer->setFile(this->
getFile());
#define FW_DEPRECATED_KEY(newKey, access, version)
Use this macro when deprecating a service key to warn the developer.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
virtual FWGUI_API void setDefaultLocation(::fwData::location::ILocation::sptr loc) override
Set the initial location for the dialog.
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.
FWGUI_API void addFilter(const std::string &filterName, const std::string &wildcardList) override
specify some filtering when browsing files:
FWIO_API void setFile(const ::boost::filesystem::path &file)
Sets file path.
virtual FWIO_API void configuring() override
This method proposes to parse xml configuration to retrieve file/files/folder paths.
FWIO_APIconst::boost::filesystem::path & getFile() const
Returns the file path set by the user or set during service configuration.
FWIO_API void clearLocations()
Clear any location set by the setFile/setFiles/setFolder setter.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
IOPathType
IOPathType defines different type of paths used by service readers/writers.
Writer service API. It manages extension points definition and extension configuration.
FWGUI_API void setTitle(const std::string &title) override
Set the title for the dialog.
Defines the generic file/folder selector dialog for IHM.
The namespace ioData contains reader and writer services for basic fwData::Object which doesn't need ...
FWGUI_API void saveDefaultLocation(::fwData::location::ILocation::sptr loc) override
Save the specified default location for the dialog in preferences (if available)
FWIO_API bool hasLocationDefined() const
Returns if a location has been defined ( by the configuration process or directly by user ) ...
virtual FWSERVICES_API void info(std::ostream &_sstream)
Write information in a stream.
std::string m_windowTitle
Title of the window that will open when the configureWithIHM slot is called.