1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: ModuleBase_IDocumentDataModel.h
4 // Created: 28 Apr 2015
5 // Author: Vitaly SMETANNIKOV
8 #ifndef ModuleBase_IDocumentDataModel_H
9 #define ModuleBase_IDocumentDataModel_H
11 #include "ModuleBase.h"
12 #include <QAbstractItemModel>
13 #include <ModelAPI_Object.h>
15 class MODULEBASE_EXPORT ModuleBase_IDocumentDataModel : public QAbstractItemModel
19 ModuleBase_IDocumentDataModel(QObject* theParent): QAbstractItemModel(theParent) {}
21 //! Returns an object by the given Model index.
22 //! Returns 0 if the given index is not index of an object
23 virtual ObjectPtr object(const QModelIndex& theIndex) const = 0;
25 //! Returns index of the object
26 //! \param theObject object to find
27 virtual QModelIndex objectIndex(const ObjectPtr theObject) const = 0;
29 //! Clear internal data
30 virtual void clear() {}
33 virtual void rebuildDataTree() {}