![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Generic file I/O filter. More...
#include <FileIOFilter.h>

Classes | |
| struct | FilterInfo |
| struct | LoadParameters |
| Generic loading parameters. More... | |
| struct | SaveParameters |
| Generic saving parameters. More... | |
Public Types | |
| enum | FilterFeature { NoFeatures = 0x0000 , Import = 0x00001 , Export = 0x0002 , BuiltIn = 0x0004 , DynamicInfo = 0x0008 } |
| using | Shared = QSharedPointer< FileIOFilter > |
| Shared type. More... | |
| using | FilterContainer = std::vector< FileIOFilter::Shared > |
| Type of a I/O filters container. More... | |
Public Member Functions | |
| virtual | ~FileIOFilter ()=default |
| bool | importSupported () const |
| Returns whether this I/O filter can import files. More... | |
| bool | exportSupported () const |
| Returns whether this I/O filter can export files. More... | |
| const QStringList & | getFileFilters (bool onImport) const |
| Returns the file filter(s) for this I/O filter. More... | |
| QString | getDefaultExtension () const |
| Returns the default file extension. More... | |
| virtual CC_FILE_ERROR | loadFile (const QString &filename, ccHObject &container, LoadParameters ¶meters) |
| Loads one or more entities from a file. More... | |
| virtual CC_FILE_ERROR | saveToFile (ccHObject *entity, const QString &filename, const SaveParameters ¶meters) |
| Saves an entity (or a group of) to a file. More... | |
| 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. More... | |
| virtual void | unregister () |
| Called when the filter is unregistered. More... | |
Static Public Member Functions | |
| static QStringList | ImportFilterList () |
| 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. More... | |
| 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. More... | |
| static CC_FILE_ERROR | SaveToFile (ccHObject *entities, const QString &filename, const SaveParameters ¶meters, Shared filter) |
| static CC_FILE_ERROR | SaveToFile (ccHObject *entities, const QString &filename, const SaveParameters ¶meters, const QString &fileFilter) |
| static bool | HandleGlobalShift (const CCVector3d &P, CCVector3d &Pshift, bool &preserveCoordinateShift, LoadParameters &loadParameters, bool useInputCoordinatesShiftIfPossible=false) |
| Shortcut to the ecvGlobalShiftManager mechanism specific for files. More... | |
| static void | DisplayErrorMessage (CC_FILE_ERROR err, const QString &action, const QString &filename) |
| Displays (to console) the message corresponding to a given error code. More... | |
| static bool | CheckForSpecialChars (const QString &filename) |
| Returns whether special characters are present in the input string. More... | |
| static void | ResetSesionCounter () |
| static unsigned | IncreaseSesionCounter () |
| static void | Register (Shared filter) |
| Registers a new filter. More... | |
| static Shared | GetFilter (const QString &fileFilter, bool onImport) |
| Returns the filter corresponding to the given 'file filter'. More... | |
| static Shared | FindBestFilterForExtension (const QString &ext) |
| Returns the best filter (presumably) to open a given file extension. More... | |
| static const FilterContainer & | GetFilters () |
| Returns the set of all registered filters. More... | |
| static void | UnregisterAll () |
| Unregisters all filters. More... | |
Protected Member Functions | |
| FileIOFilter (const FilterInfo &info) | |
| void | setImportExtensions (const QStringList &extensions) |
| void | setImportFileFilterStrings (const QStringList &filterStrings) |
| void | setExportFileFilterStrings (const QStringList &filterStrings) |
Static Protected Attributes | |
| static constexpr float | DEFAULT_PRIORITY = 25.0f |
Generic file I/O filter.
Gives static access to file loader. Must be implemented by any specific I/O filter.
Definition at line 46 of file FileIOFilter.h.
| using FileIOFilter::FilterContainer = std::vector<FileIOFilter::Shared> |
Type of a I/O filters container.
Definition at line 284 of file FileIOFilter.h.
| using FileIOFilter::Shared = QSharedPointer<FileIOFilter> |
Shared type.
Definition at line 97 of file FileIOFilter.h.
| Enumerator | |
|---|---|
| NoFeatures | |
| Import | |
| Export | |
| BuiltIn | |
| DynamicInfo | |
Definition at line 299 of file FileIOFilter.h.
|
virtualdefault |
|
explicitprotected |
|
inlinevirtual |
Returns whether this I/O filter can save the specified type of entity.
| type | entity type |
| multiple | whether the filter can save multiple instances of this entity at once |
| exclusive | whether the filter can only save this type of entity if selected or if it can be mixed with other types |
Reimplemented in RDBFilter, LASFilter, LasIOFilter, LASFWFFilter, FBXFilter, E57Filter, DRCFilter, SimpleBinFilter, MascaretFilter, MAFilter, HeightProfileFilter, SinusxFilter, SalomeHydroFilter, PVFilter, PovFilter, PNFilter, VTKFilter, STLFilter, PlyFilter, OFFFilter, ObjFilter, ImageFileFilter, DxfFilter, DepthMapFileFilter, BinFilter, AsciiFilter, PcdFilter, and IoAbstractLoader.
Definition at line 158 of file FileIOFilter.h.
References type.
|
static |
Returns whether special characters are present in the input string.
Referenced by IcmFilter::LoadCalibratedImages(), IcmFilter::loadFile(), FBXFilter::loadFile(), and FBXFilter::saveToFile().
|
static |
Displays (to console) the message corresponding to a given error code.
| err | error code |
| action | "saving", "reading", etc. |
| filename | corresponding file |
| bool FileIOFilter::exportSupported | ( | ) | const |
Returns whether this I/O filter can export files.
|
static |
Returns the best filter (presumably) to open a given file extension.
Referenced by IcmFilter::loadFile(), and PovFilter::loadFile().
| QString FileIOFilter::getDefaultExtension | ( | ) | const |
Returns the default file extension.
| const QStringList& FileIOFilter::getFileFilters | ( | bool | onImport | ) | const |
Returns the file filter(s) for this I/O filter.
E.g. 'ASCII file (*.asc)'
| onImport | whether the requested filters are for import or export |
|
static |
Returns the filter corresponding to the given 'file filter'.
Referenced by CommandLoadLASFWF::process(), ccCommandLineParser::saveClouds(), and ccCommandLineParser::saveMeshes().
|
static |
Returns the set of all registered filters.
Referenced by define_qcc_io(), and CommandChangeOutputFormat::getFileFormatFilter().
|
static |
Shortcut to the ecvGlobalShiftManager mechanism specific for files.
| [in] | P | sample point (typically the first loaded) |
| [out] | Pshift | global shift |
| [out] | preserveCoordinateShift | whether shift sould be preserved on save |
| [in] | loadParameters | loading parameters |
| [in] | useInputCoordinatesShiftIfPossible | whether to use the input 'PShift' vector if possible |
Referenced by FromFbxMesh(), GetGlobalShift(), LoadCloud(), SalomeHydroFilter::loadFile(), SinusxFilter::loadFile(), SimpleBinFilter::loadFile(), LASFWFFilter::loadFile(), LASFilter::loadFile(), and LoadScan().
|
static |
Get a list of all the available importer filter strings for use in a drop down menu. Includes "All (*.)" as the first item in the list.
| bool FileIOFilter::importSupported | ( | ) | const |
Returns whether this I/O filter can import files.
|
static |
Indicates to the I/O filters that a new loading/saving action has started
|
inlinevirtual |
Loads one or more entities from a file.
This method must be implemented by children classes.
| filename | file to load |
| container | container to store loaded entities |
| parameters | generic loading parameters |
Reimplemented in IoAbstractLoader, STEPFilter, RDBFilter, LASFilter, LasIOFilter, LASFWFFilter, FBXFilter, E57Filter, DRCFilter, SimpleBinFilter, PDMSFilter, SoiFilter, SinusxFilter, SalomeHydroFilter, PVFilter, PovFilter, PNFilter, IcmFilter, BundlerFilter, VTKFilter, STLFilter, PTXFilter, PlyFilter, OFFFilter, ObjFilter, ImageFileFilter, DxfFilter, BinFilter, AsciiFilter, PcdFilter, PhotoScanFilter, and CSVMatrixFilter.
Definition at line 124 of file FileIOFilter.h.
References CC_FERR_NOT_IMPLEMENTED, and filename.
|
static |
Loads one or more entities from a file with known type.
Shortcut to the other version of FileIOFilter::LoadFromFile
| filename | filename | |
| parameters | generic loading parameters | |
| [out] | result | file error code |
| fileFilter | input filter 'file filter' (if empty, the best I/O filter will be guessed from the file extension) |
|
static |
Loads one or more entities from a file with a known filter.
Shortcut to FileIOFilter::loadFile
| filename | filename | |
| parameters | generic loading parameters | |
| filter | input filter | |
| [out] | result | file error code |
Referenced by MainWindow::addToDB(), define_qcc_io(), JsonRPCPlugin::execute(), ccCommandLineParser::importFile(), ccGuiPythonInstance::loadFile(), PhotoScanFilter::loadFile(), IcmFilter::loadFile(), PovFilter::loadFile(), MainWindow::loadFile(), and ReadCloud().
|
static |
Registers a new filter.
|
static |
Indicates to the I/O filters that a new loading/saving session has started (for "Apply all" buttons for instance)
Referenced by MainWindow::addToDB(), and masc::Tools::LoadFile().
|
static |
Saves an entity (or a group of) to a specific file thanks to a given filter Shortcut to the other version of FileIOFilter::SaveToFile
| entities | entity to save (can be a group of other entities) |
| filename | filename |
| parameters | saving parameters |
| fileFilter | output filter 'file filter' |
|
static |
Saves an entity (or a group of) to a specific file thanks to a given filter Shortcut to FileIOFilter::saveFile
| entities | entity to save (can be a group of other entities) |
| filename | filename |
| parameters | saving parameters |
| filter | output filter |
Referenced by define_qcc_io(), ccCommandLineParser::exportEntity(), and PovFilter::saveToFile().
|
inlinevirtual |
Saves an entity (or a group of) to a file.
This method must be implemented by children classes.
| entity | entity (or group of) to save |
| filename | filename |
| parameters | generic saving parameters |
Reimplemented in LASFilter, LasIOFilter, LASFWFFilter, FBXFilter, E57Filter, DRCFilter, SimpleBinFilter, MascaretFilter, MAFilter, HeightProfileFilter, SinusxFilter, SalomeHydroFilter, PVFilter, PovFilter, PNFilter, VTKFilter, STLFilter, PlyFilter, OFFFilter, ObjFilter, ImageFileFilter, DxfFilter, DepthMapFileFilter, BinFilter, AsciiFilter, and PcdFilter.
Definition at line 141 of file FileIOFilter.h.
References CC_FERR_NOT_IMPLEMENTED, and filename.
|
protected |
Allow export filter strings to be set after construction (e.g. for ImageFileFilter & QImageReader::supportedImageFormats())
|
protected |
Allow import extensions to be set after construction (e.g. for ImageFileFilter & QImageReader::supportedImageFormats())
|
protected |
Allow import filter strings to be set after construction (e.g. for ImageFileFilter & QImageReader::supportedImageFormats())
|
inlinevirtual |
Called when the filter is unregistered.
Does nothing by default
Definition at line 296 of file FileIOFilter.h.
|
static |
|
staticconstexprprotected |
Definition at line 313 of file FileIOFilter.h.
Referenced by Assimp3DMax::Assimp3DMax(), AssimpBlender::AssimpBlender(), AssimpCollada::AssimpCollada(), AssimpCommonFilter::AssimpCommonFilter(), AssimpGltf::AssimpGltf(), AssimpIfc::AssimpIfc(), BundlerFilter::BundlerFilter(), CSVMatrixFilter::CSVMatrixFilter(), IcmFilter::IcmFilter(), LASFilter::LASFilter(), MAFilter::MAFilter(), MascaretFilter::MascaretFilter(), PDMSFilter::PDMSFilter(), PNFilter::PNFilter(), PovFilter::PovFilter(), PVFilter::PVFilter(), RDBFilter::RDBFilter(), SalomeHydroFilter::SalomeHydroFilter(), SinusxFilter::SinusxFilter(), SoiFilter::SoiFilter(), and STEPFilter::STEPFilter().