+void PartSet_Module::customizeObject(ObjectPtr theObject)
+{
+ if (myCustomPrs->isActive())
+ myCustomPrs->customize(theObject);
+}
+
+void PartSet_Module::customizeObjectBrowser(QWidget* theObjectBrowser)
+{
+ XGUI_ObjectsBrowser* aOB = dynamic_cast<XGUI_ObjectsBrowser*>(theObjectBrowser);
+ if (aOB) {
+ QLineEdit* aLabel = aOB->activeDocLabel();
+ QPalette aPalet = aLabel->palette();
+ aPalet.setColor(QPalette::Text, QColor(0, 72, 140));
+ aLabel->setPalette(aPalet);
+ aOB->treeView()->setExpandsOnDoubleClick(false);
+#ifdef ModuleDataModel
+ connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)),
+ SLOT(onTreeViewDoubleClick(const QModelIndex&)));
+ connect(aOB, SIGNAL(headerMouseDblClicked(const QModelIndex&)),
+ SLOT(onTreeViewDoubleClick(const QModelIndex&)));
+ connect(aOB->treeView(), SIGNAL(doubleClicked(const QModelIndex&)),
+ myDataModel, SLOT(onMouseDoubleClick(const QModelIndex&)));
+#endif
+ }
+}
+
+ObjectPtr PartSet_Module::findPresentedObject(const AISObjectPtr& theAIS) const
+{
+ ObjectPtr anObject;
+ ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+ if (aOperation) {
+ /// If last line finished on vertex the lines creation sequence has to be break
+ ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
+ ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
+ // if there is an active widget, find the presented object in it
+ if (!anActiveWidget)
+ anActiveWidget = aPanel->preselectionWidget();
+
+ ModuleBase_WidgetValidated* aWidgetValidated = dynamic_cast<ModuleBase_WidgetValidated*>
+ (anActiveWidget);
+ if (aWidgetValidated)
+ anObject = aWidgetValidated->findPresentedObject(theAIS);
+ }
+ return anObject;
+}