Salome HOME
1. Compound selection choice is provided for sketch selection in Extrusion operation...
[modules/shaper.git] / src / PartSet / PartSet_DocumentDataModel.h
index 3631f79850bbf0f162180cf277e7ffca4b612d89..e059a1f4e50aef64493fdb5be4787fe70ac8b605 100644 (file)
@@ -133,16 +133,20 @@ Q_OBJECT
   //! \param theIndex a last index for history
   void setLastHistoryItem(const QModelIndex& theIndex);
 
+  //! Returns last history item
   QModelIndex lastHistoryItem() const;
 
   //! Returns icon name according to feature
   static QIcon featureIcon(const FeaturePtr& theFeature);
 
+ public slots:
+   void onMouseDoubleClick(const QModelIndex& theIndex);
+
  private:
 
   enum
   {
-    PartsFolder = -100,
+    PartsFolder,
     HistoryNode,
     PartResult
   };
@@ -165,6 +169,9 @@ Q_OBJECT
   //! Removes sub-model on removing a part object. Also it removes QModelIndex-es which refer to this model
   void removeSubModel(int theModelId);
 
+  //! Removes sub-model on removing a part object. Also it removes QModelIndex-es which refer to this model
+  void removeSubModel(PartSet_PartModel* theModel);
+
   //! Returns true if the given model is a one of sub-models (of both types)
   bool isSubModel(const QAbstractItemModel* theModel) const;
 
@@ -179,22 +186,24 @@ Q_OBJECT
 
   int historyOffset() const;
 
+  PartSet_PartModel* findPartModel(FeaturePtr thePart) const;
+
+  PartSet_PartModel* findPartModel(int thePosition) const;
+
   //! Data model of top part of data tree (not parts object)
   PartSet_TopDataModel* myModel;
 
   //! Data models for Parts data tree representation (one data model per a one part)
-  QMap<int, PartSet_PartModel*> myPartModels;
+  QList<PartSet_PartModel*> myPartModels;
 
   //! Active part in part editing mode
-  int myActivePartId;
+  PartSet_PartModel* myActivePartModel;
 
   QModelIndex myActivePartIndex;
 
   //! List of saved QModelIndexes created by sub-models
   QList<QModelIndex*> myIndexes;
 
-  int myHistoryBackOffset;
-
   static QMap<QString, QString> myIcons;
 };