X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_PartDataModel.h;h=1012f2d6f8fdd22f214be3b9aeb3c33819b53c38;hb=857b1f72d9703c46c6c8c9bb239821d314344c86;hp=c821b4b5024826c35b5ad94544dc3bd2f9dca8ed;hpb=18dab619179f5dd1f89aedce9154d6802b0de27f;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_PartDataModel.h b/src/PartSet/PartSet_PartDataModel.h index c821b4b50..1012f2d6f 100644 --- a/src/PartSet/PartSet_PartDataModel.h +++ b/src/PartSet/PartSet_PartDataModel.h @@ -6,88 +6,6 @@ #include "PartSet.h" #include "PartSet_DataTreeModel.h" -/**\class PartSet_TopDataModel - * \ingroup GUI - * \brief This is a data model for Object Browser (QTreeView). - * It represents only upper part of data tree (non-parts tree items) - */ -class PARTSET_EXPORT PartSet_TopDataModel : public PartSet_FeaturesModel -{ -Q_OBJECT - public: - /// Constructor - /// \param theParent a parent object - PartSet_TopDataModel(QObject* theParent); - virtual ~PartSet_TopDataModel(); - - // Reimpl from QAbstractItemModel - - /// Returns the data stored under the given role for the item referred to by the index. - /// \param theIndex a model index - /// \param theRole a data role (see Qt::ItemDataRole) - virtual QVariant data(const QModelIndex& theIndex, int theRole) const; - - /// Returns the data for the given role and section in the header with the specified orientation. - /// \param theSection a section - /// \param theOrient an orientation - /// \param theRole a data role (see Qt::ItemDataRole) - virtual QVariant headerData(int theSection, Qt::Orientation theOrient, - int theRole = Qt::DisplayRole) const; - - /// Returns the number of rows under the given parent. When the parent is valid it means that - /// rowCount is returning the number of children of parent. - /// \param theParent a parent model index - virtual int rowCount(const QModelIndex &theParent = QModelIndex()) const; - - /// Returns the number of columns for the children of the given parent. - /// It has a one column - /// \param theParent a parent model index - virtual int columnCount(const QModelIndex &theParent = QModelIndex()) const; - - - /// Returns the index of the item in the model specified by the given row, column and parent index. - /// \param theRow a row - /// \param theColumn a column - /// \param theParent a parent model index - virtual QModelIndex index(int theRow, int theColumn, const QModelIndex& theParent = - QModelIndex()) const; - - /// Returns the parent of the model item with the given index. - /// If the item has no parent, an invalid QModelIndex is returned. - /// \param theIndex a model index - virtual QModelIndex parent(const QModelIndex& theIndex) const; - - /// Returns true if parent has any children; otherwise returns false. - /// \param theParent a parent model index - virtual bool hasChildren(const QModelIndex& theParent = QModelIndex()) const; - - //! Returns object by the given Model index. - //! Returns 0 if the given index is not index of a object - virtual ObjectPtr object(const QModelIndex& theIndex) const; - - //! Returns QModelIndex which corresponds to the given object - //! If the object is not found then index is not valid - virtual QModelIndex objectIndex(const ObjectPtr& theObject) const; - - //! Returns parent index of the given object - virtual QModelIndex findParent(const ObjectPtr& theObject) const; - - //! Returns index corresponded to the group - virtual QModelIndex findGroup(const std::string& theGroup) const; - - private: - //! Types of QModelIndexes - enum DataIds - { - ParamsFolder, - ParamObject, - ConstructFolder, - ConstructObject - //GroupsFolder, - //GroupObject - }; - -}; /**\class PartSet_PartDataModel * \ingroup GUI @@ -164,9 +82,6 @@ Q_OBJECT //! Returns index corresponded to the group virtual QModelIndex findGroup(const std::string& theGroup) const; - //! Return a Part object - virtual ResultPartPtr part() const; - //! Set an Index which will be considered as a last history index //! \param theIndex a last index for history void setLastHistoryItem(const QModelIndex& theIndex); @@ -185,10 +100,11 @@ Q_OBJECT int lastHistoryRow() const; //! Types of QModelIndexes + //! All types have negative Id's. Positive Id means sub-feature and contains row of its parent enum DataIds { //MyRoot, - ParamsFolder, + ParamsFolder = -100, ParamObject, ConstructFolder, ConstructObject, @@ -198,8 +114,6 @@ Q_OBJECT GroupObject, HistoryObject }; - - int myHistoryBackOffset; }; #endif