Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into Dev_2.8.0
[modules/shaper.git] / src / XGUI / XGUI_WorkshopListener.cpp
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #include "XGUI_WorkshopListener.h"
22 #include "XGUI_Workshop.h"
23 #include "XGUI_Displayer.h"
24 #include "XGUI_ErrorMgr.h"
25 #include "XGUI_OperationMgr.h"
26 #include "XGUI_SalomeConnector.h"
27 #include "XGUI_ActionsMgr.h"
28 #include "XGUI_PropertyPanel.h"
29 #include "XGUI_ModuleConnector.h"
30 #include "XGUI_QtEvents.h"
31 #include "XGUI_SelectionMgr.h"
32
33 #ifndef HAVE_SALOME
34 #include <AppElements_MainWindow.h>
35 #endif
36
37 #include <ModuleBase_IModule.h>
38 #include <ModuleBase_Events.h>
39
40 #include <ModelAPI_Object.h>
41 #include <ModelAPI_Events.h>
42 #include <ModelAPI_Session.h>
43 #include <ModelAPI_Result.h>
44 #include <ModelAPI_Feature.h>
45 #include <ModelAPI_Data.h>
46 #include <ModelAPI_ResultCompSolid.h>
47 #include <ModelAPI_Tools.h>
48
49 #include <Events_Loop.h>
50 #include <Events_LongOp.h>
51
52 #include <ModuleBase_IWorkshop.h>
53
54 #include <ModuleBase_Operation.h>
55 #include <ModuleBase_OperationDescription.h>
56 #include <ModuleBase_OperationFeature.h>
57 #include <ModuleBase_Tools.h>
58 #include <ModuleBase_IViewer.h>
59 #include <ModuleBase_WidgetSelector.h>
60
61 #include <Config_FeatureMessage.h>
62 #include <Config_PointerMessage.h>
63 #include <Config_Keywords.h>
64 #include <Events_InfoMessage.h>
65
66 #include <QApplication>
67 #include <QMainWindow>
68 #include <QThread>
69 #include <QAction>
70
71 #ifdef _DEBUG
72 #include <QDebug>
73 #include <iostream>
74 #endif
75
76 //#define DEBUG_FEATURE_CREATED
77 //#define DEBUG_FEATURE_REDISPLAY
78 //#define DEBUG_FEATURE_UPDATED
79 //#define DEBUG_RESULT_COMPSOLID
80
81 #ifdef DEBUG_FEATURE_REDISPLAY
82 const std::string DebugFeatureKind = "";//"Extrusion";
83 #endif
84
85 XGUI_WorkshopListener::XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop)
86   : myWorkshop(theWorkshop),
87     myUpdatePrefs(false)
88 {
89   XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
90 }
91
92 //******************************************************
93 XGUI_WorkshopListener::~XGUI_WorkshopListener(void)
94 {
95 }
96
97 //******************************************************
98 void XGUI_WorkshopListener::initializeEventListening()
99 {
100   //Initialize event listening
101   Events_Loop* aLoop = Events_Loop::loop();
102   aLoop->registerListener(this, Events_InfoMessage::errorID());  //!< Listening application errors.
103   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
104   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
105   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
106   aLoop->registerListener(this, Events_LongOp::eventID());
107   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_PLUGIN_LOADED));
108
109   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED));
110   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED));
111   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
112   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION));
113 }
114
115 //******************************************************
116 void XGUI_WorkshopListener::processEvent(const std::shared_ptr<Events_Message>& theMessage)
117 {
118   if (QApplication::instance()->thread() != QThread::currentThread()) {
119     #ifdef _DEBUG
120     std::cout << "XGUI_Workshop::processEvent: " << "Working in another thread." << std::endl;
121     #endif
122     SessionPtr aMgr = ModelAPI_Session::get();
123     PostponeMessageQtEvent* aPostponeEvent = new PostponeMessageQtEvent(theMessage);
124     QApplication::postEvent(this, aPostponeEvent);
125     return;
126   }
127
128   // Process creation of Part
129   if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
130     std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
131         std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
132     onFeatureCreatedMsg(aUpdMsg);
133     if (myUpdatePrefs) {
134       XGUI_SalomeConnector* aSalomeConnector = workshop()->salomeConnector();
135       if (aSalomeConnector)
136         aSalomeConnector->createPreferences();
137       myUpdatePrefs = false;
138     }
139   }
140   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_PLUGIN_LOADED)) {
141     myUpdatePrefs = true;
142   }
143   // Redisplay feature
144   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)) {
145     std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
146         std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
147     onFeatureRedisplayMsg(aUpdMsg);
148   } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION)) {
149     std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
150         std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
151     onFeatureEmptyPresentationMsg(aUpdMsg);
152   } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION)) {
153     ModuleBase_ModelWidget* aWidget = workshop()->propertyPanel()->activeWidget();
154     if (aWidget) {
155       ModuleBase_WidgetSelector* aWidgetSelector =
156         dynamic_cast<ModuleBase_WidgetSelector*>(aWidget);
157       if (aWidgetSelector)
158         workshop()->selector()->setSelected(aWidgetSelector->getAttributeSelection());
159     }
160   }
161
162   //Update property panel on corresponding message. If there is no current operation (no
163   //property panel), or received message has different feature to the current - do nothing.
164   else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {
165     std::shared_ptr<ModelAPI_ObjectUpdatedMessage> anUpdateMsg =
166         std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
167     onFeatureUpdatedMsg(anUpdateMsg);
168   } else if (theMessage->eventID() == Events_LongOp::eventID()) {
169     if (Events_LongOp::isPerformed()) {
170       QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
171     } else {
172       QApplication::restoreOverrideCursor();
173     }
174   } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED)) {
175     // the viewer's update context will not happens until viewer updated is emitted
176       workshop()->displayer()->enableUpdateViewer(false);
177   } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED)) {
178     // the viewer's update context is unblocked, the viewer's update works
179     XGUI_Displayer* aDisplayer = workshop()->displayer();
180     aDisplayer->enableUpdateViewer(true);
181   } else {
182     //Show error dialog if error message received.
183     std::shared_ptr<Events_InfoMessage> anIngfoMsg =
184       std::dynamic_pointer_cast<Events_InfoMessage>(theMessage);
185     if (anIngfoMsg) {
186       emit errorOccurred(anIngfoMsg);
187     }
188     return;
189   }
190 #ifndef HAVE_SALOME
191     SessionPtr aMgr = ModelAPI_Session::get();
192     AppElements_MainWindow* aMainWindow = workshop()->mainWindow();
193     if (aMgr->isModified() != aMainWindow->isModifiedState())
194       aMainWindow->setModifiedState(aMgr->isModified());
195 #endif
196 }
197
198 //******************************************************
199 void XGUI_WorkshopListener::onFeatureUpdatedMsg(
200                                      const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
201 {
202 #ifdef DEBUG_FEATURE_UPDATED
203   std::set<ObjectPtr> anObjects = theMsg->objects();
204   std::set<ObjectPtr>::const_iterator aIt;
205   QStringList anInfo;
206   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
207     anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
208   }
209   QString anInfoStr = anInfo.join(";\t");
210   qDebug(QString("onFeatureUpdatedMsg: %1, %2")
211     .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
212 #endif
213   std::set<ObjectPtr> aFeatures = theMsg->objects();
214   XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
215   if (anOperationMgr->hasOperation()) {
216     ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
217                                                       (anOperationMgr->currentOperation());
218     if (aFOperation) {
219       FeaturePtr aCurrentFeature = aFOperation->feature();
220       std::set<ObjectPtr>::const_iterator aIt;
221       for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
222         ObjectPtr aNewFeature = (*aIt);
223         if (aNewFeature == aCurrentFeature) {
224           workshop()->propertyPanel()->updateContentWidget(aCurrentFeature);
225           break;
226         }
227       }
228     }
229   }
230   //anOperationMgr->onValidateOperation();
231
232   //if (myObjectBrowser)
233   //  myObjectBrowser->processEvent(theMsg);
234 }
235
236 //******************************************************
237 void XGUI_WorkshopListener::
238   onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
239 {
240   std::set<ObjectPtr> anObjects = theMsg->objects();
241   std::set<ObjectPtr>::const_iterator aIt;
242
243 #ifdef DEBUG_FEATURE_REDISPLAY
244   QStringList anInfo;
245   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
246     anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
247   }
248   QString anInfoStr = anInfo.join(";\t");
249   qDebug(QString("onFeatureRedisplayMsg: %1, %2")
250     .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
251 #endif
252
253   XGUI_Workshop* aWorkshop = workshop();
254   XGUI_Displayer* aDisplayer = aWorkshop->displayer();
255   bool aRedisplayed = false;
256   //std::list<ObjectPtr> aHiddenObjects;
257   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
258     ObjectPtr aObj = (*aIt);
259
260     // Hide the object if it is invalid or concealed one
261     bool aHide = !aObj->data() || !aObj->data()->isValid() ||
262       aObj->isDisabled() || (!aObj->isDisplayed());
263     if (!aHide) { // check that this is not hidden result
264       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
265       aHide = aRes && aRes->isConcealed();
266
267       // Hide the presentation with an empty shape. But isDisplayed state of the object should not
268       // be changed to the object becomes visible when the shape becomes not empty
269       if (!aHide && aRes.get())
270         aHide = !aRes->shape().get() || aRes->shape()->isNull();
271     }
272
273 #ifdef DEBUG_RESULT_COMPSOLID
274     ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
275     if (aRes.get()) {
276       ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
277       if (aCompSolidRes.get()) {
278           qDebug(QString("COMPSOLID, numberOfSubs = %1")
279             .arg(aCompSolidRes->numberOfSubs()).toStdString().c_str());
280       }
281       if (ModelAPI_Tools::compSolidOwner(aRes))
282         qDebug("COMPSOLID sub-object");
283     }
284 #endif
285     #ifdef DEBUG_FEATURE_REDISPLAY
286       QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
287       FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
288       if (aFeature.get()) {
289         std::string aKind = aFeature->getKind();
290         if (aKind == DebugFeatureKind || DebugFeatureKind.empty()) {
291           qDebug(QString("visible=%1, hide=%2 : display= %2").arg(aDisplayer->isVisible(aObj))
292                                             .arg(aHide).arg(anObjInfo).toStdString().c_str());
293         }
294       }
295     #endif
296     if (aHide) {
297       //we should provide objects which are hidden in the viewer, e.g. sketch always should
298       // visualizes all sub-features, if some features are to be hidden, sould be proposed may
299       // be to removed #1223
300       // aHiddenObjects.push_back(aObj);
301       aRedisplayed = aDisplayer->erase(aObj, false) || aRedisplayed;
302       #ifdef DEBUG_FEATURE_REDISPLAY
303         // Redisplay the visible object or the object of the current operation
304         bool isVisibleObject = aDisplayer->isVisible(aObj);
305
306         QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
307       #endif
308     }
309     else {
310       // Redisplay the visible object or the object of the current operation
311       bool isVisibleObject = aDisplayer->isVisible(aObj);
312       #ifdef DEBUG_FEATURE_REDISPLAY
313         QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
314       #endif
315
316       if (isVisibleObject)  { // redisplay visible object
317         //displayObject(aObj);  // In order to update presentation
318         // in order to avoid the check whether the object can be redisplayed, the exact method
319         // of redisplay is called. This modification is made in order to have the line is updated
320         // by creation of a horizontal constraint on the line by preselection
321         if (ModelAPI_Tools::hasSubResults(std::dynamic_pointer_cast<ModelAPI_Result>(aObj))) {
322           aRedisplayed = aDisplayer->erase(aObj, false) || aRedisplayed;
323         }
324         else {
325           aRedisplayed = aDisplayer->redisplay(aObj, false) || aRedisplayed;
326           // Deactivate object of current operation from selection
327           aWorkshop->deactivateActiveObject(aObj, false);
328         }
329       } else { // display object if the current operation has it
330         if (displayObject(aObj)) {
331           aRedisplayed = true;
332           // Deactivate object of current operation from selection
333           aWorkshop->deactivateActiveObject(aObj, false);
334         }
335       }
336     }
337   }
338   // this processing should be moved in another place in order to do not cause problems in
339   // flush messages chain
340   //if (aHiddenObjects.size() > 0)
341   //  myWorkshop->module()->processHiddenObject(aHiddenObjects);
342
343   bool isCustomized = customizeCurrentObject(anObjects, aRedisplayed);
344   if (aRedisplayed || isCustomized) {
345     Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
346
347     aDisplayer->updateViewer();
348   }
349 }
350
351 //******************************************************
352 void XGUI_WorkshopListener::
353   onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
354 {
355   std::set<ObjectPtr> anObjects = theMsg->objects();
356   std::set<ObjectPtr>::const_iterator aIt;
357 #ifdef DEBUG_FEATURE_CREATED
358   QStringList anInfo;
359   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
360     anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
361   }
362   QString anInfoStr = anInfo.join(";\t");
363   qDebug(QString("onFeatureCreatedMsg: %1, %2")
364     .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
365 #endif
366
367   //bool aHasPart = false;
368   bool aDisplayed = false;
369   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
370     ObjectPtr anObject = *aIt;
371
372 #ifdef DEBUG_RESULT_COMPSOLID
373     ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
374     if (aRes.get()) {
375       ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
376       if (aCompSolidRes.get()) {
377           qDebug(QString("COMPSOLID, numberOfSubs = %1")
378             .arg(aCompSolidRes->numberOfSubs()).toStdString().c_str());
379       }
380       if (ModelAPI_Tools::compSolidOwner(aRes))
381         qDebug("COMPSOLID sub-object");
382     }
383 #endif
384     // the validity of the data should be checked here in order to avoid display of the objects,
385     // which were created, then deleted, but flush for the creation event happens after that
386     // we should not display disabled objects
387     bool aHide = !anObject->data()->isValid() ||
388                  anObject->isDisabled() ||
389                  !anObject->isDisplayed();
390     if (!aHide) { // check that this is not hidden result
391       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
392       bool isConcealed = aRes && aRes->isConcealed();
393       aHide = aRes && aRes->isConcealed();
394       // Hide the presentation with an empty shape. But isDisplayed state of the object should not
395       // be changed to the object becomes visible when the shape becomes not empty
396       if (!aHide && aRes.get())
397         aHide = !aRes->shape().get() || aRes->shape()->isNull();
398     }
399     if (!aHide) {
400       // setDisplayed has to be called in order to synchronize internal state of the object
401       // with list of displayed objects
402       if (myWorkshop->module()->canDisplayObject(anObject)) {
403         anObject->setDisplayed(true);
404         aDisplayed = displayObject(anObject);
405       } else
406         anObject->setDisplayed(false);
407     }
408   }
409
410   bool isCustomized = customizeCurrentObject(anObjects, aDisplayed);
411
412   //if (myObjectBrowser)
413   //  myObjectBrowser->processEvent(theMsg);
414   if (aDisplayed) {
415     Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
416     workshop()->displayer()->updateViewer();
417   }
418   //if (aHasPart) { // TODO: Avoid activate last part on loading of document
419   //  activateLastPart();
420   //}
421 }
422
423 //******************************************************
424 void XGUI_WorkshopListener::onFeatureEmptyPresentationMsg(
425                                       const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
426 {
427   std::set<ObjectPtr> anObjects = theMsg->objects();
428   std::set<ObjectPtr>::const_iterator aIt;
429 #ifdef DEBUG_FEATURE_CREATED
430   QStringList anInfo;
431   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
432     anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
433   }
434   QString anInfoStr = anInfo.join(";\t");
435   qDebug(QString("onFeatureEmptyPresentationMsg: %1, %2")
436     .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
437 #endif
438
439   XGUI_Workshop* aWorkshop = workshop();
440   XGUI_Displayer* aDisplayer = aWorkshop->displayer();
441
442   bool aRedisplayed = false;
443   for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
444     ObjectPtr anObject = *aIt;
445     aRedisplayed = aDisplayer->erase(anObject, false) || aRedisplayed;
446   }
447
448   if (aRedisplayed)
449     aDisplayer->updateViewer();
450 }
451
452 bool XGUI_WorkshopListener::event(QEvent * theEvent)
453 {
454   PostponeMessageQtEvent* aPostponedEv = dynamic_cast<PostponeMessageQtEvent*>(theEvent);
455   if (aPostponedEv) {
456     std::shared_ptr<Events_Message> aEventPtr = aPostponedEv->postponedMessage();
457     processEvent(aEventPtr);
458     return true;
459   }
460   return false;
461 }
462
463 //**************************************************************
464 bool XGUI_WorkshopListener::displayObject(ObjectPtr theObj)
465 {
466 #ifdef DEBUG_RESULT_COMPSOLID
467   ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObj);
468   if (aRes.get() && (ModelAPI_Tools::hasSubResults(aRes) || ModelAPI_Tools::compSolidOwner(aRes))) {
469     ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
470     if (aCompSolidRes.get()) {
471       qDebug("COMPSOLID: displayObject");
472     }
473   }
474 #endif
475
476   bool aDisplayed = false;
477   XGUI_Workshop* aWorkshop = workshop();
478   // do not display the object if it has sub objects. They should be displayed separately.
479   if (!aWorkshop->module()->canDisplayObject(theObj) ||
480       ModelAPI_Tools::hasSubResults(std::dynamic_pointer_cast<ModelAPI_Result>(theObj)))
481     return aDisplayed;
482
483   XGUI_Displayer* aDisplayer = aWorkshop->displayer();
484   int aNb = aDisplayer->objectsCount();
485   return aDisplayer->display(theObj, false);
486 }
487
488 bool XGUI_WorkshopListener::customizeCurrentObject(const std::set<ObjectPtr>& theObjects,
489                                                    bool theForceRedisplay)
490 {
491   XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
492   FeaturePtr aCurrentFeature;
493   if (anOperationMgr->hasOperation()) {
494     ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
495                                                       (anOperationMgr->currentOperation());
496     if (aFOperation) {
497       aCurrentFeature = aFOperation->feature();
498     }
499   }
500
501   bool aCustomized = false;
502   if (aCurrentFeature.get()) {
503     // the customize presentation should be redisplayed if force redislayed is true or
504     // if a list of message objects contains the operation feature for case when
505     // the feature is hidden, but arguments of the feature are modified
506     // e.g. extrusion is hidden(h=0) but sketch is chosen
507     if (theForceRedisplay || theObjects.find(aCurrentFeature) != theObjects.end()) {
508       aCustomized = myWorkshop->module()->customizeObject(aCurrentFeature,
509                                  ModuleBase_IModule::CustomizeArguments, false) || aCustomized;
510       aCustomized = myWorkshop->module()->customizeObject(aCurrentFeature,
511                                    ModuleBase_IModule::CustomizeResults, false) || aCustomized;
512       aCustomized = myWorkshop->module()->customizeObject(aCurrentFeature,
513                         ModuleBase_IModule::CustomizeHighlightedObjects, false) || aCustomized;
514     }
515   }
516   return aCustomized;
517 }
518
519 XGUI_Workshop* XGUI_WorkshopListener::workshop() const
520 {
521   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
522   return aConnector->workshop();
523 }