X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FXGUI%2FXGUI_DataTreeModel.h;h=fb28e59f8406154317e05ff487e3527ef13c7482;hb=331d9cfcdfa7db2c280e047b01ceac7196cbf335;hp=0b8844e2f494414f3874424e701b3c5ccadd1fe7;hpb=b2fed461882656495c33d4fec61e2ec22d9cf80a;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_DataTreeModel.h b/src/XGUI/XGUI_DataTreeModel.h index 0b8844e2f..fb28e59f8 100644 --- a/src/XGUI/XGUI_DataTreeModel.h +++ b/src/XGUI/XGUI_DataTreeModel.h @@ -1,9 +1,9 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> #ifndef XGUI_DataTreeModel_H #define XGUI_DataTreeModel_H #include "XGUI.h" -#include "XGUI_Constants.h" #include #include @@ -18,12 +18,18 @@ */ class XGUI_EXPORT XGUI_FeaturesModel : public QAbstractItemModel { -public: - XGUI_FeaturesModel(QObject* theParent): - QAbstractItemModel(theParent), myItemsColor(Qt::black) {} + public: + /// Constructor + /// \param theParent a parent object + 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 + /// \param theIndex a model index virtual ObjectPtr object(const QModelIndex& theIndex) const = 0; //! Returns QModelIndex which corresponds to the given feature @@ -34,39 +40,57 @@ public: virtual QModelIndex findParent(const ObjectPtr& theObject) const = 0; //! Returns index corresponded to the group + //! \param theGroup a group name virtual QModelIndex findGroup(const std::string& theGroup) const = 0; - void setItemsColor(const QColor& theColor) { myItemsColor = theColor; } + //! Set color of items + void setItemsColor(const QColor& theColor) + { + myItemsColor = theColor; + } - QColor itemsColor() const { return myItemsColor; } + //! Returns color of items + QColor itemsColor() const + { + return myItemsColor; + } -protected: + protected: + /// Color of items QColor myItemsColor; }; - /**\class XGUI_PartModel * \ingroup GUI * \brief Abstaract class of model object which operates with parts data. */ class XGUI_PartModel : public XGUI_FeaturesModel { -public: - XGUI_PartModel(QObject* theParent): - XGUI_FeaturesModel(theParent) {} - - void setPartId(int theId) { myId = theId; } + public: + /// Constructor + /// \param theParent a parent object + XGUI_PartModel(QObject* theParent) + : XGUI_FeaturesModel(theParent) + { + } + + /// Set part id + /// \param theId a new id + void setPartId(int theId) + { + myId = theId; + } //! Returns true if the given document is a sub-document of this tree + //! \param theDoc a document to check virtual bool hasDocument(const DocumentPtr& theDoc) const = 0; //! Return a Part object virtual ResultPartPtr part() const = 0; -protected: + protected: //! Id of the current part object in the document int myId; }; - -#endif \ No newline at end of file +#endif