7 #include "ioData/TransformationMatrix3DReaderService.hpp" 9 #include <fwCore/base.hpp> 11 #include <fwData/location/Folder.hpp> 12 #include <fwData/location/SingleFile.hpp> 13 #include <fwData/TransformationMatrix3D.hpp> 15 #include <fwDataIO/reader/TransformationMatrix3DReader.hpp> 17 #include <fwGui/dialog/LocationDialog.hpp> 19 #include <fwIO/IReader.hpp> 21 #include <fwServices/macros.hpp> 23 #include <boost/filesystem/operations.hpp> 48 _sstream << std::endl <<
" TransformationMatrix3D object reader";
55 std::vector< std::string > extensions;
56 extensions.push_back(
".trf");
79 static ::boost::filesystem::path _sDefaultPath;
84 dialogFile.
addFilter(
"TRF files",
"*.trf");
85 dialogFile.
setOption(::fwGui::dialog::ILocationDialog::READ);
87 ::fwData::location::SingleFile::sptr result;
88 result = ::fwData::location::SingleFile::dynamicCast( dialogFile.
show() );
91 _sDefaultPath = result->getPath().parent_path();
93 this->
setFile(result->getPath());
116 ::fwData::TransformationMatrix3D::sptr matrix =
117 this->getInOut< ::fwData::TransformationMatrix3D >(::fwIO::s_DATA_KEY);
121 matrix = this->getObject< ::fwData::TransformationMatrix3D >();
125 ::fwDataIO::reader::TransformationMatrix3DReader::sptr reader =
126 ::fwDataIO::reader::TransformationMatrix3DReader::New();
127 reader->setObject( matrix );
128 reader->setFile(this->
getFile());
#define FW_DEPRECATED_KEY(newKey, access, version)
Use this macro when deprecating a service key to warn the developer.
std::string m_windowTitle
Title of the window that will open when the configureWithIHM slot is called.
Class allowing to block a Connection.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
FWIO_API bool hasLocationDefined() const
Returns if a location has been defined ( by the configuration process or directly by user ) ...
virtual FWIO_API void configuring() override
This method proposes to parse xml configuration to retrieve file/files/folder paths.
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_APIconst::boost::filesystem::path & getFile() const
Returns the file path set by the user or set during service configuration.
UpdateSlotType::sptr m_slotUpdate
Slot to call update method.
FWIO_API void setFile(const ::boost::filesystem::path &file)
Sets file path.
Reader service API. It manages extension points definition and extension configuration.
#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.
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_MODIFIED_SIG
Key in m_signals map of signal m_sigModified.
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 ...
FWIO_API void clearLocations()
Clear any location set by the setFile/setFiles/setFolder setter.
FWGUI_API void saveDefaultLocation(::fwData::location::ILocation::sptr loc) override
Save the specified default location for the dialog in preferences (if available)
virtual FWSERVICES_API void info(std::ostream &_sstream)
Write information in a stream.