Salome HOME
Do not activate/deactivate part if an operation is launched.
[modules/shaper.git] / src / PartSet / PartSet_MenuMgr.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_MenuMgr.cpp
4 // Created:     03 April 2015
5 // Author:      Vitaly SMETANNIKOV
6
7 #include "PartSet_MenuMgr.h"
8 #include "PartSet_Module.h"
9 #include "PartSet_SketcherMgr.h"
10 #include "PartSet_Tools.h"
11
12 #include <PartSetPlugin_Part.h>
13
14 #include <GeomAPI_Pnt2d.h>
15 #include <GeomDataAPI_Point2D.h>
16
17 #include <SketchPlugin_ConstraintCoincidence.h>
18 #include <SketchPlugin_Line.h>
19 #include <SketchPlugin_Circle.h>
20 #include <SketchPlugin_Point.h>
21 #include <SketchPlugin_Sketch.h>
22
23 #include <ModuleBase_ISelection.h>
24 #include <ModuleBase_Operation.h>
25
26 #include <XGUI_ModuleConnector.h>
27 #include <XGUI_Workshop.h>
28 #include <XGUI_Displayer.h>
29
30 #include <Events_Loop.h>
31 #include <ModelAPI_Events.h>
32 #include <ModelAPI_Session.h>
33 #include <ModelAPI_ResultPart.h>
34 #include <ModelAPI_ResultParameter.h>
35
36 #include <QAction>
37 #include <QMenu>
38
39 #include <TopoDS.hxx>
40 #include <BRep_Tool.hxx>
41
42 PartSet_MenuMgr::PartSet_MenuMgr(PartSet_Module* theModule)
43   : QObject(theModule), myModule(theModule), myPrevId(-1)
44 {
45   createActions();
46 }
47
48
49 QAction* PartSet_MenuMgr::action(const QString& theId) const
50 {
51   if (myActions.contains(theId))
52     return myActions[theId];
53   return 0;
54 }
55
56 void PartSet_MenuMgr::addAction(const QString& theId, QAction* theAction)
57 {
58   if (myActions.contains(theId))
59     qCritical("A command with Id = '%s' already defined!", qPrintable(theId));
60   theAction->setData(theId);
61   connect(theAction, SIGNAL(triggered(bool)), this, SLOT(onAction(bool)));
62   myActions[theId] = theAction;
63 }
64
65 void PartSet_MenuMgr::createActions()
66 {
67   QAction* aAction;
68
69   aAction = new QAction(tr("Auxiliary"), this);
70   aAction->setCheckable(true);
71   addAction("AUXILIARY_CMD", aAction);
72
73   aAction = new QAction(QIcon(":icons/activate.png"), tr("Activate"), this);
74   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onActivatePart(bool)));
75   myActions["ACTIVATE_PART_CMD"] = aAction;
76
77   aAction = new QAction(QIcon(":icons/deactivate.png"), tr("Deactivate"), this);
78   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onActivatePartSet(bool)));
79   myActions["DEACTIVATE_PART_CMD"] = aAction;
80
81   // Activate PartSet
82   aAction = new QAction(QIcon(":icons/activate.png"), tr("Activate"), this);
83   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onActivatePartSet(bool)));
84   myActions["ACTIVATE_PARTSET_CMD"] = aAction;
85
86   aAction = new QAction(QIcon(":icons/edit.png"), tr("Edit..."), this);
87   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onEdit(bool)));
88   myActions["EDIT_CMD"] = aAction;
89 }
90
91
92 void PartSet_MenuMgr::onAction(bool isChecked)
93 {
94   QAction* aAction = static_cast<QAction*>(sender());
95   QString anId = aAction->data().toString();
96
97   if (anId == "AUXILIARY_CMD") {
98     setAuxiliary(isChecked);
99   }
100 }
101
102 /// Returns point of coincidence feature
103 /// \param theFeature the coincidence feature
104 /// \param theAttribute the attribute name
105 std::shared_ptr<GeomAPI_Pnt2d> getPoint(std::shared_ptr<ModelAPI_Feature>& theFeature,
106                                         const std::string& theAttribute)
107 {
108   std::shared_ptr<GeomDataAPI_Point2D> aPointAttr;
109
110   if (!theFeature->data())
111     return std::shared_ptr<GeomAPI_Pnt2d>();
112
113   FeaturePtr aFeature;
114   std::shared_ptr<ModelAPI_AttributeRefAttr> anAttr = std::dynamic_pointer_cast<
115       ModelAPI_AttributeRefAttr>(theFeature->data()->attribute(theAttribute));
116   if (anAttr)
117     aFeature = ModelAPI_Feature::feature(anAttr->object());
118
119   if (aFeature && aFeature->getKind() == SketchPlugin_Point::ID())
120     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
121         aFeature->data()->attribute(SketchPlugin_Point::COORD_ID()));
122
123   else if (anAttr->attr()) {
124     aPointAttr = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(anAttr->attr());
125   }
126   if (aPointAttr.get() != NULL)
127     return aPointAttr->pnt();
128   return std::shared_ptr<GeomAPI_Pnt2d>();
129 }
130
131 /// Returns list of features connected in a councedence feature point
132 /// \param theStartCoin the coincidence feature
133 /// \param theList a list which collects lines features
134 /// \param theAttr the attribute name
135 void findCoincidences(FeaturePtr theStartCoin, QList<FeaturePtr>& theList, std::string theAttr)
136 {
137   AttributeRefAttrPtr aPnt = theStartCoin->refattr(theAttr);
138   FeaturePtr aObj = ModelAPI_Feature::feature(aPnt->object());
139   if (!theList.contains(aObj)) {
140     std::shared_ptr<GeomAPI_Pnt2d> aOrig = getPoint(theStartCoin, theAttr);
141     if (aOrig.get() == NULL)
142       return;
143     theList.append(aObj);
144     const std::set<AttributePtr>& aRefsList = aObj->data()->refsToMe();
145     std::set<AttributePtr>::const_iterator aIt;
146     for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
147       std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
148       FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
149       if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
150         std::shared_ptr<GeomAPI_Pnt2d> aPnt = getPoint(aConstrFeature, theAttr);
151         if (aPnt.get() && aOrig->isEqual(aPnt)) {
152           findCoincidences(aConstrFeature, theList, SketchPlugin_ConstraintCoincidence::ENTITY_A());
153           findCoincidences(aConstrFeature, theList, SketchPlugin_ConstraintCoincidence::ENTITY_B());
154         }
155       }
156     }
157   }
158 }
159
160
161 bool PartSet_MenuMgr::addViewerMenu(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const
162 {
163   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
164   if (!PartSet_SketcherMgr::isSketchOperation(anOperation) &&
165       !PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
166     return false;
167
168   myCoinsideLines.clear();
169   ModuleBase_ISelection* aSelection = myModule->workshop()->selection();
170
171   bool aIsDetach = false;
172   bool hasAttribute = false;
173   bool hasFeature = false;
174
175   QList<ModuleBase_ViewerPrs> aPrsList = aSelection->getSelected(ModuleBase_ISelection::AllControls);
176   TopoDS_Shape aShape;
177   ResultPtr aResult;
178   FeaturePtr aFeature;
179   foreach(ModuleBase_ViewerPrs aPrs, aPrsList) {
180     aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aPrs.object());
181     if (aResult.get() != NULL) {
182       aShape = aPrs.shape();
183       if (aShape.IsEqual(aResult->shape()->impl<TopoDS_Shape>()))
184         hasFeature = true;
185       else
186         hasAttribute = true;
187     } else {
188       aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aPrs.object());
189       hasFeature = (aFeature.get() != NULL);
190     }
191   }
192
193   if (aPrsList.size() == 1) {
194     TopoDS_Shape aShape = aPrsList.first().shape();
195     if ((!aShape.IsNull()) && aShape.ShapeType() == TopAbs_VERTEX) {
196       // Find 2d coordinates
197       FeaturePtr aSketchFea = myModule->sketchMgr()->activeSketch();
198       if (aSketchFea->getKind() == SketchPlugin_Sketch::ID()) {
199         gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
200         std::shared_ptr<GeomAPI_Pnt> aPnt3d(new GeomAPI_Pnt(aPnt.X(), aPnt.Y(), aPnt.Z()));
201         std::shared_ptr<GeomAPI_Pnt2d> aSelPnt = PartSet_Tools::convertTo2D(aSketchFea, aPnt3d);
202
203         // Find coincident in these coordinates
204         ObjectPtr aObj = aPrsList.first().object();
205         FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
206         const std::set<AttributePtr>& aRefsList = aFeature->data()->refsToMe();
207         std::set<AttributePtr>::const_iterator aIt;
208         FeaturePtr aCoincident;
209         for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
210           std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
211           FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
212           if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
213             std::shared_ptr<GeomAPI_Pnt2d> a2dPnt = 
214               getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
215             if (a2dPnt.get() && aSelPnt->isEqual(a2dPnt)) { 
216               aCoincident = aConstrFeature;
217               break;
218             } else {
219               a2dPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
220               if (a2dPnt.get() && aSelPnt->isEqual(a2dPnt)) { 
221                 aCoincident = aConstrFeature;
222                 break;
223               }
224             }
225           }
226         }
227         // If we have coincidence then add Detach menu
228         if (aCoincident.get() != NULL) {
229           mySelectedFeature = aCoincident;
230           findCoincidences(mySelectedFeature, myCoinsideLines, SketchPlugin_ConstraintCoincidence::ENTITY_A());
231           findCoincidences(mySelectedFeature, myCoinsideLines, SketchPlugin_ConstraintCoincidence::ENTITY_B());
232           if (myCoinsideLines.size() > 0) {
233             aIsDetach = true;
234             QMenu* aSubMenu = theMenu->addMenu(tr("Detach"));
235             QAction* aAction;
236             int i = 0;
237             foreach (FeaturePtr aCoins, myCoinsideLines) {
238               aAction = aSubMenu->addAction(aCoins->data()->name().c_str());
239               aAction->setData(QVariant(i));
240               i++;
241             }
242             connect(aSubMenu, SIGNAL(hovered(QAction*)), SLOT(onLineHighlighted(QAction*)));
243             connect(aSubMenu, SIGNAL(aboutToHide()), SLOT(onDetachMenuHide()));
244             connect(aSubMenu, SIGNAL(triggered(QAction*)), SLOT(onLineDetach(QAction*)));
245           } 
246         }
247       }
248     }
249   }
250   if ((!aIsDetach) && hasFeature) {
251     theMenu->addAction(theStdActions["DELETE_CMD"]);
252   }
253   if (hasAttribute)
254     return true;
255   bool isAuxiliary;
256   if (canSetAuxiliary(isAuxiliary)) {
257     QAction* anAction = action("AUXILIARY_CMD");
258     theMenu->addAction(anAction);
259     anAction->setChecked(isAuxiliary);
260   }
261   return true;
262 }
263
264 void PartSet_MenuMgr::onLineHighlighted(QAction* theAction)
265 {
266   if (myPrevId != -1) {
267     // Restore color for previous object
268     setLineColor(myPrevId, myColor, false);
269   }
270   myPrevId = theAction->data().toInt();
271   myColor = setLineColor(myPrevId, Qt::white, true);
272 }
273
274 QColor PartSet_MenuMgr::setLineColor(int theId, const QColor theColor, bool theUpdate)
275 {
276   XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
277   XGUI_Workshop* aWorkshop = aConnector->workshop();
278   XGUI_Displayer* aDisplayer = aWorkshop->displayer();
279
280   FeaturePtr aLine = myCoinsideLines.at(myPrevId);
281   std::list<ResultPtr>::const_iterator aIt;
282   const std::list<ResultPtr>& aResults = aLine->results();
283   QColor aColor;
284   for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
285     aColor = aDisplayer->setObjectColor((*aIt), theColor, false);
286   }
287   if (theUpdate)
288     aDisplayer->updateViewer();
289   return aColor;
290 }
291
292
293 void PartSet_MenuMgr::onLineDetach(QAction* theAction)
294 {
295   int aId = theAction->data().toInt();
296   FeaturePtr aLine = myCoinsideLines.at(aId);
297   std::shared_ptr<GeomAPI_Pnt2d> aOrig = getPoint(mySelectedFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
298   if (aOrig.get() == NULL)
299     aOrig = getPoint(mySelectedFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
300   
301   gp_Pnt aOr = aOrig->impl<gp_Pnt>();
302   const std::set<AttributePtr>& aRefsList = aLine->data()->refsToMe();
303
304   QObjectPtrList aToDelFeatures;
305   std::set<AttributePtr>::const_iterator aIt;
306   // Find all coincedences corresponded to the selected line in the selected point
307   for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
308     std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
309     FeaturePtr aConstrFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
310     if (aConstrFeature->getKind() == SketchPlugin_ConstraintCoincidence::ID()) { 
311       std::shared_ptr<GeomAPI_Pnt2d> aPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_A());
312       if (aPnt.get() == NULL)
313         aPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
314       if (aPnt.get() == NULL)
315         return;
316       gp_Pnt aP = aPnt->impl<gp_Pnt>();
317       if (aOrig->isEqual(aPnt)) {
318         aToDelFeatures.append(aConstrFeature);
319       } else {
320         aPnt = getPoint(aConstrFeature, SketchPlugin_ConstraintCoincidence::ENTITY_B());
321         aP = aPnt->impl<gp_Pnt>();
322         if (aOrig->isEqual(aPnt)) {
323           aToDelFeatures.append(aConstrFeature);
324           break;
325         }
326       }
327     }
328   }
329   if (aToDelFeatures.size() > 0) {
330     XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
331     XGUI_Workshop* aWorkshop = aConnector->workshop();
332     ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
333     if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
334       anOperation->abort();
335
336     SessionPtr aMgr = ModelAPI_Session::get();
337     std::set<FeaturePtr> anIgnoredFeatures;
338     anIgnoredFeatures.insert(myModule->sketchMgr()->activeSketch());
339
340     QString aName = tr("Detach %1").arg(aLine->data()->name().c_str());
341     aMgr->startOperation(aName.toStdString());
342     aWorkshop->deleteFeatures(aToDelFeatures, anIgnoredFeatures);
343     aMgr->finishOperation();
344   }
345   myCoinsideLines.clear();
346 }
347
348
349 void PartSet_MenuMgr::onDetachMenuHide()
350 {
351   if (myPrevId != -1) {
352     // Restore color for previous object
353     setLineColor(myPrevId, myColor, false);
354   }
355   // Clear previous definitions
356   myPrevId = -1;
357 }
358
359   
360 void PartSet_MenuMgr::setAuxiliary(const bool isChecked)
361 {
362   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
363
364   bool isActiveSketch = PartSet_SketcherMgr::isSketchOperation(anOperation) ||
365                         PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
366   if (!isActiveSketch)
367     return;
368
369   QObjectPtrList anObjects;
370   bool isUseTransaction = false;
371   // 1. change auxiliary type of a created feature
372   if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation) &&
373     PartSet_SketcherMgr::isEntity(anOperation->id().toStdString()) ) {
374     anObjects.append(anOperation->feature());
375   }
376   else {
377     isUseTransaction = true;
378     // 2. change auxiliary type of selected sketch entities
379     ModuleBase_ISelection* aSelection = myModule->workshop()->selection();
380     anObjects = aSelection->selectedPresentations();
381   }
382
383   QAction* anAction = action("AUXILIARY_CMD");
384   SessionPtr aMgr = ModelAPI_Session::get();
385   if (isUseTransaction) {
386     if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
387       anOperation->abort();
388     aMgr->startOperation(anAction->text().toStdString());
389   }
390   myModule->sketchMgr()->storeSelection();
391
392   if (anObjects.size() > 0) {
393     QObjectPtrList::const_iterator anIt = anObjects.begin(), aLast = anObjects.end();
394     for (; anIt != aLast; anIt++) {
395       FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
396       if (aFeature.get() != NULL) {
397         std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
398                             std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
399         if (aSketchFeature.get() != NULL) {
400           std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
401
402           std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr = 
403             std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
404           if (anAuxiliaryAttr)
405             anAuxiliaryAttr->setValue(isChecked);
406         }
407       }
408     }
409   }
410   if (isUseTransaction) {
411     aMgr->finishOperation();
412     XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myModule->workshop());
413     XGUI_Workshop* aWorkshop = aConnector->workshop();
414     aWorkshop->updateCommandStatus();
415   }
416
417   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
418   myModule->sketchMgr()->restoreSelection();
419 }
420
421 bool PartSet_MenuMgr::canSetAuxiliary(bool& theValue) const
422 {
423   bool anEnabled = false;
424   ModuleBase_Operation* anOperation = myModule->workshop()->currentOperation();
425
426   bool isActiveSketch = PartSet_SketcherMgr::isSketchOperation(anOperation) ||
427                         PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
428   if (!isActiveSketch)
429     return anEnabled;
430
431   QObjectPtrList anObjects;
432   // 1. change auxiliary type of a created feature
433   if (PartSet_SketcherMgr::isNestedCreateOperation(anOperation) &&
434     PartSet_SketcherMgr::isEntity(anOperation->id().toStdString()) ) {
435     anObjects.append(anOperation->feature());
436   }
437   else {
438     /// The operation should not be aborted here, because the method does not changed
439     /// the auxilliary state, but checks the possibility to perform this
440     ///if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
441     ///  anOperation->abort();
442     // 2. change auxiliary type of selected sketch entities
443     ModuleBase_ISelection* aSelection = myModule->workshop()->selection();
444     anObjects = aSelection->selectedPresentations();
445   }
446
447   bool isNotAuxiliaryFound = false;
448   if (anObjects.size() > 0) {
449     QObjectPtrList::const_iterator anIt = anObjects.begin(), aLast = anObjects.end();
450     for (; anIt != aLast && !isNotAuxiliaryFound; anIt++) {
451       FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
452       if ((aFeature.get() != NULL) && PartSet_SketcherMgr::isEntity(aFeature->getKind())) {
453         anEnabled = true;
454         std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
455                             std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
456         if (aSketchFeature.get() != NULL) {
457           std::string anAttribute = SketchPlugin_SketchEntity::AUXILIARY_ID();
458
459           std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr = 
460             std::dynamic_pointer_cast<ModelAPI_AttributeBoolean>(aSketchFeature->data()->attribute(anAttribute));
461           if (anAuxiliaryAttr)
462             isNotAuxiliaryFound = !anAuxiliaryAttr->value();
463         }
464       }
465     }
466   }
467   theValue = anObjects.size() && !isNotAuxiliaryFound;
468   return anEnabled;
469 }
470
471 void PartSet_MenuMgr::onActivatePart(bool)
472 {
473   if (myModule->workshop()->currentOperation())
474     return;
475   QObjectPtrList aObjects = myModule->workshop()->selection()->selectedObjects();
476   if (aObjects.size() > 0) {
477     ObjectPtr aObj = aObjects.first();
478     ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
479     if (!aPart.get()) {
480       FeaturePtr aPartFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
481       if (aPartFeature.get() && (aPartFeature->getKind() == PartSetPlugin_Part::ID())) {
482         aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aPartFeature->firstResult());
483       }
484     }
485     if (aPart.get())
486       aPart->activate();
487   }
488 }
489
490 void PartSet_MenuMgr::onActivatePartSet(bool)
491 {
492   if (myModule->workshop()->currentOperation())
493     return;
494   SessionPtr aMgr = ModelAPI_Session::get();
495   bool isNewTransaction = !aMgr->isOperation();
496   // activation may cause changes in current features in document, so it must be in transaction
497   if (isNewTransaction) {
498     aMgr->startOperation("Activation");
499   }
500   aMgr->setActiveDocument(aMgr->moduleDocument());
501   if (isNewTransaction) {
502     aMgr->finishOperation();
503   }
504 }
505
506 void PartSet_MenuMgr::onEdit(bool)
507 {
508   QObjectPtrList aObjects = myModule->workshop()->selection()->selectedObjects();
509   FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObjects.first());
510   if (aFeature == NULL) {
511     ResultParameterPtr aParam = 
512       std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aObjects.first());
513     if (aParam.get() != NULL) {
514       aFeature = ModelAPI_Feature::feature(aParam);
515     }
516   }
517   if (aFeature.get() != NULL)
518     myModule->editFeature(aFeature);
519 }