itom 2.0.0
ito::IOHelper Class Reference

List of all members.

Public Types

enum  IOFilter {
  IOInput = 0x001, IOOutput = 0x002, IOPlugin = 0x004, IOAllFiles = 0x008,
  IOWorkspace = 0x010, IOMimeDataObject = 0x020, IOMimePointCloud = 0x040, IOMimePolygonMesh = 0x080,
  IOMimeAll = IOMimeDataObject | IOMimePointCloud | IOMimePolygonMesh
}
enum  SearchFolder {
  SFResources = 0x001, SFDirect = 0x002, SFCurrent = 0x004, SFAppDir = 0x008,
  SFAppDirQItom = 0x010, SFAll = SFResources | SFDirect | SFCurrent | SFAppDir | SFAppDirQItom
}

Static Public Member Functions

static RetVal openGeneralFile (const QString &generalFileName, bool openUnknownsWithExternalApp=true, bool showMessages=false, QWidget *parent=NULL, const char *errorSlotMemberOfParent=NULL, bool globalNotLocalWorkspace=true)
static RetVal uiExportPyWorkspaceVars (bool globalNotLocal, const QStringList &varNames, QVector< int > compatibleParamBaseTypes, QString defaultPath=QString::Null(), QWidget *parent=NULL)
static RetVal exportPyWorkspaceVars (const QString &filename, bool globalNotLocal, const QStringList &varNames)
static RetVal uiImportPyWorkspaceVars (bool globalNotLocal, IOFilters IOfilters, QString defaultPath=QString::Null(), QWidget *parent=NULL)
static RetVal importPyWorkspaceVars (const QString &filename, bool globalNotLocal)
static RetVal uiOpenPythonScript (QString defaultPath=QString::Null(), QWidget *parent=NULL)
static RetVal openPythonScript (const QString &filename)
static RetVal uiOpenFileWithFilter (const ito::AddInAlgo::FilterDef *filter, const QString &filename, QWidget *parent=NULL, bool globalNotLocal=true)
static RetVal uiSaveFileWithFilter (QSharedPointer< ito::ParamBase > &value, const QString &filename, QWidget *parent=NULL)
static RetVal openUIFile (const QString &filename, QWidget *parent=NULL, const char *errorSlotMemberOfParent=NULL)
static QString getFileFilters (const IOFilters &IOfilters, QStringList *allPatterns=NULL)
 Returns a list of all file endings that correspond to itom.
static bool fileFitsToFileFilters (const QString &filename, const IOFilters &IOfilters)
 Checks if a file fits to a filter.
static void elideFilepathMiddle (QString &path, int pixelLength)
 Shortens paths so that menus can display them without becoming too big.
static QIcon searchIcon (const QString &filename, SearchFolders searchFolders=SFAll, const QIcon &fallbackIcon=QIcon())

Private Member Functions

 IOHelper (const IOHelper &)

Member Enumeration Documentation

Enumerator:
IOInput 

consider algorithms for file input

IOOutput 

consider algorithms for file output

IOPlugin 

consider algorithms provided by plugins

IOAllFiles 

add the "All Files (*.*)" filter

IOWorkspace 

only consider filters which can be imported or exported from python workspace


Member Function Documentation

void ito::IOHelper::elideFilepathMiddle ( QString &  path,
int  pixelLength 
) [static]

Shortens paths so that menus can display them without becoming too big.

This functio is used to shorten paths so they fit into a menu or something compareable.

Example: D:/testdir1/testdir2/file.py becomes D:/...ir2/file.py

If the pixelLength is shorter than the filename a minimum is returned: D:/...file.py Even if the minimum is longer than the pixelLength.

Parameters:
pathThe path that is supposed to be shortened
pixelLengthThe length the path has to have after shortening
bool ito::IOHelper::fileFitsToFileFilters ( const QString &  filename,
const IOFilters &  IOfilters 
) [static]

Checks if a file fits to a filter.

This function checks if a fileending of a file fits to a given set of filters.

Parameters:
filenamepass the filename as a QString
IOfilterspass the filterset that the filename shopuld be checked against
Returns:
returns true if the file fits to the filters, else false is returned
QString ito::IOHelper::getFileFilters ( const IOFilters &  IOfilters,
QStringList *  allPatterns = NULL 
) [static]

Returns a list of all file endings that correspond to itom.

This function returns a QString that contains a semicolon separated list of all fileendings that were passed by the iofilters parameter

Parameters:
IOfiltersfilters that contain the filenendings
allPatternsPointer to QStringList (standard = 0)
Returns:
returns a QString with fileendings (semicolon separated)

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends