1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include "SHAPERGUI.h"
22 #include "SHAPERGUI_DataModel.h"
23 #include "SHAPERGUI_OCCSelector.h"
24 #include <SHAPERGUI_NestedButton.h>
26 #include <XGUI_Workshop.h>
27 #include <XGUI_PropertyPanel.h>
28 #include <XGUI_ContextMenuMgr.h>
29 #include <XGUI_ObjectsBrowser.h>
30 #include <XGUI_OperationMgr.h>
31 #include <XGUI_Displayer.h>
32 #include <XGUI_MenuMgr.h>
33 #include <XGUI_FacesPanel.h>
34 #include <XGUI_SelectionActivate.h>
36 #include <ModuleBase_Operation.h>
37 #include <ModuleBase_Preferences.h>
38 #include <ModuleBase_ActionInfo.h>
39 #include <ModuleBase_IModule.h>
41 #include <LightApp_Application.h>
42 #include <LightApp_SelectionMgr.h>
43 #include <LightApp_OCCSelector.h>
44 #include <LightApp_Study.h>
45 #include <OCCViewer_ViewModel.h>
47 #include <SUIT_Selector.h>
48 #include <SUIT_Desktop.h>
49 #include <SUIT_ViewManager.h>
50 #include <SUIT_ResourceMgr.h>
51 #include <SUIT_DataBrowser.h>
53 #include <QtxPopupMgr.h>
54 #include <QtxActionMenuMgr.h>
55 #include <QtxActionToolMgr.h>
56 #include <QtxResourceMgr.h>
58 #include <Config_PropManager.h>
59 #include <Config_ModuleReader.h>
61 #include <AIS_ListOfInteractive.hxx>
62 #include <AIS_ListIteratorOfListOfInteractive.hxx>
64 #include <QDockWidget>
69 #define SALOME_PATCH_FOR_CTRL_WHEEL
72 SHAPERGUI_EXPORT CAM_Module* createModule()
74 return new SHAPERGUI();
77 SHAPERGUI_EXPORT char* getModuleVersion()
84 * Class for preferences management
86 class SHAPERGUI_PrefMgr: public ModuleBase_IPrefMgr
90 /// \param theMgr preferences manager of SALOME
91 /// \param theModName name of the module
92 SHAPERGUI_PrefMgr(LightApp_Preferences* theMgr, const QString& theModName):
93 myMgr(theMgr), myModName(theModName) {}
95 virtual int addPreference(const QString& theLbl, int pId,
96 SUIT_PreferenceMgr::PrefItemType theType,
97 const QString& theSection, const QString& theName )
99 return myMgr->addPreference(myModName, theLbl, pId, theType, theSection, theName);
102 virtual void setItemProperty(const QString& thePropName,
103 const QVariant& theValue,
104 const int theId = -1)
106 myMgr->setItemProperty(thePropName, theValue, theId);
110 virtual SUIT_PreferenceMgr* prefMgr() const { return myMgr; }
113 LightApp_Preferences* myMgr;
120 //******************************************************
121 SHAPERGUI::SHAPERGUI()
122 : LightApp_Module("SHAPER"),
123 mySelector(0), myIsOpened(0), myPopupMgr(0)
125 myWorkshop = new XGUI_Workshop(this);
126 connect(myWorkshop, SIGNAL(commandStatusUpdated()),
127 this, SLOT(onUpdateCommandStatus()));
129 myProxyViewer = new SHAPERGUI_SalomeViewer(this);
131 ModuleBase_Preferences::setResourceMgr(application()->resourceMgr());
132 ModuleBase_Preferences::loadCustomProps();
135 //******************************************************
136 SHAPERGUI::~SHAPERGUI()
140 //******************************************************
141 void SHAPERGUI::initialize(CAM_Application* theApp)
143 LightApp_Module::initialize(theApp);
145 myWorkshop->startApplication();
146 LightApp_Application* anApp = dynamic_cast<LightApp_Application*>(theApp);
149 connect(anApp, SIGNAL(preferenceResetToDefaults()), this, SLOT(onDefaultPreferences()));
153 //******************************************************
154 void SHAPERGUI::windows(QMap<int, int>& theWndMap) const
156 theWndMap.insert(LightApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea);
159 //******************************************************
160 void SHAPERGUI::viewManagers(QStringList& theList) const
162 theList.append(OCCViewer_Viewer::Type());
165 //******************************************************
166 // We can not create selector in this method because it can be called when
167 // SHAPER module is not active. Take into account that creation of our selector
168 // leads to switching OFF all other selectors
169 //void SHAPERGUI::connectToStudy(CAM_Study* theStudy)
171 // // if there are created viewer managers, we should try to create viewer
172 // // selector and initialize viewer with it. It sets interactive contect to the
173 // // proxy viewer. If study is opened, CAM application calls this method before the open()
175 // // the SHAPER data model is specific and during open(load) redisplay signals are flushed, so
176 // // we need to connect to the viewer before it. Here,
177 // // it seems the most appropriate place for this
178 // // according to SALOME architecture.
179 // if (!mySelector) {
180 // ViewManagerList OCCViewManagers;
181 // application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers);
182 // if (OCCViewManagers.size() > 0) {
183 // mySelector = createSelector(OCCViewManagers.first());
186 // LightApp_Module::connectToStudy(theStudy);
189 //******************************************************
190 bool SHAPERGUI::activateModule(SUIT_Study* theStudy)
192 bool isDone = LightApp_Module::activateModule(theStudy);
193 SHAPERGUI_DataModel* aDataModel = dynamic_cast<SHAPERGUI_DataModel*>(dataModel());
194 aDataModel->initRootObject();
200 QObject* aObj = myWorkshop->objectBrowser()->parent();
201 QDockWidget* aObjDoc = dynamic_cast<QDockWidget*>(aObj);
203 QAction* aViewAct = aObjDoc->toggleViewAction();
204 aViewAct->setEnabled(true);
205 myWorkshop->objectBrowser()->setVisible(true);
206 aObjDoc->setVisible(true);
207 desktop()->tabifyDockWidget(aObjDoc, myWorkshop->propertyPanel());
210 DockWidget* aInspection = myWorkshop->inspectionPanel();
212 QAction* aViewAct = aInspection->toggleViewAction();
213 aViewAct->setEnabled(true);
214 aInspection->setVisible(true);
218 ViewManagerList OCCViewManagers;
219 application()->viewManagers(OCCViewer_Viewer::Type(), OCCViewManagers);
220 if (OCCViewManagers.size() > 0) {
221 mySelector = createSelector(OCCViewManagers.first());
224 // it should be pefromed after the selector creation in order to have AISContext
225 myWorkshop->activateModule();
226 //action(myEraseAll)->setEnabled(false);
229 myWorkshop->objectBrowser()->rebuildDataTree();
230 myWorkshop->updateCommandStatus();
234 myWorkshop->updateCommandStatus();
236 SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
237 myIsStorePositions = aResMgr->booleanValue("Study", "store_positions", true);
238 myIsEditEnabled = getApp()->isEditEnabled();
239 getApp()->setEditEnabled(false);
241 // this following row is caused by #187 bug.
242 // SALOME saves the dock widget positions before deactivateModule() and
243 // load it after the module activation. So, if the panel is visible before
244 // deactivate, it becomes visible after activate.
245 // In order to avoid the visible property panel, the widget position save is
246 // switch off in this module
247 aResMgr->setValue("Study", "store_positions", false);
249 // Synchronize displayed objects
250 Handle(AIS_InteractiveContext) aContext;
251 if (mySelector && mySelector->viewer())
252 aContext = mySelector->viewer()->getAISContext();
254 if (!aContext.IsNull()) {
255 XGUI_Displayer* aDisp = myWorkshop->displayer();
256 QObjectPtrList aObjList = aDisp->displayedObjects();
258 AIS_ListOfInteractive aList;
259 aContext->DisplayedObjects(aList);
260 AIS_ListIteratorOfListOfInteractive aLIt;
261 Handle(AIS_InteractiveObject) anAISIO;
262 foreach (ObjectPtr aObj, aObjList) {
263 AISObjectPtr aPrs = aDisp->getAISObject(aObj);
264 Handle(AIS_InteractiveObject) aAIS = aPrs->impl<Handle(AIS_InteractiveObject)>();
266 for (aLIt.Initialize(aList); aLIt.More(); aLIt.Next()) {
267 anAISIO = aLIt.Value();
268 if (anAISIO.get() == aAIS.get()) {
274 aObj->setDisplayed(false);
275 //aDisp->erase(aObj, false);
278 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
280 myProxyViewer->activateViewer(true);
282 // Postrrocessing for LoadScriptId to remove created(if it was created) SALOME Object Browser
283 connect(getApp()->action(LightApp_Application::UserID+1), SIGNAL(triggered(bool)),
284 this, SLOT(onScriptLoaded()));
286 disconnect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
287 getApp(), SLOT(onSaveDoc()));
288 disconnect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
289 getApp(), SLOT(onSaveAsDoc()));
291 connect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
292 this, SLOT(onSaveDocByShaper()));
293 connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
294 this, SLOT(onSaveAsDocByShaper()));
299 //******************************************************
300 bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
302 myProxyViewer->activateViewer(false);
306 myWorkshop->deactivateModule();
308 QObject* aObj = myWorkshop->objectBrowser()->parent();
309 QDockWidget* aObjDoc = dynamic_cast<QDockWidget*>(aObj);
311 aObjDoc->setVisible(false);
312 myWorkshop->objectBrowser()->setVisible(false);
313 QAction* aViewAct = aObjDoc->toggleViewAction();
314 aViewAct->setEnabled(false);
316 DockWidget* aInspection = myWorkshop->inspectionPanel();
318 aInspection->setVisible(false);
319 QAction* aViewAct = aInspection->toggleViewAction();
320 aViewAct->setEnabled(false);
323 // the active operation should be stopped for the next activation.
324 // There should not be active operation and visualized preview.
325 // Abort operation should be performed before the selection's remove
326 // because the displayed objects should be removed from the viewer, but
327 // the AIS context is obtained from the selector.
328 ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
329 while (anOperation) {
330 anOperation->abort();
331 anOperation = myWorkshop->operationMgr()->currentOperation();
333 // Delete selector because it has to be redefined on next activation
335 myProxyViewer->setSelector(0);
340 myWorkshop->hidePanel(myWorkshop->facesPanel());
341 //myWorkshop->contextMenuMgr()->disconnectViewer();
343 SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
344 aResMgr->setValue("Study", "store_positions", myIsStorePositions);
345 getApp()->setEditEnabled(myIsEditEnabled);
347 // Postrrocessing for LoadScriptId to remove created(if it was created) SALOME Object Browser
348 disconnect(getApp()->action(LightApp_Application::UserID+1), SIGNAL(triggered(bool)),
349 this, SLOT(onScriptLoaded()));
351 disconnect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
352 this, SLOT(onSaveDocByShaper()));
353 disconnect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
354 this, SLOT(onSaveAsDocByShaper()));
356 connect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
357 getApp(), SLOT(onSaveDoc()));
358 connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
359 getApp(), SLOT(onSaveAsDoc()));
362 return LightApp_Module::deactivateModule(theStudy);
365 //******************************************************
366 void SHAPERGUI::onViewManagerAdded(SUIT_ViewManager* theMgr)
369 mySelector = createSelector(theMgr);
370 myWorkshop->selectionActivate()->updateSelectionFilters();
371 myWorkshop->selectionActivate()->updateSelectionModes();
372 myWorkshop->synchronizeViewer();
376 //******************************************************
377 void SHAPERGUI::onViewManagerRemoved(SUIT_ViewManager* theMgr)
380 if (theMgr->getType() == OCCViewer_Viewer::Type()) {
381 OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
382 if (mySelector->viewer() == aViewer) {
383 XGUI_Displayer* aDisp = myWorkshop->displayer();
384 QObjectPtrList aObjects = aDisp->displayedObjects();
385 foreach(ObjectPtr aObj, aObjects)
386 aObj->setDisplayed(false);
387 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
388 myProxyViewer->setSelector(0);
392 myWorkshop->module()->clearViewer();
398 //******************************************************
399 QtxPopupMgr* SHAPERGUI::popupMgr()
402 myPopupMgr = new QtxPopupMgr( 0, this );
406 //******************************************************
407 void SHAPERGUI::onDefaultPreferences()
409 // reset main resources
410 ModuleBase_Preferences::resetResourcePreferences(preferences());
411 // reset plugin's resources
412 ModuleBase_Preferences::resetConfigPropPreferences(preferences());
414 myWorkshop->displayer()->redisplayObjects();
417 //******************************************************
418 void SHAPERGUI::onScriptLoaded()
420 // this slot is called after processing of the LoadScriptId action of SalomeApp Application
421 // Each dumped script contains updateObjBrowser() that creates a new instance of Object
422 // Browser. When SHAPER module is active, this browser should not be used. It might be removed
423 // as hidden by means of updateWindows() of SalomeApp_Application or to remove
424 // it manually (because this method of application is protected)
425 SUIT_DataBrowser* aBrowser = getApp()->objectBrowser();
430 //******************************************************
431 void SHAPERGUI::onSaveDocByShaper()
433 if(!workshop()->operationMgr()->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage))
436 getApp()->onSaveDoc();
439 //******************************************************
440 void SHAPERGUI::onSaveAsDocByShaper()
442 if(!workshop()->operationMgr()->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage))
445 getApp()->onSaveAsDoc();
448 //******************************************************
449 void SHAPERGUI::onUpdateCommandStatus()
451 getApp()->updateActions();
454 //******************************************************
455 SHAPERGUI_OCCSelector* SHAPERGUI::createSelector(SUIT_ViewManager* theMgr)
457 if (theMgr->getType() == OCCViewer_Viewer::Type()) {
458 OCCViewer_Viewer* aViewer = static_cast<OCCViewer_Viewer*>(theMgr->getViewModel());
459 SHAPERGUI_OCCSelector* aSelector = new SHAPERGUI_OCCSelector(aViewer,
460 getApp()->selectionMgr());
461 #ifdef SALOME_PATCH_FOR_CTRL_WHEEL
462 aViewer->setUseLocalSelection(true);
464 LightApp_SelectionMgr* aMgr = getApp()->selectionMgr();
465 QList<SUIT_Selector*> aList;
466 aMgr->selectors(aList);
467 foreach(SUIT_Selector* aSel, aList)
469 aSel->setEnabled(aSel == aSelector);
471 myProxyViewer->setSelector(aSelector);
477 //******************************************************
478 CAM_DataModel* SHAPERGUI::createDataModel()
480 return new SHAPERGUI_DataModel(this);
483 QAction* SHAPERGUI::addFeature(const QString& theWBName, const ActionInfo& theInfo,
484 const bool isAddSeparator)
486 return addFeature(theWBName,
490 //Issue #650: in the SALOME mode the tooltip should be same as text
499 //******************************************************
500 QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theTBName,
501 const QString& theId, const QString& theTitle, const QString& theTip,
502 const QIcon& theIcon, const QKeySequence& theKeys,
503 bool isCheckable, const bool isAddSeparator,
504 const QString& theStatusTip)
506 static QString aLastTool = "";
508 if (aLastTool.isEmpty())
509 aLastTool = theWBName;
510 else if (theWBName != aLastTool) {
511 aLastTool = theWBName;
513 desktop()->addToolBarBreak();
519 int aId = myActionsList.size();
520 myActionsList.append(theId);
521 SUIT_Desktop* aDesk = application()->desktop();
523 for (int i = 0; i < theKeys.count(); i++)
525 QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
527 aAction->setStatusTip(theStatusTip);
529 aAction->setData(theId);
531 int aWBMenu = createMenu(theWBName, -1, -1, 30/*10-Window, 1000 - Help*/);
532 int aItemId = createMenu(aId, aWBMenu);
534 createMenu(separator(), aWBMenu);
536 int aWBTool = createTool(theTBName, theTBName);
537 int aToolId = createTool(aId, aWBTool);
539 createTool(separator(), aWBTool);
544 bool SHAPERGUI::isFeatureOfNested(const QAction* theAction)
546 return dynamic_cast<const SHAPERGUI_NestedButton*>(theAction);
549 QAction* SHAPERGUI::addFeatureOfNested(const QString& theWBName,
550 const ActionInfo& theInfo,
551 const QList<QAction*>& theNestedActions)
553 myActionsList.append(theInfo.id);
554 SUIT_Desktop* aDesk = application()->desktop();
555 SHAPERGUI_NestedButton* anAction = new SHAPERGUI_NestedButton(aDesk, theNestedActions);
556 anAction->setData(theInfo.id);
557 anAction->setCheckable(theInfo.checkable);
558 anAction->setChecked(theInfo.checked);
559 anAction->setEnabled(theInfo.enabled);
560 anAction->setVisible(theInfo.visible);
561 anAction->setIcon(theInfo.icon);
562 anAction->setText(theInfo.text);
563 anAction->setToolTip(theInfo.toolTip);
564 anAction->setShortcut(theInfo.shortcut);
565 anAction->setFont(theInfo.font);
567 int aWBMenu = createMenu(theWBName, -1, -1, 30);
568 int aItemId = createMenu(anAction, aWBMenu);
569 createMenu(separator(), aWBMenu); /// nested action is always separated of others
571 int aWBTool = createTool(theWBName, theWBName);
572 int aToolId = createTool(anAction, aWBTool);
573 createTool(separator(), aWBTool); /// nested action is always separated of others
579 //******************************************************
580 QAction* SHAPERGUI::addDesktopCommand(const QString& theId, const QString& theTitle,
581 const QString& theTip, const QIcon& theIcon,
582 const QKeySequence& theKeys, bool isCheckable,
583 const char* theMenuSourceText, const int theMenuPosition)
585 int aMenu = createMenu(tr(theMenuSourceText), -1, -1);
587 int aId = myActionsList.size();
588 myActionsList.append(theId);
589 SUIT_Desktop* aDesk = application()->desktop();
591 for (int i = 0; i < theKeys.count(); i++)
593 QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
595 aAction->setStatusTip(theTip);
596 aAction->setData(theId);
597 createMenu(aId, aMenu, theMenuPosition);
601 //******************************************************
602 void SHAPERGUI::addDesktopMenuSeparator(const char* theMenuSourceText, const int theMenuPosition)
604 int aMenu = createMenu(tr(theMenuSourceText), -1, -1);
605 createMenu(separator(), aMenu, -1, theMenuPosition);
608 bool SHAPERGUI::addActionInToolbar( QAction* theAction, const QString& theToolBarTitle )
613 SUIT_Desktop* aDesktop = application()->desktop();
617 QtxActionToolMgr* aToolMgr = aDesktop->toolMgr();
621 aToolMgr->append( theAction, theToolBarTitle );
625 //******************************************************
626 QList<QAction*> SHAPERGUI::commandList() const
628 QList<QAction*> aActions;
629 for (int i = 0; i < myActionsList.size(); i++) {
630 QAction* aCmd = action(i);
631 if (aCmd && myActionsList.contains(aCmd->data().toString()))
632 aActions.append(aCmd);
638 //******************************************************
639 QMainWindow* SHAPERGUI::desktop() const
641 return application()->desktop();
644 void SHAPERGUI::setFeatureInfo(const QString& theFeatureId,
645 const std::shared_ptr<Config_FeatureMessage>& theMessage)
647 myFeaturesInfo.insert(theFeatureId, theMessage);
650 std::shared_ptr<Config_FeatureMessage> SHAPERGUI::featureInfo(const QString& theFeatureId)
652 std::shared_ptr<Config_FeatureMessage> aMessage;
653 if (myFeaturesInfo.contains(theFeatureId))
654 aMessage = myFeaturesInfo[theFeatureId];
658 //******************************************************
659 void SHAPERGUI::selectionChanged()
661 LightApp_Module::selectionChanged();
662 myWorkshop->salomeViewerSelectionChanged();
665 //******************************************************
666 void SHAPERGUI::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
668 myWorkshop->contextMenuMgr()->updateViewerMenu();
669 myWorkshop->contextMenuMgr()->addViewerMenu(theMenu);
670 LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
674 //******************************************************
675 void SHAPERGUI::createPreferences()
677 LightApp_Preferences* pref = preferences();
680 ModuleBase_Preferences::updateConfigByResources();
681 QString aModName = moduleName();
683 QtxPreferenceItem* item = pref->findItem(aModName, true );
684 if ( item && (!item->isEmpty() )) {
685 item->parentItem()->removeItem(item);
689 int catId = pref->addPreference(aModName, -1 );
692 SHAPERGUI_PrefMgr aMgr(pref, aModName);
693 ModuleBase_Preferences::createEditContent(&aMgr, catId);
695 int viewTab = pref->addItem(tr("Viewer"), catId);
696 // Create other parameters group in viewer tab
697 int otherGroup = pref->addItem(tr("Default selection"), viewTab);
698 pref->setItemProperty("columns", 3, otherGroup);
699 pref->addItem(tr("Faces"), otherGroup,
700 SUIT_PreferenceMgr::Bool,
701 ModuleBase_Preferences::VIEWER_SECTION, "face-selection");
702 pref->addItem(tr("Edges"), otherGroup,
703 SUIT_PreferenceMgr::Bool,
704 ModuleBase_Preferences::VIEWER_SECTION, "edge-selection");
705 pref->addItem(tr("Vertices"), otherGroup,
706 SUIT_PreferenceMgr::Bool,
707 ModuleBase_Preferences::VIEWER_SECTION, "vertex-selection");
709 int sensitivityGroup = pref->addItem(tr("Selection sensitivity"), viewTab);
710 pref->setItemProperty("columns", 2, sensitivityGroup);
711 pref->addItem(tr("Vertex"), sensitivityGroup, SUIT_PreferenceMgr::DblSpin,
712 ModuleBase_Preferences::VIEWER_SECTION, "point-selection-sensitivity");
713 pref->addItem(tr("Edge"), sensitivityGroup, SUIT_PreferenceMgr::DblSpin,
714 ModuleBase_Preferences::VIEWER_SECTION, "edge-selection-sensitivity");
718 //******************************************************
719 void SHAPERGUI::preferencesChanged(const QString& theSection, const QString& theParam)
721 SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
722 QString aVal = aResMgr->stringValue(theSection, theParam);
723 Config_Prop* aProp = Config_PropManager::findProp(theSection.toStdString(),
724 theParam.toStdString());
725 std::string aValue = aVal.toStdString();
726 if (aValue.empty()) {
727 aValue = aProp->defaultValue();
728 aResMgr->setValue(theSection, theParam, QString(aValue.c_str()));
730 LightApp_Preferences* pref = preferences();
734 aProp->setValue(aValue);
736 myWorkshop->displayer()->redisplayObjects();
739 void SHAPERGUI::putInfo(const QString& theInfo, const int theMSecs)
741 application()->putInfo(theInfo, theMSecs);
744 bool SHAPERGUI::abortAllOperations()
746 return workshop()->operationMgr()->abortAllOperations();
749 void SHAPERGUI::createFeatureActions()
751 myWorkshop->menuMgr()->createFeatureActions();