+
+
+void PartSet_Module::onViewCreated(ModuleBase_IViewWindow*)
+{
+ // z layer is created for all started operations in order to visualize operation AIS presentation
+ // over the object
+ Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
+ if (aContext.IsNull())
+ return;
+
+ Handle(V3d_Viewer) aViewer = aContext->CurrentViewer();
+ if (myVisualLayerId == 0) {
+ if (myVisualLayerId == 0)
+ aViewer->AddZLayer(myVisualLayerId);
+ } else {
+ TColStd_SequenceOfInteger aZList;
+ aViewer->GetAllZLayers(aZList);
+ bool aFound = false;
+ for (int i = 1; i <= aZList.Length(); i++) {
+ if (aZList(i) == myVisualLayerId) {
+ aFound = true;
+ break;
+ }
+ }
+ if (!aFound)
+ aViewer->AddZLayer(myVisualLayerId);
+ }
+ // if there is an active operation with validated widget,
+ // the filters of this widget should be activated in the created view
+ ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+ if (aOperation) {
+ ModuleBase_ModelWidget* anActiveWidget = activeWidget();
+ if (anActiveWidget) {
+ ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(anActiveWidget);
+ if (aWSelector)
+ aWSelector->activateSelectionAndFilters(true);
+ }
+ }
+}
+
+//******************************************************
+void PartSet_Module::widgetStateChanged(int thePreviousState)
+{
+ mySketchMgr->widgetStateChanged(thePreviousState);
+}
+
+bool PartSet_Module::processEnter(const std::string& thePreviousAttributeID)
+{
+ return mySketchReentrantMgr->processEnter(thePreviousAttributeID);
+}
+
+
+//******************************************************
+void PartSet_Module::onBooleanOperationChange(int theOperation)
+{
+ ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+ if (!aOperation)
+ return;
+ ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
+ switch (theOperation) {
+ case 0:
+ aPanel->setWindowTitle(tr("Cut"));
+ break;
+ case 1:
+ aPanel->setWindowTitle(tr("Fuse"));
+ break;
+ case 2:
+ aPanel->setWindowTitle(tr("Common"));
+ break;
+ }
+}