#include <QIcon>
-XGUI_TopDataModel::XGUI_TopDataModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
+XGUI_TopDataModel::XGUI_TopDataModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
: XGUI_FeaturesModel(theDocument, theParent)
{
}
return tr("Parameters");
case ParamObject:
{
- std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row());
+ boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARAMETERS_GROUP, theIndex.row());
if (aFeature)
return aFeature->data()->getName().c_str();
}
return tr("Constructions");
case ConstructObject:
{
- std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
+ boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
return aFeature->data()->getName().c_str();
}
}
-QModelIndex XGUI_TopDataModel::findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const
+QModelIndex XGUI_TopDataModel::findParent(const boost::shared_ptr<ModelAPI_Feature>& 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();
}
//******************************************************************
//******************************************************************
//******************************************************************
-XGUI_PartDataModel::XGUI_PartDataModel(const std::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
+XGUI_PartDataModel::XGUI_PartDataModel(const boost::shared_ptr<ModelAPI_Document>& theDocument, QObject* theParent)
: XGUI_PartModel(theDocument, theParent)
{
}
switch (theIndex.internalId()) {
case MyRoot:
{
- std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
+ boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
if (aFeature)
return aFeature->data()->getName().c_str();
}
return tr("Constructions");
case ParamObject:
{
- std::shared_ptr<ModelAPI_Feature> aFeature =
+ boost::shared_ptr<ModelAPI_Feature> aFeature =
featureDocument()->feature(PARAMETERS_GROUP, theIndex.row());
if (aFeature)
return aFeature->data()->getName().c_str();
}
case ConstructObject:
{
- std::shared_ptr<ModelAPI_Feature> aFeature =
+ boost::shared_ptr<ModelAPI_Feature> aFeature =
featureDocument()->feature(CONSTRUCTIONS_GROUP, theIndex.row());
if (aFeature)
return aFeature->data()->getName().c_str();
}
-std::shared_ptr<ModelAPI_Document> XGUI_PartDataModel::featureDocument() const
+boost::shared_ptr<ModelAPI_Document> XGUI_PartDataModel::featureDocument() const
{
- std::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
+ boost::shared_ptr<ModelAPI_Feature> aFeature = myDocument->feature(PARTS_GROUP, myId);
return aFeature->data()->docRef("PartDocument")->value();
}
return FeaturePtr();
}
-bool XGUI_PartDataModel::hasDocument(const std::shared_ptr<ModelAPI_Document>& theDoc) const
+bool XGUI_PartDataModel::hasDocument(const boost::shared_ptr<ModelAPI_Document>& theDoc) const
{
return (featureDocument() == theDoc);
}
-QModelIndex XGUI_PartDataModel::findParent(const std::shared_ptr<ModelAPI_Feature>& theFeature) const
+QModelIndex XGUI_PartDataModel::findParent(const boost::shared_ptr<ModelAPI_Feature>& 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();
}