X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_PartDataModel.cpp;h=ba5bbbea33ddeb56b71e88afd3bc741fe9ec67ff;hb=d86c77d1c6210bbe04fbc3e5b00f9e212e1ec930;hp=40f4671db277b9c204dc6da0ad184043f3f83b8f;hpb=1b6e67870beeeb667864eaff5b1bb9c1570b7259;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_PartDataModel.cpp b/src/XGUI/XGUI_PartDataModel.cpp index 40f4671db..ba5bbbea3 100644 --- a/src/XGUI/XGUI_PartDataModel.cpp +++ b/src/XGUI/XGUI_PartDataModel.cpp @@ -9,7 +9,7 @@ #include -XGUI_TopDataModel::XGUI_TopDataModel(const std::shared_ptr& theDocument, QObject* theParent) +XGUI_TopDataModel::XGUI_TopDataModel(const boost::shared_ptr& theDocument, QObject* theParent) : XGUI_FeaturesModel(theDocument, theParent) { } @@ -29,7 +29,7 @@ QVariant XGUI_TopDataModel::data(const QModelIndex& theIndex, int theRole) const return tr("Parameters"); case ParamObject: { - std::shared_ptr aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row()); + boost::shared_ptr aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row()); if (aFeature) return aFeature->data()->getName().c_str(); } @@ -37,7 +37,7 @@ QVariant XGUI_TopDataModel::data(const QModelIndex& theIndex, int theRole) const return tr("Constructions"); case ConstructObject: { - std::shared_ptr aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row()); + boost::shared_ptr aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row()); if (aFeature) return aFeature->data()->getName().c_str(); } @@ -141,23 +141,23 @@ FeaturePtr XGUI_TopDataModel::feature(const QModelIndex& theIndex) const } -QModelIndex XGUI_TopDataModel::findParent(const std::shared_ptr& theFeature) const +QModelIndex XGUI_TopDataModel::findParent(const boost::shared_ptr& theFeature) const { QString aGroup(theFeature->getGroup().c_str()); if (theFeature->getGroup().compare(PARAMETERS_GROUP) == 0) - return createIndex(0, 0, (quintptr) ParamsFolder); + return createIndex(0, 0, (qint32) ParamsFolder); if (theFeature->getGroup().compare(CONSTRUCTIONS_GROUP) == 0) - return createIndex(1, 0, (quintptr) ConstructFolder); + return createIndex(1, 0, (qint32) ConstructFolder); return QModelIndex(); } QModelIndex XGUI_TopDataModel::findGroup(const std::string& theGroup) const { if (theGroup.compare(PARAMETERS_GROUP) == 0) - return createIndex(0, 0, (quintptr) ParamsFolder); + return createIndex(0, 0, (qint32) ParamsFolder); if (theGroup.compare(CONSTRUCTIONS_GROUP) == 0) - return createIndex(1, 0, (quintptr) ConstructFolder); + return createIndex(1, 0, (qint32) ConstructFolder); return QModelIndex(); } @@ -165,7 +165,7 @@ QModelIndex XGUI_TopDataModel::findGroup(const std::string& theGroup) const //****************************************************************** //****************************************************************** //****************************************************************** -XGUI_PartDataModel::XGUI_PartDataModel(const std::shared_ptr& theDocument, QObject* theParent) +XGUI_PartDataModel::XGUI_PartDataModel(const boost::shared_ptr& theDocument, QObject* theParent) : XGUI_PartModel(theDocument, theParent) { } @@ -183,7 +183,7 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons switch (theIndex.internalId()) { case MyRoot: { - std::shared_ptr aFeature = myDocument->feature(PARTS_GROUP, myId); + boost::shared_ptr aFeature = myDocument->feature(PARTS_GROUP, myId); if (aFeature) return aFeature->data()->getName().c_str(); } @@ -193,14 +193,14 @@ QVariant XGUI_PartDataModel::data(const QModelIndex& theIndex, int theRole) cons return tr("Constructions"); case ParamObject: { - std::shared_ptr aFeature = + boost::shared_ptr aFeature = featureDocument()->feature(PARAMETERS_GROUP, theIndex.row()); if (aFeature) return aFeature->data()->getName().c_str(); } case ConstructObject: { - std::shared_ptr aFeature = + boost::shared_ptr aFeature = featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row()); if (aFeature) return aFeature->data()->getName().c_str(); @@ -299,9 +299,9 @@ bool XGUI_PartDataModel::hasChildren(const QModelIndex& theParent) const } -std::shared_ptr XGUI_PartDataModel::featureDocument() const +boost::shared_ptr XGUI_PartDataModel::featureDocument() const { - std::shared_ptr aFeature = myDocument->feature(PARTS_GROUP, myId); + boost::shared_ptr aFeature = myDocument->feature(PARTS_GROUP, myId); return aFeature->data()->docRef("PartDocument")->value(); } @@ -321,28 +321,28 @@ FeaturePtr XGUI_PartDataModel::feature(const QModelIndex& theIndex) const return FeaturePtr(); } -bool XGUI_PartDataModel::hasDocument(const std::shared_ptr& theDoc) const +bool XGUI_PartDataModel::hasDocument(const boost::shared_ptr& theDoc) const { return (featureDocument() == theDoc); } -QModelIndex XGUI_PartDataModel::findParent(const std::shared_ptr& theFeature) const +QModelIndex XGUI_PartDataModel::findParent(const boost::shared_ptr& theFeature) const { QString aGroup(theFeature->getGroup().c_str()); if (theFeature->getGroup().compare(PARAMETERS_GROUP) == 0) - return createIndex(0, 0, (quintptr) ParamsFolder); + return createIndex(0, 0, (qint32) ParamsFolder); if (theFeature->getGroup().compare(CONSTRUCTIONS_GROUP) == 0) - return createIndex(1, 0, (quintptr) ConstructFolder); + return createIndex(1, 0, (qint32) ConstructFolder); return QModelIndex(); } QModelIndex XGUI_PartDataModel::findGroup(const std::string& theGroup) const { if (theGroup.compare(PARAMETERS_GROUP) == 0) - return createIndex(0, 0, (quintptr) ParamsFolder); + return createIndex(0, 0, (qint32) ParamsFolder); if (theGroup.compare(CONSTRUCTIONS_GROUP) == 0) - return createIndex(1, 0, (quintptr) ConstructFolder); + return createIndex(1, 0, (qint32) ConstructFolder); return QModelIndex(); }