97 using Shared = QSharedPointer<FileIOFilter>;
129 Q_UNUSED(parameters);
146 Q_UNUSED(parameters);
160 bool& exclusive)
const {
199 const QString& fileFilter = QString());
229 const QString& fileFilter);
242 bool& preserveCoordinateShift,
244 bool useInputCoordinatesShiftIfPossible =
false);
252 const QString& action,
357 void checkFilterInfo()
const;
int64_t CV_CLASS_ENUM
Type of object type flags (64 bits)
CC_FILE_ERROR
Typical I/O filter errors.
@ CC_FERR_CANCELED_BY_USER
@ CC_FERR_THIRD_PARTY_LIB_FAILURE
@ CC_FERR_THIRD_PARTY_LIB_EXCEPTION
@ CC_FERR_NOT_IMPLEMENTED
@ CC_FERR_BROKEN_DEPENDENCY_ERROR
@ CC_FERR_BAD_ENTITY_TYPE
@ CC_FERR_FILE_WAS_WRITTEN_BY_UNKNOWN_PLUGIN
@ CC_FERR_NOT_ENOUGH_MEMORY
@ CC_FERR_WRONG_FILE_TYPE
bool importSupported() const
Returns whether this I/O filter can import files.
static constexpr float DEFAULT_PRIORITY
virtual ~FileIOFilter()=default
static CC_FILE_ERROR SaveToFile(ccHObject *entities, const QString &filename, const SaveParameters ¶meters, Shared filter)
void setImportExtensions(const QStringList &extensions)
QString getDefaultExtension() const
Returns the default file extension.
static void Register(Shared filter)
Registers a new filter.
static void ResetSesionCounter()
virtual bool canSave(CV_CLASS_ENUM type, bool &multiple, bool &exclusive) const
Returns whether this I/O filter can save the specified type of entity.
virtual void unregister()
Called when the filter is unregistered.
const QStringList & getFileFilters(bool onImport) const
Returns the file filter(s) for this I/O filter.
static bool CheckForSpecialChars(const QString &filename)
Returns whether special characters are present in the input string.
static const FilterContainer & GetFilters()
Returns the set of all registered filters.
virtual CC_FILE_ERROR loadFile(const QString &filename, ccHObject &container, LoadParameters ¶meters)
Loads one or more entities from a file.
bool exportSupported() const
Returns whether this I/O filter can export files.
void setImportFileFilterStrings(const QStringList &filterStrings)
static Shared FindBestFilterForExtension(const QString &ext)
Returns the best filter (presumably) to open a given file extension.
static Shared GetFilter(const QString &fileFilter, bool onImport)
Returns the filter corresponding to the given 'file filter'.
static QStringList ImportFilterList()
static void UnregisterAll()
Unregisters all filters.
static CC_FILE_ERROR SaveToFile(ccHObject *entities, const QString &filename, const SaveParameters ¶meters, const QString &fileFilter)
QSharedPointer< FileIOFilter > Shared
Shared type.
static void DisplayErrorMessage(CC_FILE_ERROR err, const QString &action, const QString &filename)
Displays (to console) the message corresponding to a given error code.
static unsigned IncreaseSesionCounter()
virtual CC_FILE_ERROR saveToFile(ccHObject *entity, const QString &filename, const SaveParameters ¶meters)
Saves an entity (or a group of) to a file.
static ccHObject * LoadFromFile(const QString &filename, LoadParameters ¶meters, Shared filter, CC_FILE_ERROR &result)
Loads one or more entities from a file with a known filter.
FileIOFilter(const FilterInfo &info)
void setExportFileFilterStrings(const QStringList &filterStrings)
static ccHObject * LoadFromFile(const QString &filename, LoadParameters ¶meters, CC_FILE_ERROR &result, const QString &fileFilter=QString())
Loads one or more entities from a file with known type.
std::vector< FileIOFilter::Shared > FilterContainer
Type of a I/O filters container.
static bool HandleGlobalShift(const CCVector3d &P, CCVector3d &Pshift, bool &preserveCoordinateShift, LoadParameters &loadParameters, bool useInputCoordinatesShiftIfPossible=false)
Shortcut to the ecvGlobalShiftManager mechanism specific for files.
Hierarchical CLOUDVIEWER Object.
Mode
Strategy to handle coordinates shift/scale.
FilterFeatures features
Supported features.
QString id
ID used to uniquely identify the filter (not user-visible)
QStringList importExtensions
QStringList importFileFilterStrings
List of file filters for import (e.g. "Test (*.txt)", "Foo (*.foo))
QString defaultExtension
The default file extension (for export)
QStringList exportFileFilterStrings
List of file filters for export (e.g. "Test (*.txt)", "Foo (*.foo))
Generic loading parameters.
CCVector3d * coordinatesShift
If applicable, applied shift on load (optional)
ecvGlobalShiftManager::Mode shiftHandlingMode
How to handle big coordinates.
QWidget * parentWidget
Parent widget (if any)
bool alwaysDisplayLoadDialog
bool sessionStart
Session start (whether the load action is the first of a session)
bool preserveShiftOnSave
If applicable, whether shift should be preserved or not (optional)
bool * coordinatesShiftEnabled
Whether shift on load has been applied after loading (optional)
LoadParameters()
Default constructor.
Generic saving parameters.
QWidget * parentWidget
Parent widget (if any)
bool alwaysDisplaySaveDialog
SaveParameters()
Default constructor.