Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue #2521: Use Salome module icon
[modules/shaper.git]
/
src
/
XGUI
/
XGUI_DataModel.h
diff --git
a/src/XGUI/XGUI_DataModel.h
b/src/XGUI/XGUI_DataModel.h
index 9052260aa6554d85ea48355e660f655caf69f715..e89546161dda5a6b3a564dcc0fe37741a607a222 100644
(file)
--- a/
src/XGUI/XGUI_DataModel.h
+++ b/
src/XGUI/XGUI_DataModel.h
@@
-30,6
+30,7
@@
#include <QAbstractItemModel>
class Config_DataModelReader;
#include <QAbstractItemModel>
class Config_DataModelReader;
+class XGUI_Workshop;
/**\class XGUI_DataModel
* \ingroup GUI
/**\class XGUI_DataModel
* \ingroup GUI
@@
-63,7
+64,7
@@
public:
//! Returns index of the object
//! \param theObject object to find
//! Returns index of the object
//! \param theObject object to find
- virtual QModelIndex objectIndex(const ObjectPtr theObject) const;
+ virtual QModelIndex objectIndex(const ObjectPtr theObject
, int theColumn = 1
) const;
//! Clear internal data
virtual void clear();
//! Clear internal data
virtual void clear();
@@
-130,7
+131,7
@@
public:
/// Returns an index which is root of the given document
/// \param theDoc a document
/// Returns an index which is root of the given document
/// \param theDoc a document
- QModelIndex documentRootIndex(DocumentPtr theDoc) const;
+ QModelIndex documentRootIndex(DocumentPtr theDoc
, int theColumn = 1
) const;
/// Returns last history object index
virtual QModelIndex lastHistoryIndex() const;
/// Returns last history object index
virtual QModelIndex lastHistoryIndex() const;
@@
-141,14
+142,25
@@
public:
/// Do not processing anymore events of model loop
//bool blockEventsProcessing(const bool theState);
/// Do not processing anymore events of model loop
//bool blockEventsProcessing(const bool theState);
+ /// Returns true if the data model item has Hidden visual state
+ /// \param theIndex a tree model item
+ /// \return boolean value
+ bool hasHiddenState(const QModelIndex& theIndex);
+
signals:
/// Signal about tree had been rebuilt
void treeRebuilt();
private:
signals:
/// Signal about tree had been rebuilt
void treeRebuilt();
private:
+ enum VisibilityState {
+ NoneState,
+ Visible,
+ SemiVisible,
+ Hidden };
+
/// Find a root index which contains objects of the given document
/// \param theDoc the document object
/// Find a root index which contains objects of the given document
/// \param theDoc the document object
- QModelIndex findDocumentRootIndex(const ModelAPI_Document* theDoc) const;
+ QModelIndex findDocumentRootIndex(const ModelAPI_Document* theDoc
, int aColumn = 1
) const;
/// Returns number of folders in document.
/// Considered folders which has to be shown only if they are not empty.
/// Returns number of folders in document.
/// Considered folders which has to be shown only if they are not empty.
@@
-171,11
+183,15
@@
private:
/// \param theParent - index of parent folder
void rebuildBranch(int theRow, int theCount, const QModelIndex& theParent = QModelIndex());
/// \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;
/// Returns list of folders types which can not be shown empty
/// \param fromRoot - root document flag
QStringList listOfShowNotEmptyFolders(bool fromRoot = true) const;
+ int getNumberOfFolderItems(const ModelAPI_Folder* theFolder) const;
+ ObjectPtr getObjectInFolder(const ModelAPI_Folder* theFolder, int theId) const;
+
+ VisibilityState getVisibilityState(const QModelIndex& theIndex) const;
+
void addShownFolder(DocumentPtr theDoc, QString theFolder)
{
if (!myShownFolders.contains(theDoc)) {
void addShownFolder(DocumentPtr theDoc, QString theFolder)
{
if (!myShownFolders.contains(theDoc)) {
@@
-202,6
+218,7
@@
private:
Config_DataModelReader* myXMLReader;
Config_DataModelReader* myXMLReader;
+ XGUI_Workshop* myWorkshop;
QMap<DocumentPtr, QStringList> myShownFolders;
//bool myIsEventsProcessingBlocked;
};
QMap<DocumentPtr, QStringList> myShownFolders;
//bool myIsEventsProcessingBlocked;
};