#include "XGUI_Workshop.h"
#include "XGUI_Tools.h"
-#include <ModelAPI_PluginManager.h>
+#include <ModelAPI_Session.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Feature.h>
#include <ModelAPI_Data.h>
void XGUI_DocumentDataModel::processEvent(const Events_Message* theMessage)
{
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
// Created object event *******************
if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
void XGUI_DocumentDataModel::rebuildDataTree()
{
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
beginResetModel();
clearModelIndexes();
case HistoryNode:
{
int aOffset = historyOffset();
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
ObjectPtr aObj = aRootDoc->object(ModelAPI_Feature::group(), theIndex.row() - aOffset);
FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
if (!aFeature)
int XGUI_DocumentDataModel::rowCount(const QModelIndex& theParent) const
{
if (!theParent.isValid()) {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
// Size of external models
int aVal = historyOffset();
// Plus history size
if (theIndex.internalId() == PartsFolder)
return ObjectPtr();
if (theIndex.internalId() == HistoryNode) {
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
int aOffset = historyOffset();
return aRootDoc->object(ModelAPI_Feature::group(), theIndex.row() - aOffset);
}
QModelIndex XGUI_DocumentDataModel::objectIndex(const ObjectPtr theObject) const
{
// Check that this feature belongs to root document
- DocumentPtr aRootDoc = ModelAPI_PluginManager::get()->rootDocument();
+ DocumentPtr aRootDoc = ModelAPI_Session::get()->rootDocument();
DocumentPtr aDoc = theObject->document();
if (aDoc == aRootDoc) {
// This feature belongs to histrory or top model