ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccCommandLineInterface Class Referenceabstract

Command line interface. More...

#include <ecvCommandLineInterface.h>

Inheritance diagram for ccCommandLineInterface:
[legend]
Collaboration diagram for ccCommandLineInterface:
[legend]

Classes

struct  CLLoadParameters
 
struct  Command
 Generic command interface. More...
 
struct  GlobalShiftOptions
 Global Shift options. More...
 

Public Types

enum  ExportOption {
  ExportOption::NoOptions = 0x0, ExportOption::ForceCloud = 0x1, ExportOption::ForceMesh = 0x2, ExportOption::ForceHierarchy = 0x4,
  ExportOption::ForceNoTimestamp = 0x8
}
 

Public Member Functions

 ccCommandLineInterface ()
 Default constructor. More...
 
virtual ~ccCommandLineInterface ()=default
 
virtual bool registerCommand (Command::Shared command)=0
 Registers a new command. More...
 
virtual QString getExportFilename (const CLEntityDesc &entityDesc, QString extension=QString(), QString suffix=QString(), QString *baseOutputFilename=nullptr, bool forceNoTimestamp=false) const =0
 Returns the name of a to-be-exported entity. More...
 
virtual QString exportEntity (CLEntityDesc &entityDesc, const QString &suffix=QString(), QString *outputFilename=nullptr, ccCommandLineInterface::ExportOptions options=ExportOption::NoOptions)=0
 Exports a cloud or a mesh. More...
 
virtual bool saveClouds (QString suffix=QString(), bool allAtOnce=false, const QString *allAtOnceFileName=nullptr)=0
 Saves all clouds. More...
 
virtual bool saveMeshes (QString suffix=QString(), bool allAtOnce=false, const QString *allAtOnceFileName=nullptr)=0
 Saves all meshes. More...
 
virtual void removeClouds (bool onlyLast=false)=0
 Removes all clouds (or only the last one ;) More...
 
virtual void removeMeshes (bool onlyLast=false)=0
 Removes all meshes (or only the last one ;) More...
 
virtual QStringList & arguments ()=0
 Returns the list of arguments. More...
 
virtual const QStringList & arguments () const =0
 Returns the list of arguments (const version) More...
 
virtual ecvProgressDialog * progressDialog ()
 Returns a (shared) progress dialog (if any is available) More...
 
virtual QDialog * widgetParent ()
 Returns a (widget) parent (if any is available) More...
 
virtual CLLoadParameters & fileLoadingParams ()
 File loading parameters. More...
 
virtual bool importFile (QString filename, const GlobalShiftOptions &globalShiftOptions, FileIOFilter::Shared filter=FileIOFilter::Shared(nullptr))=0
 Loads a file with a specific filter. More...
 
virtual QString cloudExportFormat () const =0
 Returns the current cloud(s) export format. More...
 
virtual QString cloudExportExt () const =0
 Returns the current cloud(s) export extension (warning: can be anything) More...
 
virtual QString meshExportFormat () const =0
 Returns the current mesh(es) export format. More...
 
virtual QString meshExportExt () const =0
 Returns the current mesh(es) export extension (warning: can be anything) More...
 
virtual QString hierarchyExportFormat () const =0
 Returns the current hierarchy(ies) export format. More...
 
virtual QString hierarchyExportExt () const =0
 
virtual void setCloudExportFormat (QString format, QString ext)=0
 Sets the current cloud(s) export format and extension. More...
 
virtual void setMeshExportFormat (QString format, QString ext)=0
 Sets the current mesh(es) export format and extension. More...
 
virtual void setHierarchyExportFormat (QString format, QString ext)=0
 Sets the current hierarchy(ies) export format and extension. More...
 
virtual void print (const QString &message) const =0
 
virtual void warning (const QString &message) const =0
 
virtual bool error (const QString &message) const =0
 
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 bool IsCommand (const QString &token, const char *command)
 Test whether a command line token is a valid command keyword or not. More...
 

Protected Attributes

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...
 

Detailed Description

Command line interface.

Member Enumeration Documentation

◆ ExportOption

Enumerator
NoOptions 
ForceCloud 
ForceMesh 
ForceHierarchy 
ForceNoTimestamp 

Constructor & Destructor Documentation

◆ ccCommandLineInterface()

ccCommandLineInterface::ccCommandLineInterface ( )

Default constructor.

◆ ~ccCommandLineInterface()

virtual ccCommandLineInterface::~ccCommandLineInterface ( )
virtualdefault

Member Function Documentation

◆ addTimestamp()

bool ccCommandLineInterface::addTimestamp ( ) const

Returns whether a timestamp should be automatically added to output files or not

References m_addTimestamp.

Referenced by CommandRasterize::process(), CommandVolume25D::process(), CommandMatchBestFitPlane::process(), CommandICP::process(), CommandSaveClouds::process(), and CommandSaveMeshes::process().

◆ arguments() [1/2]

virtual const QStringList& ccCommandLineInterface::arguments ( ) const
pure virtual

Returns the list of arguments (const version)

Implemented in ccCommandLineParser.

◆ arguments() [2/2]

virtual QStringList& ccCommandLineInterface::arguments ( )
pure virtual

Returns the list of arguments.

Implemented in ccCommandLineParser.

Referenced by CommandChangeOutputFormat::getFileFormatFilter(), GetSFIndexOrName(), CommandRANSAC::makePathIfPossible(), nextCommandIsGlobalShift(), CommandSave::ParseFileNames(), PythonPluginCommand::Args::parseFrom(), CommandRasterize::process(), CommandCrossSection::process(), CommandVolume25D::process(), CommandM3C2::process(), CommandChangeCloudOutputFormat::process(), CommandLoadLASFWF::process(), CommandCanupoClassif::process(), CommandChangeMeshOutputFormat::process(), CommandCSF::process(), BundlerCommand::process(), FBXCommand::process(), CommandChangeHierarchyOutputFormat::process(), PCDCommand::process(), CommandLoad::process(), PCVCommand::process(), CommandOctreeNormal::process(), Command3DMASCClassif::process(), CommandRANSAC::process(), CommandTreeIso::process(), CommandSaveLASFWF::process(), CommandSubsample::process(), CommandExtractCCs::process(), CommandCurvature::process(), CommandApproxDensity::process(), CommandDensity::process(), CommandSFGradient::process(), CommandRoughness::process(), CommandApplyTransformation::process(), CommandSFColorScale::process(), CommandSFConvertToRGB::process(), CommandFilterBySFValue::process(), CommandComputeMeshVolume::process(), CommandSetActiveSF::process(), CommandRemoveSF::process(), CommandMatchBestFitPlane::process(), CommandOrientNormalsMST::process(), CommandSORFilter::process(), CommandSampleMesh::process(), CommandCrop::process(), CommandCoordToSF::process(), CommandCrop2D::process(), CommandColorBanding::process(), CommandDist::process(), CommandStatTest::process(), CommandDelaunayTri::process(), CommandSFArithmetic::process(), CommandSFOperation::process(), CommandSFRename::process(), CommandICP::process(), CommandChangePLYExportFormat::process(), CommandSaveClouds::process(), CommandSaveMeshes::process(), CommandAutoSave::process(), CommandLogFile::process(), CommandMoment::process(), CommandFeature::process(), processGlobalShiftCommand(), and ReadDensityType().

◆ autoSaveMode()

◆ cloudExportExt()

virtual QString ccCommandLineInterface::cloudExportExt ( ) const
pure virtual

Returns the current cloud(s) export extension (warning: can be anything)

Implemented in ccCommandLineParser.

Referenced by CommandChangeCloudOutputFormat::process(), CommandSaveLASFWF::process(), and CommandSaveClouds::process().

◆ cloudExportFormat()

virtual QString ccCommandLineInterface::cloudExportFormat ( ) const
pure virtual

Returns the current cloud(s) export format.

Implemented in ccCommandLineParser.

Referenced by CommandChangeCloudOutputFormat::process(), CommandSaveLASFWF::process(), and CommandSaveClouds::process().

◆ clouds() [1/2]

const std::vector< CLCloudDesc > & ccCommandLineInterface::clouds ( )
virtual

Currently opened point clouds and their filename.

References m_clouds.

Referenced by define_ccCommandLine(), ccCommandLineParser::importFile(), CommandRasterize::process(), CommandCrossSection::process(), CommandVolume25D::process(), CommandM3C2::process(), CommandCanupoClassif::process(), CommandCSF::process(), CommandClearNormals::process(), PCVCommand::process(), CommandOctreeNormal::process(), Command3DMASCClassif::process(), CommandRANSAC::process(), CommandInvertNormal::process(), CommandTreeIso::process(), CommandConvertNormalsToDipAndDipDir::process(), CommandConvertNormalsToSFs::process(), CommandSubsample::process(), CommandExtractCCs::process(), CommandCurvature::process(), CommandApproxDensity::process(), CommandDensity::process(), CommandSFGradient::process(), CommandRoughness::process(), CommandApplyTransformation::process(), CommandDropGlobalShift::process(), CommandSFColorScale::process(), CommandSFConvertToRGB::process(), CommandFilterBySFValue::process(), CommandMergeClouds::process(), CommandSetActiveSF::process(), CommandRemoveAllSFs::process(), CommandRemoveSF::process(), CommandRemoveRGB::process(), CommandRemoveNormals::process(), CommandRemoveScanGrids::process(), CommandMatchBBCenters::process(), CommandMatchBestFitPlane::process(), CommandOrientNormalsMST::process(), CommandSORFilter::process(), CommandExtractVertices::process(), CommandSampleMesh::process(), CommandCrop::process(), CommandCoordToSF::process(), CommandCrop2D::process(), CommandColorBanding::process(), CommandDist::process(), CommandCPS::process(), CommandStatTest::process(), CommandDelaunayTri::process(), CommandSFArithmetic::process(), CommandSFOperation::process(), CommandSFRename::process(), CommandICP::process(), CommandSaveClouds::process(), CommandMoment::process(), and CommandFeature::process().

◆ clouds() [2/2]

virtual const std::vector<CLCloudDesc>& ccCommandLineInterface::clouds ( ) const
virtual

Currently opened point clouds and their filename (const version)

◆ error()

virtual bool ccCommandLineInterface::error ( const QString &  message) const
pure virtual

Implemented in ccCommandLineParser.

Referenced by CommandChangeOutputFormat::getFileFormatFilter(), CommandRANSAC::makePathIfPossible(), CommandSave::ParseFileNames(), PythonPluginCommand::Args::parseFrom(), CommandRasterize::process(), CommandCrossSection::process(), CommandM3C2::process(), CommandVolume25D::process(), CommandChangeCloudOutputFormat::process(), CommandLoadLASFWF::process(), CommandCanupoClassif::process(), CommandChangeMeshOutputFormat::process(), CommandCSF::process(), BundlerCommand::process(), FBXCommand::process(), CommandChangeHierarchyOutputFormat::process(), PCDCommand::process(), CommandLoad::process(), PCVCommand::process(), CommandClearNormals::process(), CommandRANSAC::process(), CommandOctreeNormal::process(), Command3DMASCClassif::process(), CommandInvertNormal::process(), CommandTreeIso::process(), CommandConvertNormalsToDipAndDipDir::process(), CommandConvertNormalsToSFs::process(), CommandSubsample::process(), CommandExtractCCs::process(), CommandCurvature::process(), CommandApproxDensity::process(), CommandDensity::process(), CommandSFGradient::process(), CommandRoughness::process(), CommandApplyTransformation::process(), CommandDropGlobalShift::process(), CommandSFColorScale::process(), CommandSFConvertToRGB::process(), CommandFilterBySFValue::process(), CommandComputeMeshVolume::process(), CommandMergeMeshes::process(), CommandMergeClouds::process(), CommandSetActiveSF::process(), CommandRemoveSF::process(), CommandMatchBBCenters::process(), CommandMatchBestFitPlane::process(), CommandOrientNormalsMST::process(), CommandSORFilter::process(), CommandExtractVertices::process(), CommandSampleMesh::process(), CommandCrop::process(), CommandCoordToSF::process(), CommandCrop2D::process(), CommandColorBanding::process(), CommandDist::process(), CommandCPS::process(), CommandStatTest::process(), CommandDelaunayTri::process(), CommandSFArithmetic::process(), CommandSFOperation::process(), CommandSFRename::process(), CommandICP::process(), CommandChangePLYExportFormat::process(), CommandSaveClouds::process(), CommandSaveMeshes::process(), CommandAutoSave::process(), CommandLogFile::process(), CommandMoment::process(), CommandFeature::process(), PythonPluginCommand::process(), processGlobalShiftCommand(), and ReadDensityType().

◆ exportEntity()

◆ fileLoadingParams()

ccCommandLineInterface::CLLoadParameters & ccCommandLineInterface::fileLoadingParams ( )
virtual

File loading parameters.

References m_loadingParameters.

Referenced by CommandForceNormalsComputation::process().

◆ getExportFilename()

virtual QString ccCommandLineInterface::getExportFilename ( const CLEntityDesc &  entityDesc,
QString  extension = QString(),
QString  suffix = QString(),
QString *  baseOutputFilename = nullptr,
bool  forceNoTimestamp = false 
) const
pure virtual

Returns the name of a to-be-exported entity.

Implemented in ccCommandLineParser.

Referenced by define_ccCommandLine(), and CommandRasterize::process().

◆ hierarchyExportExt()

virtual QString ccCommandLineInterface::hierarchyExportExt ( ) const
pure virtual

Returns the current hierarchy(ies) export extension (warning: can be anything)

Implemented in ccCommandLineParser.

Referenced by CommandChangeHierarchyOutputFormat::process().

◆ hierarchyExportFormat()

virtual QString ccCommandLineInterface::hierarchyExportFormat ( ) const
pure virtual

Returns the current hierarchy(ies) export format.

Implemented in ccCommandLineParser.

Referenced by CommandChangeHierarchyOutputFormat::process().

◆ importFile()

virtual bool ccCommandLineInterface::importFile ( QString  filename,
const GlobalShiftOptions &  globalShiftOptions,
FileIOFilter::Shared  filter = FileIOFilter::Shared(nullptr) 
)
pure virtual

Loads a file with a specific filter.

Automatically dispatches the entities between the clouds and meshes sets.

Implemented in ccCommandLineParser.

Referenced by CommandLoadLASFWF::process(), and CommandLoad::process().

◆ IsCommand()

◆ meshes() [1/2]

◆ meshes() [2/2]

virtual const std::vector<CLMeshDesc>& ccCommandLineInterface::meshes ( ) const
virtual

Currently opened meshes and their filename (const version)

◆ meshExportExt()

virtual QString ccCommandLineInterface::meshExportExt ( ) const
pure virtual

Returns the current mesh(es) export extension (warning: can be anything)

Implemented in ccCommandLineParser.

Referenced by CommandChangeMeshOutputFormat::process(), and CommandSaveMeshes::process().

◆ meshExportFormat()

virtual QString ccCommandLineInterface::meshExportFormat ( ) const
pure virtual

Returns the current mesh(es) export format.

Implemented in ccCommandLineParser.

Referenced by CommandChangeMeshOutputFormat::process(), and CommandSaveMeshes::process().

◆ nextCommandIsGlobalShift()

bool ccCommandLineInterface::nextCommandIsGlobalShift ( ) const

Returns whether the nex command is the '-GLOBAL_SHIFT' option.

References arguments(), and IsCommand().

Referenced by CommandLoadLASFWF::process(), and CommandLoad::process().

◆ numericalPrecision()

int ccCommandLineInterface::numericalPrecision ( ) const

◆ print()

virtual void ccCommandLineInterface::print ( const QString &  message) const
pure virtual

Implemented in ccCommandLineParser.

Referenced by GetSFIndexOrName(), CommandRANSAC::makePathIfPossible(), CommandRasterize::process(), CommandCrossSection::process(), CommandVolume25D::process(), CommandM3C2::process(), CommandChangeCloudOutputFormat::process(), CommandLoadLASFWF::process(), CommandCanupoClassif::process(), CommandChangeMeshOutputFormat::process(), CommandCSF::process(), BundlerCommand::process(), FBXCommand::process(), CommandChangeHierarchyOutputFormat::process(), PCDCommand::process(), CommandLoad::process(), CommandClearNormals::process(), PCVCommand::process(), CommandOctreeNormal::process(), Command3DMASCClassif::process(), CommandRANSAC::process(), CommandInvertNormal::process(), CommandTreeIso::process(), CommandConvertNormalsToDipAndDipDir::process(), CommandConvertNormalsToSFs::process(), CommandSubsample::process(), CommandExtractCCs::process(), CommandCurvature::process(), CommandApproxDensity::process(), CommandDensity::process(), CommandSFGradient::process(), CommandRoughness::process(), CommandApplyTransformation::process(), CommandDropGlobalShift::process(), CommandSFColorScale::process(), CommandSFConvertToRGB::process(), CommandFilterBySFValue::process(), CommandComputeMeshVolume::process(), CommandMergeMeshes::process(), CommandMergeClouds::process(), CommandSetActiveSF::process(), CommandRemoveSF::process(), CommandMatchBBCenters::process(), CommandMatchBestFitPlane::process(), CommandOrientNormalsMST::process(), CommandSORFilter::process(), CommandExtractVertices::process(), CommandSampleMesh::process(), CommandCrop::process(), CommandCoordToSF::process(), CommandCrop2D::process(), CommandColorBanding::process(), CommandDist::process(), CommandCPS::process(), CommandStatTest::process(), CommandDelaunayTri::process(), CommandSFArithmetic::process(), CommandSFOperation::process(), CommandSFRename::process(), CommandICP::process(), CommandAutoSave::process(), CommandMoment::process(), CommandFeature::process(), and PythonPluginCommand::process().

◆ processGlobalShiftCommand()

bool ccCommandLineInterface::processGlobalShiftCommand ( GlobalShiftOptions &  options)

◆ progressDialog()

ecvProgressDialog * ccCommandLineInterface::progressDialog ( )
virtual

Returns a (shared) progress dialog (if any is available)

Referenced by CommandSubsample::process().

◆ registerCommand()

virtual bool ccCommandLineInterface::registerCommand ( Command::Shared  command)
pure virtual

◆ removeClouds()

virtual void ccCommandLineInterface::removeClouds ( bool  onlyLast = false)
pure virtual

◆ removeMeshes()

virtual void ccCommandLineInterface::removeMeshes ( bool  onlyLast = false)
pure virtual

◆ saveClouds()

virtual bool ccCommandLineInterface::saveClouds ( QString  suffix = QString(),
bool  allAtOnce = false,
const QString *  allAtOnceFileName = nullptr 
)
pure virtual

◆ saveMeshes()

virtual bool ccCommandLineInterface::saveMeshes ( QString  suffix = QString(),
bool  allAtOnce = false,
const QString *  allAtOnceFileName = nullptr 
)
pure virtual

Saves all meshes.

Parameters
suffixoptional suffix
allAtOncewhether to save all meshes in the same file or one mesh per file
Returns
success

Implemented in ccCommandLineParser.

Referenced by define_ccCommandLine(), CommandApplyTransformation::process(), CommandColorBanding::process(), and CommandSaveMeshes::process().

◆ setCloudExportFormat()

virtual void ccCommandLineInterface::setCloudExportFormat ( QString  format,
QString  ext 
)
pure virtual

Sets the current cloud(s) export format and extension.

Implemented in ccCommandLineParser.

Referenced by CommandChangeCloudOutputFormat::process(), CommandSaveLASFWF::process(), and CommandSaveClouds::process().

◆ setHierarchyExportFormat()

virtual void ccCommandLineInterface::setHierarchyExportFormat ( QString  format,
QString  ext 
)
pure virtual

Sets the current hierarchy(ies) export format and extension.

Implemented in ccCommandLineParser.

Referenced by CommandChangeHierarchyOutputFormat::process().

◆ setMeshExportFormat()

virtual void ccCommandLineInterface::setMeshExportFormat ( QString  format,
QString  ext 
)
pure virtual

Sets the current mesh(es) export format and extension.

Implemented in ccCommandLineParser.

Referenced by CommandChangeMeshOutputFormat::process(), and CommandSaveMeshes::process().

◆ setNumericalPrecision()

void ccCommandLineInterface::setNumericalPrecision ( int  p)

Sets the numerical precision.

References m_precision.

◆ silentMode()

◆ toggleAddTimestamp()

void ccCommandLineInterface::toggleAddTimestamp ( bool  state)

Sets whether a timestamp should be automatically added to output files or not

References m_addTimestamp.

Referenced by CommandSaveClouds::process(), CommandSaveMeshes::process(), and CommandSetNoTimestamp::process().

◆ toggleAutoSaveMode()

void ccCommandLineInterface::toggleAutoSaveMode ( bool  state)

Sets whether files should be automatically saved (after each process) or not

References m_autoSaveMode.

Referenced by CommandAutoSave::process().

◆ toggleSilentMode()

void ccCommandLineInterface::toggleSilentMode ( bool  state)

Toggles silent mode.

Must be called BEFORE calling start.

References m_silentMode.

◆ warning()

◆ widgetParent()

Member Data Documentation

◆ m_addTimestamp

bool ccCommandLineInterface::m_addTimestamp
protected

Whether a timestamp should be automatically added to output files or not.

Referenced by addTimestamp(), ccCommandLineParser::getExportFilename(), and toggleAddTimestamp().

◆ m_autoSaveMode

bool ccCommandLineInterface::m_autoSaveMode
protected

Whether files should be automatically saved (after each process) or not.

Referenced by autoSaveMode(), and toggleAutoSaveMode().

◆ m_clouds

std::vector<CLCloudDesc> ccCommandLineInterface::m_clouds
protected

Currently opened point clouds and their filename.

Referenced by clouds(), ccCommandLineParser::importFile(), ccCommandLineParser::removeClouds(), and ccCommandLineParser::saveClouds().

◆ m_loadingParameters

CLLoadParameters ccCommandLineInterface::m_loadingParameters
protected

File loading parameters.

Referenced by fileLoadingParams(), and ccCommandLineParser::importFile().

◆ m_meshes

std::vector<CLMeshDesc> ccCommandLineInterface::m_meshes
protected

◆ m_precision

int ccCommandLineInterface::m_precision
protected

Default numerical precision for ASCII output.

Referenced by numericalPrecision(), and setNumericalPrecision().

◆ m_silentMode

bool ccCommandLineInterface::m_silentMode
protected

Silent mode.

Referenced by silentMode(), and toggleSilentMode().


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