1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
10 #include <ModelAPI_Feature.h>
12 #include <ModuleBase_Definitions.h>
18 class ModuleBase_IWorkshop;
22 \brief Return directory part of the file path.
24 If the file path does not include directory part (the file is in the
25 current directory), null string is returned.
28 \param abs if true (default) \a path parameter is treated as absolute file path
29 \return directory part of the file path
31 namespace XGUI_Tools {
34 * Returns directory name from name of file
35 * \param path a path to a file
36 * \param isAbs is absolute or relative path
38 QString XGUI_EXPORT dir(const QString& path, bool isAbs = true);
41 \brief Return file name part of the file path.
44 \param withExt if true (default) complete file name (with all
45 extension except the last) is returned, otherwise only base name
47 \return file name part of the file path
49 QString XGUI_EXPORT file(const QString& path, bool withExt = true);
52 \brief Add a slash (platform-specific) to the end of \a path
53 if it is not already there.
54 \param path directory path
55 \return modified path (with slash added to the end)
57 QString XGUI_EXPORT addSlash(const QString& path);
59 // The model concerning tools
61 /*! Unite object names in one string using the separator between values
62 \param theObjects a list of objects
63 \param theSeparator a separator
65 QString unionOfObjectNames(const QObjectPtrList& theObjects, const QString& theSeparator);
68 Returns true if the feature is a model object
69 \param theFeature a feature
71 bool XGUI_EXPORT isModelObject(FeaturePtr theFeature);
74 Returns the string presentation of the given feature
75 \param theFeature a feature
77 std::string XGUI_EXPORT featureInfo(FeaturePtr theFeature);
80 Returns true if there are no parts in the document, which are not activated or
81 all objects in the list are not PartSet document.
82 It shows the warning control if the result is false.
83 \param theParent a parent for the warning control
84 \param aList a list of object
85 \return a boolean value
87 bool XGUI_EXPORT canRemoveOrRename(QWidget* theParent, const QObjectPtrList& aList);
90 Check possibility to rename object
91 \param theObject an object to rename
94 bool canRename(const ObjectPtr& theObject, const QString& theName);
97 Returns true if there are no parts in the document, which are not activated
98 \param theNotActivatedNames out string which contains not activated names
99 \return a boolean value
101 bool XGUI_EXPORT allDocumentsActivated(QString& theNotActivatedNames);
104 Returns converted workshop
105 \param theWorkshop an interface workshop
106 \return XGUI workshop instance
108 XGUI_EXPORT XGUI_Workshop* workshop(ModuleBase_IWorkshop* theWorkshop);