1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include "PartSet_Module.h"
4 #include <PartSet_WidgetSketchLabel.h>
5 #include <PartSet_Validators.h>
6 #include <PartSet_Tools.h>
7 #include <PartSet_WidgetPoint2d.h>
8 #include <PartSet_WidgetPoint2dDistance.h>
9 #include <PartSet_WidgetShapeSelector.h>
10 #include <PartSet_WidgetConstraintShapeSelector.h>
11 #include <PartSet_SketcherMgr.h>
13 #include <ModuleBase_Operation.h>
14 #include <ModuleBase_IViewer.h>
15 #include <ModuleBase_IViewWindow.h>
16 #include <ModuleBase_IPropertyPanel.h>
17 #include <ModuleBase_WidgetEditor.h>
18 #include <ModuleBase_FilterFactory.h>
19 #include <ModuleBase_FilterLinearEdge.h>
20 #include <ModuleBase_FilterFace.h>
21 #include <ModuleBase_FilterMulti.h>
22 #include <ModuleBase_FilterCustom.h>
23 #include <ModuleBase_FilterNoConsructionSubShapes.h>
25 #include <ModelAPI_Object.h>
26 #include <ModelAPI_Events.h>
27 #include <ModelAPI_Validator.h>
28 #include <ModelAPI_Data.h>
29 #include <ModelAPI_Session.h>
30 #include <ModelAPI_ShapeValidator.h>
32 #include <GeomDataAPI_Point2D.h>
33 #include <GeomDataAPI_Point.h>
34 #include <GeomDataAPI_Dir.h>
36 #include <XGUI_Displayer.h>
37 #include <XGUI_Workshop.h>
38 #include <XGUI_OperationMgr.h>
39 #include <XGUI_PropertyPanel.h>
40 #include <XGUI_ModuleConnector.h>
41 #include <XGUI_Tools.h>
43 #include <SketchPlugin_Feature.h>
44 #include <SketchPlugin_Sketch.h>
45 #include <SketchPlugin_Line.h>
46 //#include <SketchPlugin_Arc.h>
47 //#include <SketchPlugin_Circle.h>
48 #include <SketchPlugin_ConstraintLength.h>
49 #include <SketchPlugin_ConstraintDistance.h>
50 #include <SketchPlugin_ConstraintParallel.h>
51 #include <SketchPlugin_ConstraintPerpendicular.h>
52 #include <SketchPlugin_ConstraintRadius.h>
53 //#include <SketchPlugin_ConstraintRigid.h>
55 #include <Events_Loop.h>
56 #include <Config_PropManager.h>
58 #include <StdSelect_TypeOfFace.hxx>
59 #include <TopoDS_Vertex.hxx>
61 #include <TopoDS_Shape.hxx>
62 #include <BRep_Tool.hxx>
65 #include <QMouseEvent>
68 #include <QApplication>
69 #include <QMessageBox>
70 #include <QMainWindow>
72 #include <GeomAlgoAPI_FaceBuilder.h>
73 #include <GeomDataAPI_Dir.h>
79 /*!Create and return new instance of XGUI_Module*/
80 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop* theWshop)
82 return new PartSet_Module(theWshop);
85 PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
86 : ModuleBase_IModule(theWshop),
87 myRestartingMode(RM_None)
89 //myWorkshop = dynamic_cast<XGUI_Workshop*>(theWshop);
90 mySketchMgr = new PartSet_SketcherMgr(this);
92 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
93 XGUI_Workshop* aWorkshop = aConnector->workshop();
95 XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
96 connect(anOpMgr, SIGNAL(keyEnterReleased()), this, SLOT(onEnterReleased()));
97 connect(anOpMgr, SIGNAL(keyDeleteReleased()), this, SLOT(onDeleteObjects()));
98 connect(anOpMgr, SIGNAL(operationActivatedByPreselection()),
99 this, SLOT(onOperationActivatedByPreselection()));
101 ModuleBase_IViewer* aViewer = theWshop->viewer();
102 connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
103 this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
108 PartSet_Module::~PartSet_Module()
110 if (!myDocumentShapeFilter.IsNull())
111 myDocumentShapeFilter.Nullify();
114 void PartSet_Module::registerValidators()
116 //Registering of validators
117 SessionPtr aMgr = ModelAPI_Session::get();
118 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
119 aFactory->registerValidator("PartSet_DistanceValidator", new PartSet_DistanceValidator);
120 aFactory->registerValidator("PartSet_LengthValidator", new PartSet_LengthValidator);
121 aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
122 aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
123 aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
124 aFactory->registerValidator("PartSet_RigidValidator", new PartSet_RigidValidator);
125 aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
126 aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
127 aFactory->registerValidator("PartSet_SketchValidator", new PartSet_SketchValidator);
130 void PartSet_Module::registerFilters()
132 //Registering of selection filters
133 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
134 ModuleBase_FilterFactory* aFactory = aConnector->selectionFilters();
136 aFactory->registerFilter("EdgeFilter", new ModuleBase_FilterLinearEdge);
137 aFactory->registerFilter("FaceFilter", new ModuleBase_FilterFace);
138 aFactory->registerFilter("MultiFilter", new ModuleBase_FilterMulti);
139 Handle(SelectMgr_Filter) aSelectFilter = new ModuleBase_FilterNoConsructionSubShapes(workshop());
140 aFactory->registerFilter("NoConstructionSubShapesFilter",
141 new ModuleBase_FilterCustom(aSelectFilter));
144 void PartSet_Module::registerProperties()
146 Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
148 Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
149 Config_Prop::Integer, SKETCH_WIDTH);
152 void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
154 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
155 mySketchMgr->commitNestedSketch(theOperation);
158 if (theOperation->isEditOperation())
160 // the selection is cleared after commit the create operation
161 // in order to do not use the same selected objects in the restarted operation
162 // for common behaviour, the selection is cleared even if the operation is not restarted
163 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
164 if (!aContext.IsNull())
165 aContext->ClearSelected();
167 /// Restart sketcher operations automatically
168 FeaturePtr aFeature = theOperation->feature();
169 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
170 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
171 if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
172 myRestartingMode == RM_EmptyFeatureUsed)) {
173 myLastOperationId = theOperation->id();
174 myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
176 launchOperation(myLastOperationId);
178 breakOperationSequence();
181 void PartSet_Module::breakOperationSequence()
183 myLastOperationId = "";
184 myLastFeature = FeaturePtr();
185 myRestartingMode = RM_None;
188 void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
190 breakOperationSequence();
193 void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation)
195 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
196 mySketchMgr->startSketch(theOperation);
198 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
199 mySketchMgr->startNestedSketch(theOperation);
202 if (myDocumentShapeFilter.IsNull())
203 myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop);
204 myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
207 void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
209 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
210 mySketchMgr->stopSketch(theOperation);
212 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
213 mySketchMgr->stopNestedSketch(theOperation);
215 myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
218 bool PartSet_Module::canUndo() const
220 bool aCanUndo = false;
221 SessionPtr aMgr = ModelAPI_Session::get();
222 if (aMgr->hasModuleDocument() && aMgr->canUndo()) {
223 aCanUndo = !aMgr->isOperation();
224 if (!aCanUndo) // check the enable state additionally by sketch manager
225 aCanUndo = aMgr->canUndo();
230 bool PartSet_Module::canRedo() const
232 bool aCanRedo = false;
233 SessionPtr aMgr = ModelAPI_Session::get();
234 if (aMgr->hasModuleDocument() && aMgr->canRedo()) {
235 aCanRedo = !aMgr->isOperation();
236 if (!aCanRedo) // check the enable state additionally by sketch manager
237 aCanRedo = aMgr->canRedo();
242 bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
244 bool aCanDisplay = false;
245 if (!mySketchMgr->canDisplayObject())
247 CompositeFeaturePtr aSketchFeature = mySketchMgr->activeSketch();
248 if (aSketchFeature.get() != NULL) {
249 FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
251 // MPV: the second and third conditions to avoid crash on exit for application
252 if (aFeature.get() != NULL && aFeature->data().get() && aFeature->data()->isValid()) {
253 if (aFeature == aSketchFeature) {
256 else if (aSketchFeature.get() && aSketchFeature->data().get() &&
257 aSketchFeature->data()->isValid()) {
258 for (int i = 0; i < aSketchFeature->numberOfSubs() && !aCanDisplay; i++) {
259 FeaturePtr aSubFeature = aSketchFeature->subFeature(i);
260 std::list<ResultPtr> aResults = aSubFeature->results();
261 std::list<ResultPtr>::const_iterator aIt;
262 for (aIt = aResults.begin(); aIt != aResults.end() && !aCanDisplay; ++aIt) {
263 if (theObject == (*aIt))
266 if (aSubFeature == theObject)
273 aCanDisplay = ModuleBase_IModule::canDisplayObject(theObject);
278 void PartSet_Module::addViewerItems(QMenu* theMenu) const
280 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
281 if (!PartSet_SketcherMgr::isSketchOperation(anOperation) &&
282 !PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
285 ModuleBase_ISelection* aSelection = myWorkshop->selection();
286 QObjectPtrList aObjects = aSelection->selectedPresentations();
287 if (aObjects.size() > 0) {
288 bool hasFeature = false;
289 foreach(ObjectPtr aObject, aObjects)
291 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
292 if (aFeature.get() != NULL) {
297 theMenu->addAction(action("DELETE_PARTSET_CMD"));
301 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
303 ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
304 if (PartSet_SketcherMgr::isSketchOperation(theOperation) && (theOperation->isEditOperation())) {
305 // we have to manually activate the sketch label in edit mode
306 aPanel->activateWidget(aPanel->modelWidgets().first());
310 // Restart last operation type
311 if ((theOperation->id() == myLastOperationId) && myLastFeature) {
312 ModuleBase_ModelWidget* aWgt = aPanel->activeWidget();
313 if (theOperation->id().toStdString() == SketchPlugin_Line::ID()) {
314 // Initialise new line with first point equal to end of previous
315 PartSet_WidgetPoint2D* aPnt2dWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
317 std::shared_ptr<ModelAPI_Data> aData = myLastFeature->data();
318 std::shared_ptr<GeomDataAPI_Point2D> aPoint =
319 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
321 aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
322 PartSet_Tools::setConstraints(mySketchMgr->activeSketch(), theOperation->feature(),
323 aWgt->attributeID(), aPoint->x(), aPoint->y());
324 aPanel->activateNextWidget(aPnt2dWgt);
329 // Start editing constraint
330 if (theOperation->isEditOperation()) {
331 // TODO: #391 - to be removed
332 std::string aId = theOperation->id().toStdString();
333 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation) &&
334 PartSet_SketcherMgr::isDistanceOperation(theOperation)) {
335 // Find and activate widget for management of point for dimension line position
336 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
337 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
338 PartSet_WidgetPoint2D* aPntWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
340 aPanel->activateWidget(aPntWgt);
350 void PartSet_Module::onSelectionChanged()
352 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
356 bool isSketcherOp = false;
357 // An edit operation is enable only if the current opeation is the sketch operation
358 if (mySketchMgr->activeSketch()) {
359 if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
360 isSketcherOp = PartSet_SketcherMgr::isSketchOperation(aOperation);
363 // Editing of constraints can be done on selection
364 ModuleBase_ISelection* aSelect = myWorkshop->selection();
365 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
366 if (aSelected.size() == 1) {
367 ModuleBase_ViewerPrs aPrs = aSelected.first();
368 ObjectPtr aObject = aPrs.object();
369 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
371 std::string aId = aFeature->getKind();
372 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
373 (aId == SketchPlugin_ConstraintLength::ID()) ||
374 (aId == SketchPlugin_ConstraintDistance::ID())) {
375 editFeature(aFeature);
382 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
384 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
385 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
386 anOpMgr->onKeyReleased(theEvent);
389 void PartSet_Module::onEnterReleased()
391 myRestartingMode = RM_EmptyFeatureUsed;
394 void PartSet_Module::onDeleteObjects()
396 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
397 if (PartSet_SketcherMgr::isSketchOperation(anOperation) ||
398 PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
402 void PartSet_Module::onOperationActivatedByPreselection()
404 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
405 if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
406 // Set final definitions if they are necessary
407 //propertyPanelDefined(aOperation);
409 /// Commit sketcher operations automatically
410 anOperation->commit();
414 void PartSet_Module::onNoMoreWidgets()
416 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
417 if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
419 if (myRestartingMode != RM_Forbided)
420 myRestartingMode = RM_LastFeatureUsed;
421 anOperation->commit();
426 void PartSet_Module::onVertexSelected()
428 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
429 if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
430 /// If last line finished on vertex the lines creation sequence has to be break
431 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
432 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
433 if (aWidgets.last() == aPanel->activeWidget()) {
434 myRestartingMode = RM_Forbided;
439 ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
440 Config_WidgetAPI* theWidgetApi, std::string theParentId)
442 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
443 XGUI_Workshop* aWorkshop = aConnector->workshop();
444 ModuleBase_ModelWidget* aWgt = NULL;
445 if (theType == "sketch-start-label") {
446 PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, theParentId);
447 aLabelWgt->setWorkshop(aWorkshop);
448 connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
449 mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
451 } else if (theType == "sketch-2dpoint_selector") {
452 PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
453 aPointWgt->setWorkshop(aWorkshop);
454 aPointWgt->setSketch(mySketchMgr->activeSketch());
455 connect(aPointWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
457 } if (theType == "point2ddistance") {
458 PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
459 aDistanceWgt->setWorkshop(aWorkshop);
460 aDistanceWgt->setSketch(mySketchMgr->activeSketch());
462 } if (theType == "sketch_shape_selector") {
463 PartSet_WidgetShapeSelector* aShapeSelectorWgt =
464 new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
465 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
466 aWgt = aShapeSelectorWgt;
467 } if (theType == "sketch_constraint_shape_selector") {
468 PartSet_WidgetConstraintShapeSelector* aConstraintShapeSelectorWgt =
469 new PartSet_WidgetConstraintShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
470 aConstraintShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
471 aWgt = aConstraintShapeSelectorWgt;
476 void PartSet_Module::createActions()
478 QAction* aAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this);
479 addAction("DELETE_PARTSET_CMD", aAction);
482 QAction* PartSet_Module::action(const QString& theId) const
484 if (myActions.contains(theId))
485 return myActions[theId];
489 void PartSet_Module::addAction(const QString& theId, QAction* theAction)
491 if (myActions.contains(theId))
492 qCritical("A command with Id = '%s' already defined!", qPrintable(theId));
493 theAction->setData(theId);
494 connect(theAction, SIGNAL(triggered(bool)), this, SLOT(onAction(bool)));
495 myActions[theId] = theAction;
498 void PartSet_Module::onAction(bool isChecked)
500 QAction* aAction = static_cast<QAction*>(sender());
501 QString anId = aAction->data().toString();
503 if (anId == "DELETE_PARTSET_CMD") {
508 void PartSet_Module::deleteObjects()
510 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
511 bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation);
512 if (!isSketchOp && !PartSet_SketcherMgr::isNestedSketchOperation(anOperation))
515 // sketch feature should be skipped, only sub-features can be removed
516 // when sketch operation is active
517 CompositeFeaturePtr aSketch = mySketchMgr->activeSketch();
519 // selected objects should be collected before the current operation abort because
520 // the abort leads to selection lost on constraint objects. It can be corrected after #386 issue
521 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
522 ModuleBase_ISelection* aSel = aConnector->selection();
523 QObjectPtrList aSelectedObj = aSel->selectedPresentations();
525 XGUI_Workshop* aWorkshop = aConnector->workshop();
526 XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
527 if (!isSketchOp && anOpMgr->canStopOperation()) {
528 ModuleBase_Operation* aCurrentOp = anOpMgr->currentOperation();
533 std::set<FeaturePtr> aRefFeatures;
534 foreach (ObjectPtr aObj, aSelectedObj)
536 //ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
538 // TODO: check for what there is this condition. It is placed here historicaly because
539 // ther is this condition during remove features.
541 FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
542 if (aFeature.get() != NULL) {
543 aObj->document()->refsToFeature(aFeature, aRefFeatures, false);
547 QString aDescription = tr("Delete");
549 // according to #355 feature, it is not necessary to inform about dependencies during
550 // sketch delete operation
552 if (!aRefFeatures.empty()) {
553 QStringList aRefNames;
554 std::set<FeaturePtr>::const_iterator anIt = aRefFeatures.begin(),
555 aLast = aRefFeatures.end();
556 for (; anIt != aLast; anIt++) {
557 FeaturePtr aFeature = (*anIt);
558 if (aFeature == aSketch)
560 aRefNames.append((*anIt)->name().c_str());
562 if (!aRefNames.empty()) {
563 QString aNames = aRefNames.join(", ");
564 aDescription += aNames.prepend(" ");
566 QMainWindow* aDesktop = aWorkshop->desktop();
567 QMessageBox::StandardButton aRes = QMessageBox::warning(
568 aDesktop, tr("Delete features"),
569 QString(tr("Selected features are used in the following features: %1.\
570 These features will be deleted also. Would you like to continue?")).arg(aNames),
571 QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
572 if (aRes != QMessageBox::Yes)
577 SessionPtr aMgr = ModelAPI_Session::get();
578 aMgr->startOperation(aDescription.toStdString());
579 std::set<FeaturePtr>::const_iterator anIt = aRefFeatures.begin(),
580 aLast = aRefFeatures.end();
581 for (; anIt != aLast; anIt++) {
582 FeaturePtr aRefFeature = (*anIt);
583 if (aRefFeature == aSketch)
585 aRefFeature->document()->removeFeature(aRefFeature);
588 foreach (ObjectPtr aObj, aSelectedObj)
590 DocumentPtr aDoc = aObj->document();
591 //ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aObj);
593 // if (aDoc == aMgr->activeDocument()) {
597 //FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
598 FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
599 if (aFeature.get() != NULL) {
600 aDoc->removeFeature(aFeature);
604 aWorkshop->displayer()->updateViewer();
605 //myDisplayer->updateViewer();
606 aMgr->finishOperation();