1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include "PartSet_SketcherReetntrantMgr.h"
4 #include "PartSet_Module.h"
5 #include "PartSet_SketcherMgr.h"
6 #include "PartSet_WidgetPoint2d.h"
8 #include "ModelAPI_Session.h"
9 #include "ModelAPI_AttributeString.h"
10 #include "ModelAPI_AttributeRefAttr.h"
12 #include "GeomDataAPI_Point2D.h"
14 #include <ModuleBase_IPropertyPanel.h>
15 #include <ModuleBase_OperationFeature.h>
16 #include <ModuleBase_ModelWidget.h>
17 #include <ModuleBase_ViewerPrs.h>
18 #include <ModuleBase_WidgetSelector.h>
19 #include <ModuleBase_PageWidget.h>
20 #include <ModuleBase_PageBase.h>
21 #include <ModuleBase_WidgetFactory.h>
22 #include <ModuleBase_OperationDescription.h>
23 #include "ModuleBase_ToolBox.h"
25 #include <SketchPlugin_Feature.h>
26 #include <SketchPlugin_Line.h>
27 #include <SketchPlugin_Arc.h>
28 #include <SketchPlugin_Circle.h>
30 #include <XGUI_Workshop.h>
31 #include <XGUI_ModuleConnector.h>
32 #include <XGUI_OperationMgr.h>
33 #include <XGUI_PropertyPanel.h>
34 #include <XGUI_ErrorMgr.h>
36 #include <QToolButton>
38 PartSet_SketcherReetntrantMgr::PartSet_SketcherReetntrantMgr(ModuleBase_IWorkshop* theWorkshop)
39 : QObject(theWorkshop),
40 myWorkshop(theWorkshop),
41 myRestartingMode(RM_None),
42 myIsFlagsBlocked(false),
43 myIsInternalEditOperation(false),
44 myNoMoreWidgetsAttribute("")
48 PartSet_SketcherReetntrantMgr::~PartSet_SketcherReetntrantMgr()
52 ModuleBase_ModelWidget* PartSet_SketcherReetntrantMgr::internalActiveWidget() const
54 ModuleBase_ModelWidget* aWidget = 0;
58 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
60 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
61 if (aPanel) { // check for case when the operation is started but property panel is not filled
62 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
63 if (myIsInternalEditOperation && (!anActiveWidget || !anActiveWidget->isViewerSelector()))
64 aWidget = myInternalActiveWidget;
70 bool PartSet_SketcherReetntrantMgr::isInternalEditActive() const
72 return myIsInternalEditOperation;
75 void PartSet_SketcherReetntrantMgr::updateInternalEditActiveState()
77 if (myIsInternalEditOperation) {
78 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
79 (myWorkshop->currentOperation());
81 FeaturePtr aFeature = aFOperation->feature();
82 QString anError = myWorkshop->module()->getFeatureError(aFeature);
83 // stop started internal edit operation as soon as the operation becomes invalid
84 // it is especially important for the sketch tangent arc feature
85 if (!anError.isEmpty()) {
86 aFOperation->setEditOperation(false);
87 //workshop()->operationMgr()->updateApplyOfOperations();
88 beforeStopInternalEdit();
89 myIsInternalEditOperation = false;
90 updateAcceptAllAction();
96 bool PartSet_SketcherReetntrantMgr::operationCommitted(ModuleBase_Operation* theOperation)
98 bool aProcessed = false;
102 aProcessed = myIsInternalEditOperation;
108 void PartSet_SketcherReetntrantMgr::operationStarted(ModuleBase_Operation* theOperation)
113 if (myPreviousFeature.get() && myRestartingMode == RM_LastFeatureUsed) {
114 ModuleBase_OperationFeature* aCurrentOperation = dynamic_cast<ModuleBase_OperationFeature*>(
115 myWorkshop->currentOperation());
116 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
117 copyReetntrantAttributes(myPreviousFeature, aCurrentOperation->feature(), aSketch);
122 void PartSet_SketcherReetntrantMgr::operationAborted(ModuleBase_Operation* theOperation)
130 bool PartSet_SketcherReetntrantMgr::processMouseMoved(ModuleBase_IViewWindow* theWnd,
131 QMouseEvent* theEvent)
133 bool aProcessed = false;
137 if (myIsInternalEditOperation) {
138 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
139 (myWorkshop->currentOperation());
140 FeaturePtr aLastFeature = myRestartingMode == RM_LastFeatureUsed ? aFOperation->feature()
143 ModuleBase_ModelWidget* anActiveWidget = module()->activeWidget();
144 ModuleBase_IPropertyPanel* aPanel = myWorkshop->currentOperation()->propertyPanel();
146 FeaturePtr aCurrentFeature = aFOperation->feature();
147 bool isLineFeature = false, isArcFeature = false;
148 if (aCurrentFeature->getKind() == SketchPlugin_Line::ID())
149 isLineFeature = anActiveWidget->attributeID() == SketchPlugin_Line::START_ID();
150 else if (isTangentArc(aFOperation, module()->sketchMgr()->activeSketch()))
151 isArcFeature = anActiveWidget->attributeID() == SketchPlugin_Arc::TANGENT_POINT_ID();
153 bool aCanBeActivatedByMove = isLineFeature || isArcFeature;
154 if (aCanBeActivatedByMove) {
155 myPreviousFeature = aFOperation->feature();
157 myPreviousFeature = FeaturePtr();
159 anActiveWidget = module()->activeWidget();
160 aCurrentFeature = anActiveWidget->feature();
162 aPanel->activateNextWidget(anActiveWidget);
164 // processing mouse move in active widget of restarted operation
165 ModuleBase_ModelWidget* anActiveWidget = module()->activeWidget();
166 PartSet_MouseProcessor* aProcessor = dynamic_cast<PartSet_MouseProcessor*>(anActiveWidget);
168 aProcessor->mouseMoved(theWnd, theEvent);
175 bool PartSet_SketcherReetntrantMgr::processMousePressed(ModuleBase_IViewWindow* /* theWnd*/,
176 QMouseEvent* /* theEvent*/)
178 return isActiveMgr() && myIsInternalEditOperation;
181 bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow* theWnd,
182 QMouseEvent* theEvent)
184 bool aProcessed = false;
188 if (myIsInternalEditOperation) {
189 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
190 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
192 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
193 if (!anActiveWidget || !anActiveWidget->isViewerSelector()) {
195 // block of viewer update
196 // we need to block update content of the viewer because of Sketch Point feature
197 // in activate() the value of the point is initialized and it can be displayed
198 // but the default value is [0, 0]. So, we block update viewer contentent until
199 // onMouseRelease happens, which correct the point position
200 ModuleBase_Tools::blockUpdateViewer(true);
202 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
203 (myWorkshop->currentOperation());
204 myPreviousFeature = aFOperation->feature();
206 myPreviousFeature = FeaturePtr();
209 // fill the first widget by the mouse event point
210 // if the active widget is not the first, it means that the restarted operation is filled by
211 // the current preselection.
212 PartSet_WidgetPoint2D* aPoint2DWdg = dynamic_cast<PartSet_WidgetPoint2D*>(module()->activeWidget());
213 ModuleBase_ModelWidget* aFirstWidget = aPanel->findFirstAcceptingValueWidget();
214 if (aPoint2DWdg && aPoint2DWdg == aFirstWidget) {
215 aPoint2DWdg->mouseReleased(theWnd, theEvent);
217 // unblock viewer update
218 ModuleBase_Tools::blockUpdateViewer(false);
225 void PartSet_SketcherReetntrantMgr::onWidgetActivated()
229 if (!myIsInternalEditOperation)
232 PartSet_Module* aModule = module();
233 ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget();
234 ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel();
235 if (aFirstWidget != aPanel->activeWidget()) {
236 ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(aFirstWidget);
238 aWSelector->activateSelectionAndFilters(true);
242 void PartSet_SketcherReetntrantMgr::onNoMoreWidgets(const std::string& thePreviousAttributeID)
247 // we should avoid processing of the signal about no more widgets attributes and
248 // do this after the restart operaion is finished if it was called
249 // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
250 // if it should be called after restart
251 if (myIsFlagsBlocked) {
252 myNoMoreWidgetsAttribute = thePreviousAttributeID;
256 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
257 (myWorkshop->currentOperation());
258 if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
261 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation,
262 module()->sketchMgr()->activeSketch())) {
263 bool isStarted = false;
264 if (!module()->sketchMgr()->sketchSolverError()) {
265 if (myRestartingMode != RM_Forbided) {
266 myRestartingMode = RM_LastFeatureUsed;
267 isStarted = startInternalEdit(thePreviousAttributeID);
271 aFOperation->commit();
275 bool PartSet_SketcherReetntrantMgr::processEnter(const std::string& thePreviousAttributeID)
282 // empty previous attribute means that the Apply/Ok button has focus and the enter
283 // should not lead to start edition mode of the previous operation
284 if (thePreviousAttributeID.empty())
287 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
288 (myWorkshop->currentOperation());
289 if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
292 bool isSketchSolverError = module()->sketchMgr()->sketchSolverError();
294 if (!isSketchSolverError) {
295 myRestartingMode = RM_EmptyFeatureUsed;
296 isDone = startInternalEdit(thePreviousAttributeID);
302 void PartSet_SketcherReetntrantMgr::onVertexSelected()
307 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
308 std::string anOperationId = anOperation->id().toStdString();
309 if (anOperationId == SketchPlugin_Line::ID() ||
310 isTangentArc(anOperation, module()->sketchMgr()->activeSketch())) {
311 /// If last line finished on vertex the lines creation sequence has to be break
312 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
313 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
314 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
315 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
316 bool aFoundWidget = false;
317 bool aFoundObligatory = false;
318 for (; anIt != aLast && !aFoundObligatory; anIt++) {
320 aFoundWidget = *anIt == anActiveWidget;
322 aFoundObligatory = (*anIt)->isObligatory();
324 if (!aFoundObligatory)
325 myRestartingMode = RM_Forbided;
329 void PartSet_SketcherReetntrantMgr::onBeforeStopped()
331 if (!isActiveMgr() || !myIsInternalEditOperation)
334 beforeStopInternalEdit();
337 bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection()
339 return !isActiveMgr() || myRestartingMode == RM_None;
342 bool PartSet_SketcherReetntrantMgr::isInternalEditStarted() const
344 return myIsInternalEditOperation;
347 bool PartSet_SketcherReetntrantMgr::isActiveMgr() const
349 ModuleBase_Operation* aCurrentOperation = myWorkshop->currentOperation();
351 bool anActive = PartSet_SketcherMgr::isSketchOperation(aCurrentOperation);
353 anActive = PartSet_SketcherMgr::isNestedSketchOperation(aCurrentOperation,
354 module()->sketchMgr()->activeSketch());
355 if (anActive) { // the manager is not active when the current operation is a usual Edit
356 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
357 (myWorkshop->currentOperation());
358 if (aFOperation->isEditOperation())
359 anActive = myIsInternalEditOperation;
365 bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePreviousAttributeID)
368 /// this is workaround for ModuleBase_WidgetEditor, used in SALOME mode. Sometimes key enter
369 /// event comes two times, so we should not start another internal edit operation
370 /// the Apply button becomes disabled becase the second additional internal feature is created
371 if (myIsInternalEditOperation)
374 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
375 (myWorkshop->currentOperation());
377 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation,
378 module()->sketchMgr()->activeSketch())) {
379 aFOperation->setEditOperation(true/*, false*/);
380 createInternalFeature();
382 myIsInternalEditOperation = true;
383 updateAcceptAllAction();
386 connect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
387 connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
389 // activate selection filters of the first widget in the viewer
392 // activate the last active widget in the Property Panel
393 if (!thePreviousAttributeID.empty()) {
394 ModuleBase_Operation* anEditOperation = module()->currentOperation();
395 if (anEditOperation) {
396 ModuleBase_IPropertyPanel* aPanel = aFOperation->propertyPanel();
397 ModuleBase_ModelWidget* aPreviousAttributeWidget = 0;
398 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
399 for (int i = 0, aNb = aWidgets.size(); i < aNb && !aPreviousAttributeWidget; i++) {
400 if (aWidgets[i]->attributeID() == thePreviousAttributeID) {
401 /// workaround for the same attributes used in different stacked widgets(attribute types)
402 if (ModuleBase_ToolBox::isOffToolBoxParent(aWidgets[i]))
404 aPreviousAttributeWidget = aWidgets[i];
407 // If the current widget is a selector, do nothing, it processes the mouse press
408 if (aPreviousAttributeWidget) {
409 if (!aPreviousAttributeWidget->isViewerSelector()) {
410 aPreviousAttributeWidget->focusTo();
411 aPreviousAttributeWidget->selectContent();
414 // in case of shape multi selector, the widget does not lose focus by filling
415 // like it is in shape selector. So, if enter is pressed, the multi shape selector
416 // control should be deactivated. The focus is moved to Apply button and there
417 // should not be active control visualized in property panel
418 if (aPreviousAttributeWidget == aPanel->activeWidget()) {
419 aPanel->activateWidget(NULL, false);
421 // if there is no the next widget to be automatically activated, the Ok button in property
422 // panel should accept the focus(example is parallel constraint on sketch lines)
423 QToolButton* anOkBtn = dynamic_cast<XGUI_PropertyPanel*>(aPanel)->findButton(PROP_PANEL_OK);
425 anOkBtn->setFocus(Qt::TabFocusReason);
432 module()->sketchMgr()->clearClickedFlags();
437 void PartSet_SketcherReetntrantMgr::beforeStopInternalEdit()
439 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
440 (myWorkshop->currentOperation());
442 disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
443 disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
446 deleteInternalFeature();
449 void PartSet_SketcherReetntrantMgr::restartOperation()
451 if (myIsInternalEditOperation) {
452 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(
453 myWorkshop->currentOperation());
455 myNoMoreWidgetsAttribute = "";
456 myIsFlagsBlocked = true;
457 FeaturePtr aPrevFeature = aFOperation->feature();
458 aFOperation->commit();
459 module()->launchOperation(aFOperation->id());
460 myIsFlagsBlocked = false;
462 // we should avoid processing of the signal about no more widgets attributes and
463 // do this after the restart operaion is finished if it was called
464 // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
465 // if it should be called after restart
466 if (!myNoMoreWidgetsAttribute.empty()) {
467 onNoMoreWidgets(myNoMoreWidgetsAttribute);
468 myNoMoreWidgetsAttribute = "";
474 void PartSet_SketcherReetntrantMgr::createInternalFeature()
476 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
477 (myWorkshop->currentOperation());
479 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation,
480 module()->sketchMgr()->activeSketch())) {
481 FeaturePtr anOperationFeature = aFOperation->feature();
483 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
484 myInternalFeature = aSketch->addFeature(anOperationFeature->getKind());
486 bool isFeatureChanged = copyReetntrantAttributes(anOperationFeature, myInternalFeature,
488 XGUI_PropertyPanel* aPropertyPanel = dynamic_cast<XGUI_PropertyPanel*>
489 (aFOperation->propertyPanel());
491 myInternalWidget = new QWidget(aPropertyPanel->contentWidget()->pageWidget());
492 myInternalWidget->setVisible(false);
494 ModuleBase_PageWidget* anInternalPage = new ModuleBase_PageWidget(myInternalWidget);
496 QString aXmlRepr = aFOperation->getDescription()->xmlRepresentation();
497 ModuleBase_WidgetFactory aFactory(aXmlRepr.toStdString(), myWorkshop);
499 aFactory.createWidget(anInternalPage);
500 QList<ModuleBase_ModelWidget*> aWidgets = aFactory.getModelWidgets();
502 foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
503 bool isStoreValue = !aFOperation->isEditOperation() &&
504 !aWidget->getDefaultValue().empty() &&
505 !aWidget->isComputedDefault();
506 aWidget->setFeature(myInternalFeature, isStoreValue);
507 if (!isStoreValue && isFeatureChanged)
508 aWidget->restoreValue();
511 ModuleBase_ModelWidget* aFirstWidget = ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget
514 myInternalActiveWidget = aFirstWidget;
518 void PartSet_SketcherReetntrantMgr::deleteInternalFeature()
520 if (myInternalActiveWidget) {
521 ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
523 aWSelector->activateSelectionAndFilters(false);
524 myInternalActiveWidget = 0;
526 delete myInternalWidget;
527 myInternalWidget = 0;
529 QObjectPtrList anObjects;
530 anObjects.append(myInternalFeature);
531 workshop()->deleteFeatures(anObjects);
532 myInternalFeature = FeaturePtr();
535 void PartSet_SketcherReetntrantMgr::resetFlags()
537 if (!myIsFlagsBlocked) {
538 myIsInternalEditOperation = false;
539 updateAcceptAllAction();
540 myRestartingMode = RM_None;
544 bool PartSet_SketcherReetntrantMgr::copyReetntrantAttributes(const FeaturePtr& theSourceFeature,
545 const FeaturePtr& theNewFeature,
546 const CompositeFeaturePtr& theSketch,
547 const bool isTemporary)
549 bool aChanged = false;
550 if (!theSourceFeature.get())
553 std::string aFeatureKind = theSourceFeature->getKind();
554 if (aFeatureKind == SketchPlugin_Line::ID()) {
555 // Initialize new line with first point equal to end of previous
556 std::shared_ptr<ModelAPI_Data> aSFData = theSourceFeature->data();
557 std::shared_ptr<GeomDataAPI_Point2D> aSPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
558 aSFData->attribute(SketchPlugin_Line::END_ID()));
559 std::shared_ptr<ModelAPI_Data> aNFData = theNewFeature->data();
560 std::shared_ptr<GeomDataAPI_Point2D> aNPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
561 aNFData->attribute(SketchPlugin_Line::START_ID()));
562 aNPoint->setValue(aSPoint->x(), aSPoint->y());
563 PartSet_Tools::createConstraint(theSketch, aSPoint, aNPoint);
565 aNPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
566 aSFData->attribute(SketchPlugin_Line::END_ID()));
567 aNPoint->setValue(aSPoint->x(), aSPoint->y());
569 else if (aFeatureKind == SketchPlugin_Circle::ID()) {
571 std::string aTypeAttributeId = SketchPlugin_Circle::CIRCLE_TYPE();
572 AttributeStringPtr aSourceFeatureTypeAttr = theSourceFeature->data()->string(aTypeAttributeId);
573 AttributeStringPtr aNewFeatureTypeAttr = theNewFeature->data()->string(aTypeAttributeId);
574 aNewFeatureTypeAttr->setValue(aSourceFeatureTypeAttr->value());
575 //ModuleBase_Tools::flushUpdated(theNewFeature);
578 else if (aFeatureKind == SketchPlugin_Arc::ID()) {
580 std::string aTypeAttributeId = SketchPlugin_Arc::ARC_TYPE();
581 AttributeStringPtr aSourceFeatureTypeAttr = theSourceFeature->data()->string(aTypeAttributeId);
582 AttributeStringPtr aNewFeatureTypeAttr = theNewFeature->data()->string(aTypeAttributeId);
583 aNewFeatureTypeAttr->setValue(aSourceFeatureTypeAttr->value());
585 // if the arc is tangent, set coincidence to end point of the previous arc
586 std::string anArcType = aSourceFeatureTypeAttr->value();
587 if (anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT()) {
588 // get the last point of the previuos arc feature(geom point 2d)
589 std::shared_ptr<ModelAPI_Data> aSData = theSourceFeature->data();
590 std::shared_ptr<GeomDataAPI_Point2D> aSPointAttr =
591 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
592 aSData->attribute(SketchPlugin_Arc::END_ID()));
593 // get point attribute on the current feature
594 AttributeRefAttrPtr aTangentPointAttr = theNewFeature->data()->refattr(
595 SketchPlugin_Arc::TANGENT_POINT_ID());
596 aTangentPointAttr->setAttr(aSPointAttr);
598 std::shared_ptr<GeomDataAPI_Point2D> aNPointAttr =
599 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
600 theNewFeature->data()->attribute(SketchPlugin_Arc::END_ID()));
601 aNPointAttr->setValue(aSPointAttr->x(), aSPointAttr->y());
604 //ModuleBase_Tools::flushUpdated(theNewFeature);
610 bool PartSet_SketcherReetntrantMgr::isTangentArc(ModuleBase_Operation* theOperation,
611 const CompositeFeaturePtr& theSketch)
613 bool aTangentArc = false;
614 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
616 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation, theSketch)) {
617 FeaturePtr aFeature = aFOperation->feature();
618 if (aFeature.get() && aFeature->getKind() == SketchPlugin_Arc::ID()) {
619 AttributeStringPtr aTypeAttr = aFeature->data()->string(SketchPlugin_Arc::ARC_TYPE());
620 std::string anArcType = aTypeAttr.get() ? aTypeAttr->value() : "";
621 aTangentArc = anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT();
627 void PartSet_SketcherReetntrantMgr::updateAcceptAllAction()
629 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
631 workshop()->errorMgr()->updateAcceptAllAction(aSketch);
634 XGUI_Workshop* PartSet_SketcherReetntrantMgr::workshop() const
636 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
637 return aConnector->workshop();
640 PartSet_Module* PartSet_SketcherReetntrantMgr::module() const
642 return dynamic_cast<PartSet_Module*>(myWorkshop->module());