3 #ifndef XGUI_DataTreeModel_H
4 #define XGUI_DataTreeModel_H
6 #include <ModelAPI_Document.h>
7 #include <QAbstractItemModel>
9 #include "XGUI_Constants.h"
11 /**\class XGUI_FeaturesModel
13 * \brief Abstaract class of model object which operates with features data.
15 class XGUI_FeaturesModel : public QAbstractItemModel
18 XGUI_FeaturesModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
19 QAbstractItemModel(theParent), myDocument(theDocument) {}
21 //! Returns Feature object by the given Model index.
22 //! Returns 0 if the given index is not index of a feature
23 virtual FeaturePtr feature(const QModelIndex& theIndex) const = 0;
26 std::shared_ptr<ModelAPI_Document> myDocument;
30 /**\class XGUI_PartModel
32 * \brief Abstaract class of model object which operates with parts data.
34 class XGUI_PartModel : public XGUI_FeaturesModel
37 XGUI_PartModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent):
38 XGUI_FeaturesModel(theDocument, theParent) {}
40 void setPartId(int theId) { myId = theId; }
43 //! Id of the current part object in the document