X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_DocumentDataModel.h;h=e059a1f4e50aef64493fdb5be4787fe70ac8b605;hb=65bd7c71b6eda2cad73adcc3be6c6ad725c26b94;hp=942d157bad8aa1e47dcd3f1ea948c10176e2b90a;hpb=b1a9aba9a812f170668d0f4e04b3501d91da425e;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_DocumentDataModel.h b/src/PartSet/PartSet_DocumentDataModel.h index 942d157ba..e059a1f4e 100644 --- a/src/PartSet/PartSet_DocumentDataModel.h +++ b/src/PartSet/PartSet_DocumentDataModel.h @@ -11,6 +11,7 @@ #include #include +#include class ModelAPI_Document; class PartSet_PartModel; @@ -116,6 +117,9 @@ Q_OBJECT return myActivePartIndex; } + //! Returns parent index of active part tree (index of Part feature) + QModelIndex activePartTree() const; + //! Deactivates a Part void deactivatePart(); @@ -129,17 +133,22 @@ 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, - HistoryNode + HistoryNode, + PartResult }; //! Converts QModelIndex of this model to QModelIndex of a one of sub-models. @@ -160,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; @@ -174,6 +186,10 @@ 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; @@ -181,15 +197,13 @@ Q_OBJECT QList myPartModels; //! Active part in part editing mode - PartSet_PartModel* myActivePart; + PartSet_PartModel* myActivePartModel; QModelIndex myActivePartIndex; //! List of saved QModelIndexes created by sub-models QList myIndexes; - int myHistoryBackOffset; - static QMap myIcons; };