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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #include "XGUI_WorkshopListener.h"
21 #include "XGUI_Workshop.h"
22 #include "XGUI_Displayer.h"
23 #include "XGUI_ErrorMgr.h"
24 #include "XGUI_OperationMgr.h"
25 #include "XGUI_SalomeConnector.h"
26 #include "XGUI_ActionsMgr.h"
27 #include "XGUI_PropertyPanel.h"
28 #include "XGUI_ModuleConnector.h"
29 #include "XGUI_QtEvents.h"
30 #include "XGUI_SelectionMgr.h"
33 #include <AppElements_MainWindow.h>
36 #include <ModuleBase_IModule.h>
37 #include <ModuleBase_Events.h>
39 #include <ModelAPI_Object.h>
40 #include <ModelAPI_Events.h>
41 #include <ModelAPI_Session.h>
42 #include <ModelAPI_Result.h>
43 #include <ModelAPI_Feature.h>
44 #include <ModelAPI_Data.h>
45 #include <ModelAPI_ResultBody.h>
46 #include <ModelAPI_ResultGroup.h>
47 #include <ModelAPI_ResultCompSolid.h>
48 #include <ModelAPI_Tools.h>
50 #include <Events_Loop.h>
51 #include <Events_LongOp.h>
53 #include <ModuleBase_IWorkshop.h>
55 #include <ModuleBase_Operation.h>
56 #include <ModuleBase_OperationDescription.h>
57 #include <ModuleBase_OperationFeature.h>
58 #include <ModuleBase_Tools.h>
59 #include <ModuleBase_IViewer.h>
60 #include <ModuleBase_WidgetSelector.h>
62 #include <Config_FeatureMessage.h>
63 #include <Config_PointerMessage.h>
64 #include <Config_Keywords.h>
65 #include <Events_InfoMessage.h>
67 #include <QApplication>
68 #include <QMainWindow>
77 //#define DEBUG_FEATURE_CREATED
78 //#define DEBUG_FEATURE_REDISPLAY
79 //#define DEBUG_FEATURE_UPDATED
80 //#define DEBUG_RESULT_COMPSOLID
82 #ifdef DEBUG_FEATURE_REDISPLAY
83 const std::string DebugFeatureKind = "";//"Extrusion";
86 XGUI_WorkshopListener::XGUI_WorkshopListener(ModuleBase_IWorkshop* theWorkshop)
87 : myWorkshop(theWorkshop),
90 XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
93 //******************************************************
94 XGUI_WorkshopListener::~XGUI_WorkshopListener(void)
98 //******************************************************
99 void XGUI_WorkshopListener::initializeEventListening()
101 //Initialize event listening
102 Events_Loop* aLoop = Events_Loop::loop();
103 aLoop->registerListener(this, Events_InfoMessage::errorID()); //!< Listening application errors.
104 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
105 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED));
106 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
107 aLoop->registerListener(this, Events_LongOp::eventID());
108 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_PLUGIN_LOADED));
110 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED));
111 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED));
112 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
113 aLoop->registerListener(this, Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION));
116 //******************************************************
117 void XGUI_WorkshopListener::processEvent(const std::shared_ptr<Events_Message>& theMessage)
119 if (QApplication::instance()->thread() != QThread::currentThread()) {
121 std::cout << "XGUI_Workshop::processEvent: " << "Working in another thread." << std::endl;
123 SessionPtr aMgr = ModelAPI_Session::get();
124 PostponeMessageQtEvent* aPostponeEvent = new PostponeMessageQtEvent(theMessage);
125 QApplication::postEvent(this, aPostponeEvent);
129 // Process creation of Part
130 if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_CREATED)) {
131 std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
132 std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
133 onFeatureCreatedMsg(aUpdMsg);
135 XGUI_SalomeConnector* aSalomeConnector = workshop()->salomeConnector();
136 if (aSalomeConnector)
137 aSalomeConnector->createPreferences();
138 myUpdatePrefs = false;
141 else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_PLUGIN_LOADED)) {
142 myUpdatePrefs = true;
145 else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)) {
146 std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
147 std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
148 onFeatureRedisplayMsg(aUpdMsg);
149 } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION)) {
150 std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
151 std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
152 onFeatureEmptyPresentationMsg(aUpdMsg);
153 } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION)) {
154 ModuleBase_ModelWidget* aWidget = workshop()->propertyPanel()->activeWidget();
156 ModuleBase_WidgetSelector* aWidgetSelector =
157 dynamic_cast<ModuleBase_WidgetSelector*>(aWidget);
159 workshop()->selector()->setSelected(aWidgetSelector->getAttributeSelection());
163 //Update property panel on corresponding message. If there is no current operation (no
164 //property panel), or received message has different feature to the current - do nothing.
165 else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) {
166 std::shared_ptr<ModelAPI_ObjectUpdatedMessage> anUpdateMsg =
167 std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
168 onFeatureUpdatedMsg(anUpdateMsg);
169 } else if (theMessage->eventID() == Events_LongOp::eventID()) {
170 if (Events_LongOp::isPerformed()) {
171 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
173 QApplication::restoreOverrideCursor();
175 } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_VIEWER_BLOCKED)) {
176 // the viewer's update context will not happens until viewer updated is emitted
177 workshop()->displayer()->enableUpdateViewer(false);
178 } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_VIEWER_UNBLOCKED)) {
179 // the viewer's update context is unblocked, the viewer's update works
180 XGUI_Displayer* aDisplayer = workshop()->displayer();
181 aDisplayer->enableUpdateViewer(true);
183 //Show error dialog if error message received.
184 std::shared_ptr<Events_InfoMessage> anIngfoMsg =
185 std::dynamic_pointer_cast<Events_InfoMessage>(theMessage);
187 emit errorOccurred(anIngfoMsg);
192 SessionPtr aMgr = ModelAPI_Session::get();
193 AppElements_MainWindow* aMainWindow = workshop()->mainWindow();
194 if (aMgr->isModified() != aMainWindow->isModifiedState())
195 aMainWindow->setModifiedState(aMgr->isModified());
199 //******************************************************
200 void XGUI_WorkshopListener::onFeatureUpdatedMsg(
201 const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
203 #ifdef DEBUG_FEATURE_UPDATED
204 std::set<ObjectPtr> anObjects = theMsg->objects();
205 std::set<ObjectPtr>::const_iterator aIt;
207 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
208 anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
210 QString anInfoStr = anInfo.join(";\t");
211 qDebug(QString("onFeatureUpdatedMsg: %1, %2")
212 .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
214 std::set<ObjectPtr> aFeatures = theMsg->objects();
215 XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
216 if (anOperationMgr->hasOperation()) {
217 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
218 (anOperationMgr->currentOperation());
220 FeaturePtr aCurrentFeature = aFOperation->feature();
221 std::set<ObjectPtr>::const_iterator aIt;
222 for (aIt = aFeatures.begin(); aIt != aFeatures.end(); ++aIt) {
223 ObjectPtr aNewFeature = (*aIt);
224 if (aNewFeature == aCurrentFeature) {
225 workshop()->propertyPanel()->updateContentWidget(aCurrentFeature);
231 //anOperationMgr->onValidateOperation();
233 //if (myObjectBrowser)
234 // myObjectBrowser->processEvent(theMsg);
237 //******************************************************
238 void XGUI_WorkshopListener::
239 onFeatureRedisplayMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
241 std::set<ObjectPtr> anObjects = theMsg->objects();
242 std::set<ObjectPtr>::const_iterator aIt;
244 #ifdef DEBUG_FEATURE_REDISPLAY
246 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
247 anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
249 QString anInfoStr = anInfo.join(";\t");
250 qDebug(QString("onFeatureRedisplayMsg: %1, %2")
251 .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
254 XGUI_Workshop* aWorkshop = workshop();
255 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
256 //bool aFirstVisualizedBody = false;
257 bool aDoFitAll = false;
258 int aNbOfShownObjects = workshop()->displayer()->objectsCount();
259 bool aRedisplayed = false;
260 //std::list<ObjectPtr> aHiddenObjects;
261 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
262 ObjectPtr aObj = (*aIt);
264 // Hide the object if it is invalid or concealed one
265 bool aHide = !aObj->data() || !aObj->data()->isValid() ||
266 aObj->isDisabled() || (!aObj->isDisplayed());
267 if (!aHide) { // check that this is not hidden result
268 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
269 aHide = aRes && aRes->isConcealed();
271 // Hide the presentation with an empty shape. But isDisplayed state of the object should not
272 // be changed to the object becomes visible when the shape becomes not empty
273 if (!aHide && aRes.get())
274 aHide = !aRes->shape().get() || aRes->shape()->isNull();
277 #ifdef DEBUG_RESULT_COMPSOLID
278 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
280 ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
281 if (aCompSolidRes.get()) {
282 qDebug(QString("COMPSOLID, numberOfSubs = %1")
283 .arg(aCompSolidRes->numberOfSubs()).toStdString().c_str());
285 if (ModelAPI_Tools::compSolidOwner(aRes))
286 qDebug("COMPSOLID sub-object");
289 #ifdef DEBUG_FEATURE_REDISPLAY
290 QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
291 FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
292 if (aFeature.get()) {
293 std::string aKind = aFeature->getKind();
294 if (aKind == DebugFeatureKind || DebugFeatureKind.empty()) {
295 qDebug(QString("visible=%1, hide=%2 : display= %2").arg(aDisplayer->isVisible(aObj))
296 .arg(aHide).arg(anObjInfo).toStdString().c_str());
301 //we should provide objects which are hidden in the viewer, e.g. sketch always should
302 // visualizes all sub-features, if some features are to be hidden, sould be proposed may
303 // be to removed #1223
304 // aHiddenObjects.push_back(aObj);
305 aRedisplayed = aDisplayer->erase(aObj, false) || aRedisplayed;
306 #ifdef DEBUG_FEATURE_REDISPLAY
307 // Redisplay the visible object or the object of the current operation
308 bool isVisibleObject = aDisplayer->isVisible(aObj);
310 QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
314 // Redisplay the visible object or the object of the current operation
315 bool isVisibleObject = aDisplayer->isVisible(aObj);
316 #ifdef DEBUG_FEATURE_REDISPLAY
317 QString anObjInfo = ModuleBase_Tools::objectInfo((aObj));
320 if (isVisibleObject) { // redisplay visible object
321 //displayObject(aObj); // In order to update presentation
322 // in order to avoid the check whether the object can be redisplayed, the exact method
323 // of redisplay is called. This modification is made in order to have the line is updated
324 // by creation of a horizontal constraint on the line by preselection
325 if (ModelAPI_Tools::hasSubResults(std::dynamic_pointer_cast<ModelAPI_Result>(aObj))) {
326 aRedisplayed = aDisplayer->erase(aObj, false) || aRedisplayed;
329 aRedisplayed = aDisplayer->redisplay(aObj, false) || aRedisplayed;
330 // Deactivate object of current operation from selection
331 aWorkshop->deactivateActiveObject(aObj, false);
333 } else { // display object if the current operation has it
334 if (displayObject(aObj)) {
335 aDoFitAll = aDoFitAll || neededFitAll(aObj, aNbOfShownObjects);
338 // Deactivate object of current operation from selection
339 aWorkshop->deactivateActiveObject(aObj, false);
344 // this processing should be moved in another place in order to do not cause problems in
345 // flush messages chain
346 //if (aHiddenObjects.size() > 0)
347 // myWorkshop->module()->processHiddenObject(aHiddenObjects);
349 bool isCustomized = customizeCurrentObject(anObjects, aRedisplayed);
350 if (aRedisplayed || isCustomized) {
351 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
353 //VSV FitAll updated viewer by itself
355 myWorkshop->viewer()->fitAll();
357 aDisplayer->updateViewer();
361 //******************************************************
362 void XGUI_WorkshopListener::
363 onFeatureCreatedMsg(const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
365 std::set<ObjectPtr> anObjects = theMsg->objects();
366 std::set<ObjectPtr>::const_iterator aIt;
367 #ifdef DEBUG_FEATURE_CREATED
369 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
370 anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
372 QString anInfoStr = anInfo.join(";\t");
373 qDebug(QString("onFeatureCreatedMsg: %1, %2")
374 .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
377 bool aDoFitAll = false;
378 int aNbOfShownObjects = workshop()->displayer()->objectsCount();
380 //bool aHasPart = false;
381 bool aDisplayed = false;
382 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
383 ObjectPtr anObject = *aIt;
385 #ifdef DEBUG_RESULT_COMPSOLID
386 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
388 ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
389 if (aCompSolidRes.get()) {
390 qDebug(QString("COMPSOLID, numberOfSubs = %1")
391 .arg(aCompSolidRes->numberOfSubs()).toStdString().c_str());
393 if (ModelAPI_Tools::compSolidOwner(aRes))
394 qDebug("COMPSOLID sub-object");
397 // the validity of the data should be checked here in order to avoid display of the objects,
398 // which were created, then deleted, but flush for the creation event happens after that
399 // we should not display disabled objects
400 bool aHide = !anObject->data()->isValid() ||
401 anObject->isDisabled() ||
402 !anObject->isDisplayed();
403 if (!aHide) { // check that this is not hidden result
404 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
405 bool isConcealed = aRes && aRes->isConcealed();
406 aHide = aRes && aRes->isConcealed();
407 // Hide the presentation with an empty shape. But isDisplayed state of the object should not
408 // be changed to the object becomes visible when the shape becomes not empty
409 if (!aHide && aRes.get())
410 aHide = !aRes->shape().get() || aRes->shape()->isNull();
413 // setDisplayed has to be called in order to synchronize internal state of the object
414 // with list of displayed objects
415 if (myWorkshop->module()->canDisplayObject(anObject)) {
416 anObject->setDisplayed(true);
417 aDisplayed = displayObject(anObject);
419 aDoFitAll = aDoFitAll || neededFitAll(anObject, aNbOfShownObjects);
421 anObject->setDisplayed(false);
425 bool isCustomized = customizeCurrentObject(anObjects, aDisplayed);
427 //if (myObjectBrowser)
428 // myObjectBrowser->processEvent(theMsg);
430 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION));
431 //VSV FitAll updated viewer by itself
433 myWorkshop->viewer()->fitAll();
435 workshop()->displayer()->updateViewer();
437 //if (aHasPart) { // TODO: Avoid activate last part on loading of document
438 // activateLastPart();
442 //******************************************************
443 void XGUI_WorkshopListener::onFeatureEmptyPresentationMsg(
444 const std::shared_ptr<ModelAPI_ObjectUpdatedMessage>& theMsg)
446 std::set<ObjectPtr> anObjects = theMsg->objects();
447 std::set<ObjectPtr>::const_iterator aIt;
448 #ifdef DEBUG_FEATURE_CREATED
450 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
451 anInfo.append(ModuleBase_Tools::objectInfo((*aIt)));
453 QString anInfoStr = anInfo.join(";\t");
454 qDebug(QString("onFeatureEmptyPresentationMsg: %1, %2")
455 .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str());
458 XGUI_Workshop* aWorkshop = workshop();
459 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
461 bool aRedisplayed = false;
462 for (aIt = anObjects.begin(); aIt != anObjects.end(); ++aIt) {
463 ObjectPtr anObject = *aIt;
464 aRedisplayed = aDisplayer->erase(anObject, false) || aRedisplayed;
468 aDisplayer->updateViewer();
471 bool XGUI_WorkshopListener::event(QEvent * theEvent)
473 PostponeMessageQtEvent* aPostponedEv = dynamic_cast<PostponeMessageQtEvent*>(theEvent);
475 std::shared_ptr<Events_Message> aEventPtr = aPostponedEv->postponedMessage();
476 processEvent(aEventPtr);
482 //**************************************************************
483 bool XGUI_WorkshopListener::displayObject(ObjectPtr theObj)
485 #ifdef DEBUG_RESULT_COMPSOLID
486 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(theObj);
487 if (aRes.get() && (ModelAPI_Tools::hasSubResults(aRes) || ModelAPI_Tools::compSolidOwner(aRes))) {
488 ResultCompSolidPtr aCompSolidRes = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(aRes);
489 if (aCompSolidRes.get()) {
490 qDebug("COMPSOLID: displayObject");
495 bool aDisplayed = false;
496 XGUI_Workshop* aWorkshop = workshop();
497 // do not display the object if it has sub objects. They should be displayed separately.
498 if (!aWorkshop->module()->canDisplayObject(theObj) ||
499 ModelAPI_Tools::hasSubResults(std::dynamic_pointer_cast<ModelAPI_Result>(theObj)))
502 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
503 int aNb = aDisplayer->objectsCount();
504 return aDisplayer->display(theObj, false);
507 //**************************************************************
508 bool XGUI_WorkshopListener::neededFitAll(ObjectPtr theObj, const int theNbOfShownObjects)
510 bool aFirstVisualizedBody = false;
512 if (theNbOfShownObjects == 0) {
513 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObj);
515 std::string aResultGroupName = aResult->groupName();
516 if (aResultGroupName == ModelAPI_ResultBody::group() ||
517 aResultGroupName == ModelAPI_ResultGroup::group()) {
518 std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
519 aFirstVisualizedBody = aShapePtr.get() != NULL;
523 return aFirstVisualizedBody;
526 bool XGUI_WorkshopListener::customizeCurrentObject(const std::set<ObjectPtr>& theObjects,
527 bool theForceRedisplay)
529 XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr();
530 FeaturePtr aCurrentFeature;
531 if (anOperationMgr->hasOperation()) {
532 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
533 (anOperationMgr->currentOperation());
535 aCurrentFeature = aFOperation->feature();
539 bool aCustomized = false;
540 if (aCurrentFeature.get()) {
541 // the customize presentation should be redisplayed if force redislayed is true or
542 // if a list of message objects contains the operation feature for case when
543 // the feature is hidden, but arguments of the feature are modified
544 // e.g. extrusion is hidden(h=0) but sketch is chosen
545 if (theForceRedisplay || theObjects.find(aCurrentFeature) != theObjects.end()) {
546 aCustomized = myWorkshop->module()->customizeObject(aCurrentFeature,
547 ModuleBase_IModule::CustomizeArguments, false) || aCustomized;
548 aCustomized = myWorkshop->module()->customizeObject(aCurrentFeature,
549 ModuleBase_IModule::CustomizeResults, false) || aCustomized;
550 aCustomized = myWorkshop->module()->customizeObject(aCurrentFeature,
551 ModuleBase_IModule::CustomizeHighlightedObjects, false) || aCustomized;
557 XGUI_Workshop* XGUI_WorkshopListener::workshop() const
559 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
560 return aConnector->workshop();