![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Command line parser. More...
#include <ecvCommandLineParser.h>


Public Member Functions | |
| ~ccCommandLineParser () override | |
| Destructor. More... | |
| QString | getExportFilename (const CLEntityDesc &entityDesc, QString extension=QString(), QString suffix=QString(), QString *baseOutputFilename=nullptr, bool forceNoTimestamp=false) const override |
| Returns the name of a to-be-exported entity. More... | |
| QString | exportEntity (CLEntityDesc &entityDesc, const QString &suffix=QString(), QString *baseOutputFilename=nullptr, ccCommandLineInterface::ExportOptions options=ExportOption::NoOptions) override |
| Exports a cloud or a mesh. More... | |
| void | removeClouds (bool onlyLast=false) override |
| Removes all clouds (or only the last one ;) More... | |
| void | removeMeshes (bool onlyLast=false) override |
| Removes all meshes (or only the last one ;) More... | |
| QStringList & | arguments () override |
| Returns the list of arguments. More... | |
| const QStringList & | arguments () const override |
| Returns the list of arguments (const version) More... | |
| bool | registerCommand (Command::Shared command) override |
| QDialog * | widgetParent () override |
| Returns a (widget) parent (if any is available) More... | |
| void | print (const QString &message) const override |
| void | warning (const QString &message) const override |
| bool | error (const QString &message) const override |
| bool | saveClouds (QString suffix=QString(), bool allAtOnce=false, const QString *allAtOnceFileName=nullptr) override |
| Saves all clouds. More... | |
| bool | saveMeshes (QString suffix=QString(), bool allAtOnce=false, const QString *allAtOnceFileName=nullptr) override |
| Saves all meshes. More... | |
| bool | importFile (QString filename, const GlobalShiftOptions &globalShiftOptions, FileIOFilter::Shared filter=FileIOFilter::Shared(nullptr)) override |
| Loads a file with a specific filter. More... | |
| QString | cloudExportFormat () const override |
| Returns the current cloud(s) export format. More... | |
| QString | cloudExportExt () const override |
| Returns the current cloud(s) export extension (warning: can be anything) More... | |
| QString | meshExportFormat () const override |
| Returns the current mesh(es) export format. More... | |
| QString | meshExportExt () const override |
| Returns the current mesh(es) export extension (warning: can be anything) More... | |
| QString | hierarchyExportFormat () const override |
| Returns the current hierarchy(ies) export format. More... | |
| QString | hierarchyExportExt () const override |
| void | setCloudExportFormat (QString format, QString ext) override |
| Sets the current cloud(s) export format and extension. More... | |
| void | setMeshExportFormat (QString format, QString ext) override |
| Sets the current mesh(es) export format and extension. More... | |
| void | setHierarchyExportFormat (QString format, QString ext) override |
| Sets the current hierarchy(ies) export format and extension. More... | |
Public Member Functions inherited from ccCommandLineInterface | |
| ccCommandLineInterface () | |
| Default constructor. More... | |
| virtual | ~ccCommandLineInterface ()=default |
| virtual bool | registerCommand (Command::Shared command)=0 |
| Registers a new command. More... | |
| virtual ecvProgressDialog * | progressDialog () |
| Returns a (shared) progress dialog (if any is available) More... | |
| virtual CLLoadParameters & | fileLoadingParams () |
| File loading parameters. More... | |
| virtual std::vector< CLCloudDesc > & | clouds () |
| Currently opened point clouds and their filename. More... | |
| virtual const std::vector< CLCloudDesc > & | clouds () const |
| Currently opened point clouds and their filename (const version) More... | |
| virtual std::vector< CLMeshDesc > & | meshes () |
| Currently opened meshes and their filename. More... | |
| virtual const std::vector< CLMeshDesc > & | meshes () const |
| Currently opened meshes and their filename (const version) More... | |
| void | toggleSilentMode (bool state) |
| Toggles silent mode. More... | |
| bool | silentMode () const |
| Returns the silent mode. More... | |
| void | toggleAutoSaveMode (bool state) |
| bool | autoSaveMode () const |
| void | toggleAddTimestamp (bool state) |
| bool | addTimestamp () const |
| void | setNumericalPrecision (int p) |
| Sets the numerical precision. More... | |
| int | numericalPrecision () const |
| Returns the numerical precision. More... | |
| bool | nextCommandIsGlobalShift () const |
| Returns whether the nex command is the '-GLOBAL_SHIFT' option. More... | |
| bool | processGlobalShiftCommand (GlobalShiftOptions &options) |
Static Public Member Functions | |
| static int | Parse (int nargs, char **args, ccPluginInterfaceList &plugins) |
| Parses the input command. More... | |
Static Public Member Functions inherited from ccCommandLineInterface | |
| static bool | IsCommand (const QString &token, const char *command) |
| Test whether a command line token is a valid command keyword or not. More... | |
Protected Member Functions | |
| ccCommandLineParser () | |
| Default constructor. More... | |
| void | registerBuiltInCommands () |
| void | cleanup () |
| int | start (QDialog *parent=0) |
| Parses the command line. More... | |
Additional Inherited Members | |
Public Types inherited from ccCommandLineInterface | |
| enum class | ExportOption { NoOptions = 0x0 , ForceCloud = 0x1 , ForceMesh = 0x2 , ForceHierarchy = 0x4 , ForceNoTimestamp = 0x8 } |
Protected Attributes inherited from ccCommandLineInterface | |
| std::vector< CLCloudDesc > | m_clouds |
| Currently opened point clouds and their filename. More... | |
| std::vector< CLMeshDesc > | m_meshes |
| Currently opened meshes and their filename. More... | |
| bool | m_silentMode |
| Silent mode. More... | |
| bool | m_autoSaveMode |
| Whether files should be automatically saved (after each process) or not. More... | |
| bool | m_addTimestamp |
| Whether a timestamp should be automatically added to output files or not. More... | |
| int | m_precision |
| Default numerical precision for ASCII output. More... | |
| CLLoadParameters | m_loadingParameters |
| File loading parameters. More... | |
Command line parser.
Definition at line 20 of file ecvCommandLineParser.h.
|
override |
Destructor.
Definition at line 147 of file ecvCommandLineParser.cpp.
|
protected |
Default constructor.
Shouldn't be called by user.
Definition at line 135 of file ecvCommandLineParser.cpp.
|
inlineoverridevirtual |
Returns the list of arguments (const version)
Implements ccCommandLineInterface.
Definition at line 42 of file ecvCommandLineParser.h.
|
inlineoverridevirtual |
Returns the list of arguments.
Implements ccCommandLineInterface.
Definition at line 41 of file ecvCommandLineParser.h.
|
protected |
Definition at line 696 of file ecvCommandLineParser.cpp.
References removeClouds(), and removeMeshes().
|
inlineoverridevirtual |
Returns the current cloud(s) export extension (warning: can be anything)
Implements ccCommandLineInterface.
Definition at line 60 of file ecvCommandLineParser.h.
|
inlineoverridevirtual |
Returns the current cloud(s) export format.
Implements ccCommandLineInterface.
Definition at line 59 of file ecvCommandLineParser.h.
|
overridevirtual |
Implements ccCommandLineInterface.
Definition at line 52 of file ecvCommandLineParser.cpp.
References CVLog::Error().
Referenced by saveClouds(), saveMeshes(), and start().
|
overridevirtual |
Exports a cloud or a mesh.
Implements ccCommandLineInterface.
Definition at line 223 of file ecvCommandLineParser.cpp.
References ccHObject::addChild(), FileIOFilter::SaveParameters::alwaysDisplaySaveDialog, CLEntityDesc::basename, CC_FERR_NO_ERROR, CLOUD, ccHObject::detachChild(), ccHObject::DP_NONE, ccCommandLineInterface::ForceCloud, ccCommandLineInterface::ForceHierarchy, ccCommandLineInterface::ForceMesh, ccCommandLineInterface::ForceNoTimestamp, format, ccGenericMesh::getAssociatedCloud(), CLEntityDesc::getCLEntityType(), CLEntityDesc::getEntity(), getExportFilename(), BinFilter::GetFileFilter(), ccObject::getName(), ccObject::isA(), ccHObject::isAncestorOf(), ccObject::isKindOf(), CV_TYPES::MESH, MESH, FileIOFilter::SaveParameters::parentWidget, CV_TYPES::POINT_CLOUD, print(), result, FileIOFilter::SaveToFile(), ccObject::setName(), ccCommandLineInterface::silentMode(), and CVLog::TheInstance().
Referenced by saveClouds(), and saveMeshes().
|
overridevirtual |
Returns the name of a to-be-exported entity.
Implements ccCommandLineInterface.
Definition at line 174 of file ecvCommandLineParser.cpp.
References CLEntityDesc::basename, CLEntityDesc::getEntity(), CLEntityDesc::indexInFile, ccCommandLineInterface::m_addTimestamp, CLEntityDesc::path, e57::toString(), and warning().
Referenced by exportEntity().
|
inlineoverridevirtual |
Returns the current hierarchy(ies) export extension (warning: can be anything)
Implements ccCommandLineInterface.
Definition at line 66 of file ecvCommandLineParser.h.
|
inlineoverridevirtual |
Returns the current hierarchy(ies) export format.
Implements ccCommandLineInterface.
Definition at line 63 of file ecvCommandLineParser.h.
|
overridevirtual |
Loads a file with a specific filter.
Automatically dispatches the entities between the clouds and meshes sets.
Implements ccCommandLineInterface.
Definition at line 356 of file ecvCommandLineParser.cpp.
References ccHObject::addChild(), ccCommandLineInterface::GlobalShiftOptions::AUTO_GLOBAL_SHIFT, CC_FERR_NO_ERROR, ccCommandLineInterface::clouds(), count, ccCommandLineInterface::GlobalShiftOptions::CUSTOM_GLOBAL_SHIFT, ccCommandLineInterface::GlobalShiftOptions::customGlobalShift, ccHObject::detachChild(), filename, ccHObject::filterChildren(), ccCommandLineInterface::GlobalShiftOptions::FIRST_GLOBAL_SHIFT, ccGenericMesh::getAssociatedCloud(), ccObject::getName(), ccHObject::getParent(), ccObject::getUniqueID(), FileIOFilter::LoadFromFile(), ccCommandLineInterface::m_clouds, ccCommandLineInterface::CLLoadParameters::m_coordinatesShift, ccCommandLineInterface::CLLoadParameters::m_coordinatesShiftEnabled, ccCommandLineInterface::m_loadingParameters, ccCommandLineInterface::m_meshes, CV_TYPES::MESH, ccCommandLineInterface::meshes(), ccCommandLineInterface::GlobalShiftOptions::mode, ecvGlobalShiftManager::NO_DIALOG, ecvGlobalShiftManager::NO_DIALOG_AUTO_SHIFT, ccCommandLineInterface::GlobalShiftOptions::NO_GLOBAL_SHIFT, CV_TYPES::POINT_CLOUD, print(), result, FileIOFilter::LoadParameters::shiftHandlingMode, cloudViewer::GenericCloud::size(), cloudViewer::GenericMesh::size(), cloudViewer::PointCloudTpl< T >::size(), and ccHObjectCaster::ToGenericMesh().
|
inlineoverridevirtual |
Returns the current mesh(es) export extension (warning: can be anything)
Implements ccCommandLineInterface.
Definition at line 62 of file ecvCommandLineParser.h.
|
inlineoverridevirtual |
Returns the current mesh(es) export format.
Implements ccCommandLineInterface.
Definition at line 61 of file ecvCommandLineParser.h.
|
static |
Parses the input command.
Definition at line 58 of file ecvCommandLineParser.cpp.
References COMMAND_SILENT_MODE, ecvConsole::Init(), ccCommandLineInterface::IsCommand(), ecvConsole::ReleaseInstance(), and result.
Referenced by main().
|
overridevirtual |
Implements ccCommandLineInterface.
Definition at line 44 of file ecvCommandLineParser.cpp.
References CVLog::Print().
Referenced by exportEntity(), importFile(), and start().
|
protected |
Definition at line 627 of file ecvCommandLineParser.cpp.
References registerCommand().
|
override |
Definition at line 154 of file ecvCommandLineParser.cpp.
References warning().
Referenced by registerBuiltInCommands().
|
overridevirtual |
Removes all clouds (or only the last one ;)
Implements ccCommandLineInterface.
Definition at line 339 of file ecvCommandLineParser.cpp.
References ccCommandLineInterface::m_clouds.
Referenced by cleanup().
|
overridevirtual |
Removes all meshes (or only the last one ;)
Implements ccCommandLineInterface.
Definition at line 347 of file ecvCommandLineParser.cpp.
References ccCommandLineInterface::m_meshes, and CLMeshDesc::mesh.
Referenced by cleanup().
|
overridevirtual |
Saves all clouds.
| suffix | optional suffix |
| allAtOnce | whether to save all clouds in the same file or one cloud per file |
Implements ccCommandLineInterface.
Definition at line 519 of file ecvCommandLineParser.cpp.
References ccHObject::addChild(), ccHObject::DP_NONE, error(), exportEntity(), ccCommandLineInterface::ForceCloud, FileIOFilter::GetFilter(), ccCommandLineInterface::m_clouds, CV_TYPES::POINT_CLOUD, and CommandSave::SetFileDesc().
|
overridevirtual |
Saves all meshes.
| suffix | optional suffix |
| allAtOnce | whether to save all meshes in the same file or one mesh per file |
Implements ccCommandLineInterface.
Definition at line 574 of file ecvCommandLineParser.cpp.
References ccHObject::addChild(), ccHObject::DP_NONE, error(), exportEntity(), ccCommandLineInterface::ForceMesh, FileIOFilter::GetFilter(), ccCommandLineInterface::m_meshes, CV_TYPES::MESH, and CommandSave::SetFileDesc().
|
inlineoverridevirtual |
Sets the current cloud(s) export format and extension.
Implements ccCommandLineInterface.
Definition at line 67 of file ecvCommandLineParser.h.
References format.
|
inlineoverridevirtual |
Sets the current hierarchy(ies) export format and extension.
Implements ccCommandLineInterface.
Definition at line 75 of file ecvCommandLineParser.h.
References format.
|
inlineoverridevirtual |
Sets the current mesh(es) export format and extension.
Implements ccCommandLineInterface.
Definition at line 71 of file ecvCommandLineParser.h.
References format.
|
protected |
Parses the command line.
Definition at line 701 of file ecvCommandLineParser.cpp.
References COMMAND_HELP, COMMAND_SILENT_MODE, error(), print(), and warning().
|
overridevirtual |
Implements ccCommandLineInterface.
Definition at line 48 of file ecvCommandLineParser.cpp.
References CVLog::Warning().
Referenced by getExportFilename(), registerCommand(), and start().
|
inlineoverridevirtual |
Returns a (widget) parent (if any is available)
Reimplemented from ccCommandLineInterface.
Definition at line 44 of file ecvCommandLineParser.h.