X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_DataModel.h;h=d08ccc42a8f301529b7d0e5f6352c3e1f6ac6b36;hb=220bd2b37119be1c65abf88a88792445cb9d99f8;hp=eb47d9ffb115cf0802890df619bdabf0db8b718f;hpb=703b67eb8a86fd14603e03b3755ed65d6c22de87;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_DataModel.h b/src/XGUI/XGUI_DataModel.h index eb47d9ffb..d08ccc42a 100644 --- a/src/XGUI/XGUI_DataModel.h +++ b/src/XGUI/XGUI_DataModel.h @@ -9,12 +9,13 @@ #define XGUI_DataModel_H #include "XGUI.h" +#include #include #include #include -#include #include +#include /**\class XGUI_DataModel * \ingroup GUI @@ -30,6 +31,8 @@ class XGUI_EXPORT XGUI_DataModel : public QAbstractItemModel, public Events_List { Q_OBJECT public: + /// Constructor + /// \param theParent a parent object XGUI_DataModel(QObject* theParent); /// Event Listener method @@ -110,6 +113,9 @@ public: /// \param theDoc a document QModelIndex documentRootIndex(DocumentPtr theDoc) const; + /// Returns last history object index + virtual QModelIndex lastHistoryIndex() const; + private: /// Find a root index which contains objects of the given document /// \param theDoc the document object @@ -119,6 +125,22 @@ private: /// \param theDoc document which has to be checked. If 0 then Root document will be considered int foldersCount(ModelAPI_Document* theDoc = 0) const; + /// Retrurns indexes of folders which can not be shown because they are empty + /// \param theDoc document which has to be checked. If 0 then Root document will be considered + QIntList missedFolderIndexes(ModelAPI_Document* theDoc = 0) const; + + /// Returns Id (row) of a folder taking into consideration folders which can not be shown non empty + /// \param theType Type of the folder + /// \param theDoc a document which contains this folder + int folderId(std::string theType, ModelAPI_Document* theDoc = 0); + + /// Removes a row from branch of tree + /// \param theStart - start row to update indexes + /// \param theSize - number of indexes in the folder + /// \param theParent - index of parent folder + void rebuildBranch(int theRow, int theCount, const QModelIndex& theParent = QModelIndex()); + + /// Returns list of folders types which can not be shown empty /// \param fromRoot - root document flag QStringList listOfShowNotEmptyFolders(bool fromRoot = true) const;