Salome HOME
Hide command icon added
[modules/shaper.git] / src / XGUI / XGUI_DataTreeModel.h
index 42c609dac5f2c382b948a2cf30a2a80c7fa411a6..5b9f5a8394f4c2ec8c6d8fc74cab6db593ba8252 100644 (file)
 class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel
 {
 public:
-  XGUI_FeaturesModel(const DocumentPtr& theDocument, QObject* theParent):
-      QAbstractItemModel(theParent), myDocument(theDocument), myItemsColor(Qt::black) {}
+  XGUI_FeaturesModel(QObject* theParent):
+      QAbstractItemModel(theParent), myItemsColor(Qt::black) {}
 
   //! Returns Feature object by the given Model index.
   //! Returns 0 if the given index is not index of a feature
   virtual FeaturePtr feature(const QModelIndex& theIndex) const = 0;
 
+  //! Returns QModelIndex which corresponds to the given feature
+  //! If the feature is not found then index is not valid
+  virtual QModelIndex featureIndex(const FeaturePtr& theFeature) const = 0;
+
   //! Returns parent index of the given feature
   virtual QModelIndex findParent(const FeaturePtr& theFeature) const = 0;
 
@@ -36,7 +40,6 @@ public:
   QColor itemsColor() const { return myItemsColor; }
 
 protected:
-  boost::shared_ptr<ModelAPI_Document> myDocument;
   QColor myItemsColor;
 };
 
@@ -48,8 +51,8 @@ protected:
 class XGUI_PartModel : public XGUI_FeaturesModel
 {
 public:
-  XGUI_PartModel(const DocumentPtr& theDocument, QObject* theParent):
-      XGUI_FeaturesModel(theDocument, theParent) {}
+  XGUI_PartModel(QObject* theParent):
+      XGUI_FeaturesModel(theParent) {}
 
   void setPartId(int theId) { myId = theId; }