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


Public Member Functions | |
| ObjFilter () | |
| virtual CC_FILE_ERROR | loadFile (const QString &filename, ccHObject &container, LoadParameters ¶meters) override |
| Loads one or more entities from a file. More... | |
| virtual 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... | |
| virtual CC_FILE_ERROR | saveToFile (ccHObject *entity, const QString &filename, const SaveParameters ¶meters) 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 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 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 |
Wavefront meshes file I/O filter.
Definition at line 13 of file ObjFilter.h.
| ObjFilter::ObjFilter | ( | ) |
Definition at line 42 of file ObjFilter.cpp.
References FileIOFilter::Export, and FileIOFilter::Import.
|
overridevirtual |
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 from FileIOFilter.
Definition at line 48 of file ObjFilter.cpp.
References CV_TYPES::MESH, and type.
|
overridevirtual |
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 |
*** shading group ***/
Reimplemented from FileIOFilter.
Definition at line 422 of file ObjFilter.cpp.
References ccHObject::addChild(), ccArray< Type, N, ComponentType >::addElement(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), ccMesh::addTriangle(), ccSubMesh::addTriangleIndex(), ccMesh::addTriangleMtlIndex(), ccMesh::addTriangleNormalIndexes(), ccMesh::addTriangleTexCoordIndexes(), cloudViewer::PointCloudTpl< T >::capacity(), ccMesh::capacity(), QtCompatRegExpOption::CaseInsensitive, CC_FERR_CANCELED_BY_USER, CC_FERR_MALFORMED_FILE, CC_FERR_NO_ERROR, CC_FERR_NOT_ENOUGH_MEMORY, CC_FERR_READING, ccArray< Type, N, ComponentType >::currentSize(), CVLog::Error(), filename, ccMaterialSet::findMaterialByName(), Vector3Tpl< PointCoordinateType >::fromArray(), ccHObject::getChildrenNumber(), ccNormalVectors::GetNormIndex(), cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::Delaunay2dMesh::getTriangleVertIndexesArray(), FileIOFilter::HandleGlobalShift(), CCShareable::link(), ccGenericMesh::materialsShown(), name, facetElement::nIndex, Vector3Tpl< Type >::norm2(), Vector3Tpl< Type >::normalize(), normals, ccMesh::normalsShown(), FileIOFilter::LoadParameters::parentWidget, ccMaterialSet::ParseMTL(), CVLog::Print(), CVLog::PrintVerbose(), qtCompatSplitRegex(), CCShareable::release(), ccSubMesh::reserve(), ccMesh::reserve(), cloudViewer::ReferenceCloud::reserve(), cloudViewer::PointCloudTpl< T >::reserve(), ccPointCloud::reserve(), ccMesh::reservePerTriangleMtlIndexes(), ccMesh::reservePerTriangleNormalIndexes(), ccMesh::reservePerTriangleTexCoordIndexes(), ccArray< Type, N, ComponentType >::reserveSafe(), ccObject::setEnabled(), ccShiftedObject::setGlobalShift(), ccObject::setLocked(), ccMesh::setMaterialSet(), ccObject::setMetaData(), ccObject::setName(), ccPointCloud::setNormsTable(), ccMesh::setTexCoordinatesTable(), ccMesh::setTriNormsTable(), ccDrawableObject::setVisible(), ccGenericMesh::showMaterials(), ccGenericMesh::showNormals(), ccGenericMesh::showTriNorms(), ccMesh::shrinkToFit(), ccPointCloud::shrinkToFit(), cloudViewer::Delaunay2dMesh::size(), cloudViewer::PointCloudTpl< T >::size(), ccChunk::SIZE, ccMesh::size(), QtCompat::SkipEmptyParts, ccPolyline::split(), std::swap(), facetElement::tcIndex, cloudViewer::Delaunay2dMesh::TesselateContour(), ccGenericMesh::triNormsShown(), TexCoords2D::ty, Tuple3Tpl< Type >::u, UpdatePointIndex(), facetElement::vIndex, CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
overridevirtual |
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 from FileIOFilter.
Definition at line 59 of file ObjFilter.cpp.
References CC_FERR_BAD_ARGUMENT, CC_FERR_BAD_ENTITY_TYPE, CC_FERR_CANCELED_BY_USER, CC_FERR_NO_ERROR, CC_FERR_NO_SAVE, CC_FERR_WRITING, FileIO::createdBy(), FileIO::createdDateTime(), ccArray< Type, N, ComponentType >::currentSize(), QtCompat::endl(), filename, ccHObject::filterChildren(), ccGenericMesh::getAssociatedCloud(), ccGenericMesh::getMaterialSet(), ccObject::getName(), cloudViewer::GenericIndexedMesh::getNextTriangleVertIndexes(), ccNormalVectors::GetNormal(), cloudViewer::GenericIndexedCloud::getPoint(), ccGenericPointCloud::getPointNormal(), ccGenericMesh::getTexCoordinatesTable(), ccGenericMesh::getTriangleMtlIndex(), ccGenericMesh::getTriangleNormalIndexes(), ccGenericMesh::getTriangleTexCoordinatesIndexes(), ccGenericMesh::getTriNormsTable(), ccArray< Type, N, ComponentType >::getValue(), ccGenericMesh::hasMaterials(), ccDrawableObject::hasNormals(), ccGenericMesh::hasPerTriangleTexCoordIndexes(), ccGenericMesh::hasTriNormals(), cloudViewer::VerticesIndexes::i1, cloudViewer::VerticesIndexes::i2, cloudViewer::VerticesIndexes::i3, ccObject::isKindOf(), ccShiftedObject::isShifted(), CV_TYPES::MESH, cloudViewer::NormalizedProgress::oneStep(), FileIOFilter::SaveParameters::parentWidget, cloudViewer::GenericMesh::placeIteratorAtBeginning(), cloudViewer::NormalizedProgress::reset(), ccMaterialSet::saveAsMTL(), cloudViewer::NormalizedProgress::scale(), cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), size, ccSubMesh::size(), CV_TYPES::SUB_MESH, ccHObjectCaster::ToGenericMesh(), ccShiftedObject::toGlobal3d(), TexCoords2D::tx, TexCoords2D::ty, CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.