|
SHAPER
9.15.0
|
Commonly used methods in XGUI package and higher. More...
Functions | |
| QString | dir (const QString &path, bool isAbs=true) |
| Return directory part of the file path. More... | |
| QString | file (const QString &path, bool withExt=true) |
| Return file name part of the file path. More... | |
| QString | addSlash (const QString &path) |
| Add a slash (platform-specific) to the end of path if it is not already there. More... | |
| QString | unionOfObjectNames (const QObjectPtrList &theObjects, const QString &theSeparator) |
| bool | isModelObject (FeaturePtr theFeature) |
| std::string | featureInfo (FeaturePtr theFeature) |
| bool | canRemoveOrRename (QWidget *theParent, const std::set< FeaturePtr > &theFeatures) |
| bool | isAscii (const QString &theStr) |
| bool | isValidName (const QString &theName) |
| bool | canRename (const ObjectPtr &theObject, const QString &theName) |
| XGUI_Workshop * | workshop (ModuleBase_IWorkshop *theWorkshop) |
| QString | generateName (const std::shared_ptr< ModuleBase_ViewerPrs > &thePrs) |
| Generates a presentation name in form: <object_name>/<face>_<face_index> More... | |
| std::wstring | strToWStr (const std::string &theStr) |
| std::string | getTmpDirByPath (const std::string &theTmpPath) |
| std::string | getTmpDirByEnv (const char *thePathEnv) |
| Creates and returns the temporary directory (with random name) using the environment variable path to location of such directories,. More... | |
| void | removeTemporaryFiles (const std::string &theDirectory, const std::list< std::string > &theFiles) |
| Removes files and directory where they are located. More... | |
Commonly used methods in XGUI package and higher.
| QString XGUI_Tools::dir | ( | const QString & | path, |
| bool | isAbs = true |
||
| ) |
Return directory part of the file path.
If the file path does not include directory part (the file is in the current directory), null string is returned.
| path | file path |
| isAbs | if true (default) path parameter is treated as absolute file path |
| QString XGUI_Tools::file | ( | const QString & | path, |
| bool | withExt = true |
||
| ) |
Return file name part of the file path.
| path | file path |
| withExt | if true (default) complete file name (with all extension except the last) is returned, otherwise only base name is returned |
| QString XGUI_Tools::addSlash | ( | const QString & | path | ) |
Add a slash (platform-specific) to the end of path if it is not already there.
| path | directory path |
| QString XGUI_Tools::unionOfObjectNames | ( | const QObjectPtrList & | theObjects, |
| const QString & | theSeparator | ||
| ) |
Unite object names in one string using the separator between values
| theObjects | a list of objects |
| theSeparator | a separator |
| bool XGUI_Tools::isModelObject | ( | FeaturePtr | theFeature | ) |
Returns true if the feature is a model object
| theFeature | a feature |
| std::string XGUI_Tools::featureInfo | ( | FeaturePtr | theFeature | ) |
Returns the string presentation of the given feature
| theFeature | a feature |
| bool XGUI_Tools::canRemoveOrRename | ( | QWidget * | theParent, |
| const std::set< FeaturePtr > & | theFeatures | ||
| ) |
Returns true if there are no parts in the document, which are not activated or all objects in the list are not PartSet document. It shows the warning control if the result is false.
| theParent | a parent for the warning control |
| theFeatures | a list of checked features |
| bool XGUI_Tools::isAscii | ( | const QString & | theStr | ) |
Checks that the given string contains only ASCII symbols
| theStr | a string to check |
| bool XGUI_Tools::canRename | ( | const ObjectPtr & | theObject, |
| const QString & | theName | ||
| ) |
Check possibility to rename object
| theObject | an object to rename |
| theName | a name |
| XGUI_Workshop * XGUI_Tools::workshop | ( | ModuleBase_IWorkshop * | theWorkshop | ) |
Returns converted workshop
| theWorkshop | an interface workshop |
| QString XGUI_Tools::generateName | ( | const std::shared_ptr< ModuleBase_ViewerPrs > & | thePrs | ) |
Generates a presentation name in form: <object_name>/<face>_<face_index>
| thePrs | a presentation |
| std::string XGUI_Tools::getTmpDirByEnv | ( | const char * | thePathEnv | ) |
Creates and returns the temporary directory (with random name) using the environment variable path to location of such directories,.
| void XGUI_Tools::removeTemporaryFiles | ( | const std::string & | theDirectory, |
| const std::list< std::string > & | theFiles | ||
| ) |
Removes files and directory where they are located.