#include "XGUI_PartDataModel.h"
#include "XGUI_Workshop.h"
-#include <ModelAPI_PluginManager.h>
+#include <ModelAPI_Session.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Result.h>
case ParamsFolder:
return tr("Parameters") + QString(" (%1)").arg(rowCount(theIndex));
case ParamObject: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultParameters::group(), theIndex.row());
if (aObject)
return aObject->data()->name().c_str();
case ConstructFolder:
return tr("Constructions") + QString(" (%1)").arg(rowCount(theIndex));
case ConstructObject: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultConstruction::group(),
theIndex.row());
if (aObject)
case BodiesFolder:
return tr("Bodies") + QString(" (%1)").arg(rowCount(theIndex));
case BodiesObject: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultBody::group(), theIndex.row());
if (aObject)
return aObject->data()->name().c_str();
if (!theParent.isValid())
return 3;
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
if (theParent.internalId() == ParamsFolder)
return aRootDoc->size(ModelAPI_ResultParameters::group());
case BodiesFolder:
return ObjectPtr();
case ParamObject: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
return aRootDoc->object(ModelAPI_ResultParameters::group(), theIndex.row());
}
case ConstructObject: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
return aRootDoc->object(ModelAPI_ResultConstruction::group(), theIndex.row());
}
case BodiesObject: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
return aRootDoc->object(ModelAPI_ResultBody::group(), theIndex.row());
}
}
{
QModelIndex aIndex;
if (theObject) {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
std::string aGroup = theObject->groupName();
int aNb = aRootDoc->size(aGroup);
int aRow = -1;
// return a name
switch (theIndex.internalId()) {
case MyRoot: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), myId);
if (aObject)
return boost::dynamic_pointer_cast<ModelAPI_Object>(aObject)->data()->name().c_str();
int XGUI_PartDataModel::rowCount(const QModelIndex& parent) const
{
if (!parent.isValid()) {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
if (aRootDoc->object(ModelAPI_ResultPart::group(), myId))
return 1;
else
DocumentPtr XGUI_PartDataModel::partDocument() const
{
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObject = aRootDoc->object(ModelAPI_ResultPart::group(), myId);
ResultPartPtr aPart = boost::dynamic_pointer_cast<ModelAPI_ResultPart>(aObject);
return aPart->partDoc();
{
switch (theIndex.internalId()) {
case MyRoot: {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
return aRootDoc->object(ModelAPI_ResultPart::group(), myId);
}
case ParamsFolder:
ResultPartPtr XGUI_PartDataModel::part() const
{
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObj = aRootDoc->object(ModelAPI_ResultPart::group(), myId);
return boost::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
}