ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
E57Filter Class Reference

E57 filter (relies on E57format lib) More...

#include <E57Filter.h>

Inheritance diagram for E57Filter:
Collaboration diagram for E57Filter:

Public Member Functions

 E57Filter ()
 
CC_FILE_ERROR loadFile (const QString &filename, ccHObject &container, LoadParameters &parameters) override
 Loads one or more entities from a file. More...
 
bool canSave (CV_CLASS_ENUM type, bool &multiple, bool &exclusive) const override
 Returns whether this I/O filter can save the specified type of entity. More...
 
CC_FILE_ERROR saveToFile (ccHObject *entity, const QString &filename, const SaveParameters &parameters) override
 Saves an entity (or a group of) to a file. More...
 
- Public Member Functions inherited from FileIOFilter
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 void unregister ()
 Called when the filter is unregistered. More...
 

Additional Inherited Members

- Public Types inherited from FileIOFilter
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...
 
- Static Public Member Functions inherited from FileIOFilter
static QStringList ImportFilterList ()
 
static ccHObjectLoadFromFile (const QString &filename, LoadParameters &parameters, Shared filter, CC_FILE_ERROR &result)
 Loads one or more entities from a file with a known filter. More...
 
static ccHObjectLoadFromFile (const QString &filename, LoadParameters &parameters, 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 &parameters, Shared filter)
 
static CC_FILE_ERROR SaveToFile (ccHObject *entities, const QString &filename, const SaveParameters &parameters, 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 FilterContainerGetFilters ()
 Returns the set of all registered filters. More...
 
static void UnregisterAll ()
 Unregisters all filters. More...
 
- Protected Member Functions inherited from FileIOFilter
 FileIOFilter (const FilterInfo &info)
 
void setImportExtensions (const QStringList &extensions)
 
void setImportFileFilterStrings (const QStringList &filterStrings)
 
void setExportFileFilterStrings (const QStringList &filterStrings)
 
- Static Protected Attributes inherited from FileIOFilter
static constexpr float DEFAULT_PRIORITY = 25.0f
 

Detailed Description

E57 filter (relies on E57format lib)

Definition at line 14 of file E57Filter.h.

Constructor & Destructor Documentation

◆ E57Filter()

E57Filter::E57Filter ( )

Definition at line 83 of file E57Filter.cpp.

References FileIOFilter::Export, and FileIOFilter::Import.

Member Function Documentation

◆ canSave()

bool E57Filter::canSave ( CV_CLASS_ENUM  type,
bool &  multiple,
bool &  exclusive 
) const
overridevirtual

Returns whether this I/O filter can save the specified type of entity.

Parameters
typeentity type
multiplewhether the filter can save multiple instances of this entity at once
exclusivewhether the filter can only save this type of entity if selected or if it can be mixed with other types
Returns
whether the entity type can be saved

Reimplemented from FileIOFilter.

Definition at line 89 of file E57Filter.cpp.

References CV_TYPES::POINT_CLOUD, and type.

◆ loadFile()

CC_FILE_ERROR E57Filter::loadFile ( const QString &  filename,
ccHObject container,
LoadParameters parameters 
)
overridevirtual

◆ saveToFile()

CC_FILE_ERROR E57Filter::saveToFile ( ccHObject entity,
const QString &  filename,
const SaveParameters parameters 
)
overridevirtual

Saves an entity (or a group of) to a file.

This method must be implemented by children classes.

Parameters
entityentity (or group of) to save
filenamefilename
parametersgeneric saving parameters
Returns
error

We are using the E57 v1.0 data format standard fieldnames. The standard fieldnames are used without an extension prefix (in the default namespace). We explicitly register it for completeness (the reference implementaion would do it for us, if we didn't).

Path names: "/formatName", "/majorVersion", "/minorVersion", "/coordinateMetadata"

Really should be a valid WKT string identifying the coordinate reference system (CRS).

Path name: "/creationDateTime

Reimplemented from FileIOFilter.

Definition at line 718 of file E57Filter.cpp.

References CC_FERR_CANCELED_BY_USER, CC_FERR_NO_ERROR, CC_FERR_NO_SAVE, CC_FERR_THIRD_PARTY_LIB_EXCEPTION, CC_FERR_WRITING, e57::ImageFile::close(), e57::E57Exception::context(), e57::E57_V1_0_URI, e57::E57Exception::errorCode(), e57::Utilities::errorCodeToString(), e57::ImageFile::extensionsAdd(), filename, ccHObject::filterChildren(), ccHObject::getChild(), ccHObject::getChildrenNumber(), e57::Utilities::getVersions(), CV_TYPES::IMAGE, ccObject::isA(), e57::ImageFile::isOpen(), cloudViewer::NormalizedProgress::oneStep(), FileIOFilter::SaveParameters::parentWidget, CV_TYPES::POINT_CLOUD, result, e57::ImageFile::root(), SaveImage(), SaveScan(), e57::StructureNode::set(), e57::E57Exception::sourceFileName(), e57::E57Exception::sourceLineNumber(), and CVLog::Warning().


The documentation for this class was generated from the following files: