#include "PartSet_WidgetSketchCreator.h"
#include "PartSet_SketcherMgr.h"
#include "PartSet_MenuMgr.h"
-#include <PartSet_CustomPrs.h>
+#include "PartSet_CustomPrs.h"
+#include "PartSet_IconFactory.h"
#include "PartSet_Filters.h"
#include "PartSet_FilterInfinite.h"
#include <XGUI_Tools.h>
#include <XGUI_ObjectsBrowser.h>
#include <XGUI_SelectionMgr.h>
+#include <XGUI_DataModel.h>
#include <SketchPlugin_Feature.h>
#include <SketchPlugin_Sketch.h>
: ModuleBase_IModule(theWshop),
myRestartingMode(RM_None), myVisualLayerId(0)
{
+ new PartSet_IconFactory();
+
mySketchMgr = new PartSet_SketcherMgr(this);
myDataModel = new PartSet_DocumentDataModel(this);
SessionPtr aMgr = ModelAPI_Session::get();
DocumentPtr aActiveDoc = aMgr->activeDocument();
- DocumentPtr aDoc = aMgr->moduleDocument();
+#ifdef ModuleDataModel
QModelIndex aOldIndex = myDataModel->activePartTree();
+ DocumentPtr aDoc = aMgr->moduleDocument();
if (aActiveDoc == aDoc) {
if (aOldIndex.isValid())
aTreeView->setExpanded(aOldIndex, false);
}
}
}
+#else
+ // Problem with MPV: At first time on creation it doesn't work because Part feature
+ // creation event will be sent after
+ if (aActivePartIndex.isValid())
+ aTreeView->setExpanded(aActivePartIndex, false);
+ XGUI_DataModel* aDataModel = aWorkshop->objectBrowser()->dataModel();
+ aActivePartIndex = aDataModel->documentRootIndex(aActiveDoc);
+ if (aActivePartIndex.isValid())
+ aTreeView->setExpanded(aActivePartIndex, true);
+#endif
aLabel->setPalette(aPalet);
aWorkshop->updateCommandStatus();