#include <Events_Listener.h>
#include <QList>
+#include <QMap>
class ModelAPI_Document;
class PartSet_PartModel;
return myActivePartIndex;
}
+ //! Returns parent index of active part tree (index of Part feature)
+ QModelIndex activePartTree() const;
+
//! Deactivates a Part
void deactivatePart();
//! \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.
//! 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;
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;
QList<PartSet_PartModel*> myPartModels;
//! Active part in part editing mode
- PartSet_PartModel* myActivePart;
+ PartSet_PartModel* myActivePartModel;
QModelIndex myActivePartIndex;
//! List of saved QModelIndexes created by sub-models
QList<QModelIndex*> myIndexes;
- int myHistoryBackOffset;
-
static QMap<QString, QString> myIcons;
};