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 std::string anAttributeOnStart;
149 if (aCurrentFeature->getKind() == SketchPlugin_Line::ID()) {
150 anAttributeOnStart = SketchPlugin_Line::START_ID();
151 isLineFeature = anActiveWidget->attributeID() == anAttributeOnStart;
153 else if (isTangentArc(aFOperation, module()->sketchMgr()->activeSketch())) {
154 anAttributeOnStart = SketchPlugin_Arc::TANGENT_POINT_ID();
155 isArcFeature = anActiveWidget->attributeID() == anAttributeOnStart;
157 bool aCanBeActivatedByMove = isLineFeature || isArcFeature;
158 if (aCanBeActivatedByMove) {
159 myPreviousFeature = aFOperation->feature();
161 myPreviousFeature = FeaturePtr();
163 anActiveWidget = module()->activeWidget();
164 aCurrentFeature = anActiveWidget->feature();
166 if (anActiveWidget->attributeID() == anAttributeOnStart) {
167 // it was not deactivated by preselection processing
168 aPanel->activateNextWidget(anActiveWidget);
171 // processing mouse move in active widget of restarted operation
172 ModuleBase_ModelWidget* anActiveWidget = module()->activeWidget();
173 PartSet_MouseProcessor* aProcessor = dynamic_cast<PartSet_MouseProcessor*>(anActiveWidget);
175 aProcessor->mouseMoved(theWnd, theEvent);
182 bool PartSet_SketcherReetntrantMgr::processMousePressed(ModuleBase_IViewWindow* /* theWnd*/,
183 QMouseEvent* /* theEvent*/)
185 return isActiveMgr() && myIsInternalEditOperation;
188 bool PartSet_SketcherReetntrantMgr::processMouseReleased(ModuleBase_IViewWindow* theWnd,
189 QMouseEvent* theEvent)
191 bool aProcessed = false;
195 if (myIsInternalEditOperation) {
196 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
197 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
199 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
200 if (!anActiveWidget || !anActiveWidget->isViewerSelector()) {
202 // block of viewer update
203 // we need to block update content of the viewer because of Sketch Point feature
204 // in activate() the value of the point is initialized and it can be displayed
205 // but the default value is [0, 0]. So, we block update viewer contentent until
206 // onMouseRelease happens, which correct the point position
207 ModuleBase_Tools::blockUpdateViewer(true);
209 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
210 (myWorkshop->currentOperation());
211 myPreviousFeature = aFOperation->feature();
213 myPreviousFeature = FeaturePtr();
216 // fill the first widget by the mouse event point
217 // if the active widget is not the first, it means that the restarted operation is filled by
218 // the current preselection.
219 PartSet_WidgetPoint2D* aPoint2DWdg = dynamic_cast<PartSet_WidgetPoint2D*>(module()->activeWidget());
220 ModuleBase_ModelWidget* aFirstWidget = aPanel->findFirstAcceptingValueWidget();
221 if (aPoint2DWdg && aPoint2DWdg == aFirstWidget) {
222 aPoint2DWdg->mouseReleased(theWnd, theEvent);
224 // unblock viewer update
225 ModuleBase_Tools::blockUpdateViewer(false);
232 void PartSet_SketcherReetntrantMgr::onWidgetActivated()
236 if (!myIsInternalEditOperation)
239 PartSet_Module* aModule = module();
240 ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget();
241 ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel();
242 if (aFirstWidget != aPanel->activeWidget()) {
243 ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(aFirstWidget);
245 aWSelector->activateSelectionAndFilters(true);
249 void PartSet_SketcherReetntrantMgr::onNoMoreWidgets(const std::string& thePreviousAttributeID)
254 // we should avoid processing of the signal about no more widgets attributes and
255 // do this after the restart operaion is finished if it was called
256 // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
257 // if it should be called after restart
258 if (myIsFlagsBlocked) {
259 myNoMoreWidgetsAttribute = thePreviousAttributeID;
263 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
264 (myWorkshop->currentOperation());
265 if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
268 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation,
269 module()->sketchMgr()->activeSketch())) {
270 bool isStarted = false;
271 if (!module()->sketchMgr()->sketchSolverError()) {
272 if (myRestartingMode != RM_Forbided) {
273 myRestartingMode = RM_LastFeatureUsed;
274 isStarted = startInternalEdit(thePreviousAttributeID);
278 aFOperation->commit();
282 bool PartSet_SketcherReetntrantMgr::processEnter(const std::string& thePreviousAttributeID)
289 // empty previous attribute means that the Apply/Ok button has focus and the enter
290 // should not lead to start edition mode of the previous operation
291 if (thePreviousAttributeID.empty())
294 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
295 (myWorkshop->currentOperation());
296 if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
299 bool isSketchSolverError = module()->sketchMgr()->sketchSolverError();
301 if (!isSketchSolverError) {
302 myRestartingMode = RM_EmptyFeatureUsed;
303 isDone = startInternalEdit(thePreviousAttributeID);
309 void PartSet_SketcherReetntrantMgr::onVertexSelected()
314 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
315 std::string anOperationId = anOperation->id().toStdString();
316 if (anOperationId == SketchPlugin_Line::ID() ||
317 isTangentArc(anOperation, module()->sketchMgr()->activeSketch())) {
318 /// If last line finished on vertex the lines creation sequence has to be break
319 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
320 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
321 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
322 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
323 bool aFoundWidget = false;
324 bool aFoundObligatory = false;
325 for (; anIt != aLast && !aFoundObligatory; anIt++) {
327 aFoundWidget = *anIt == anActiveWidget;
329 aFoundObligatory = (*anIt)->isObligatory();
331 if (!aFoundObligatory)
332 myRestartingMode = RM_Forbided;
336 void PartSet_SketcherReetntrantMgr::onBeforeStopped()
338 if (!isActiveMgr() || !myIsInternalEditOperation)
341 beforeStopInternalEdit();
344 bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection()
346 return !isActiveMgr() || myRestartingMode == RM_None;
349 bool PartSet_SketcherReetntrantMgr::isInternalEditStarted() const
351 return myIsInternalEditOperation;
354 bool PartSet_SketcherReetntrantMgr::isActiveMgr() const
356 ModuleBase_Operation* aCurrentOperation = myWorkshop->currentOperation();
358 bool anActive = PartSet_SketcherMgr::isSketchOperation(aCurrentOperation);
360 anActive = PartSet_SketcherMgr::isNestedSketchOperation(aCurrentOperation,
361 module()->sketchMgr()->activeSketch());
362 if (anActive) { // the manager is not active when the current operation is a usual Edit
363 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
364 (myWorkshop->currentOperation());
365 if (aFOperation->isEditOperation())
366 anActive = myIsInternalEditOperation;
372 bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePreviousAttributeID)
375 /// this is workaround for ModuleBase_WidgetEditor, used in SALOME mode. Sometimes key enter
376 /// event comes two times, so we should not start another internal edit operation
377 /// the Apply button becomes disabled becase the second additional internal feature is created
378 if (myIsInternalEditOperation)
381 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
382 (myWorkshop->currentOperation());
384 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation,
385 module()->sketchMgr()->activeSketch())) {
386 aFOperation->setEditOperation(true/*, false*/);
387 createInternalFeature();
389 myIsInternalEditOperation = true;
390 updateAcceptAllAction();
393 connect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
394 connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
396 // activate selection filters of the first widget in the viewer
399 // activate the last active widget in the Property Panel
400 if (!thePreviousAttributeID.empty()) {
401 ModuleBase_Operation* anEditOperation = module()->currentOperation();
402 if (anEditOperation) {
403 ModuleBase_IPropertyPanel* aPanel = aFOperation->propertyPanel();
404 ModuleBase_ModelWidget* aPreviousAttributeWidget = 0;
405 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
406 for (int i = 0, aNb = aWidgets.size(); i < aNb && !aPreviousAttributeWidget; i++) {
407 if (aWidgets[i]->attributeID() == thePreviousAttributeID) {
408 /// workaround for the same attributes used in different stacked widgets(attribute types)
409 if (ModuleBase_ToolBox::isOffToolBoxParent(aWidgets[i]))
411 aPreviousAttributeWidget = aWidgets[i];
414 // If the current widget is a selector, do nothing, it processes the mouse press
415 if (aPreviousAttributeWidget) {
416 if (!aPreviousAttributeWidget->isViewerSelector()) {
417 aPreviousAttributeWidget->focusTo();
418 aPreviousAttributeWidget->selectContent();
421 // in case of shape multi selector, the widget does not lose focus by filling
422 // like it is in shape selector. So, if enter is pressed, the multi shape selector
423 // control should be deactivated. The focus is moved to Apply button and there
424 // should not be active control visualized in property panel
425 if (aPreviousAttributeWidget == aPanel->activeWidget()) {
426 aPanel->activateWidget(NULL, false);
428 // if there is no the next widget to be automatically activated, the Ok button in property
429 // panel should accept the focus(example is parallel constraint on sketch lines)
430 QToolButton* anOkBtn = dynamic_cast<XGUI_PropertyPanel*>(aPanel)->findButton(PROP_PANEL_OK);
432 anOkBtn->setFocus(Qt::TabFocusReason);
439 module()->sketchMgr()->clearClickedFlags();
444 void PartSet_SketcherReetntrantMgr::beforeStopInternalEdit()
446 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
447 (myWorkshop->currentOperation());
449 disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
450 disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
453 deleteInternalFeature();
456 void PartSet_SketcherReetntrantMgr::restartOperation()
458 if (myIsInternalEditOperation) {
459 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(
460 myWorkshop->currentOperation());
462 myNoMoreWidgetsAttribute = "";
463 myIsFlagsBlocked = true;
464 FeaturePtr aPrevFeature = aFOperation->feature();
465 aFOperation->commit();
466 module()->launchOperation(aFOperation->id());
467 myIsFlagsBlocked = false;
469 // we should avoid processing of the signal about no more widgets attributes and
470 // do this after the restart operaion is finished if it was called
471 // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
472 // if it should be called after restart
473 if (!myNoMoreWidgetsAttribute.empty()) {
474 onNoMoreWidgets(myNoMoreWidgetsAttribute);
475 myNoMoreWidgetsAttribute = "";
481 void PartSet_SketcherReetntrantMgr::createInternalFeature()
483 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
484 (myWorkshop->currentOperation());
486 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation,
487 module()->sketchMgr()->activeSketch())) {
488 FeaturePtr anOperationFeature = aFOperation->feature();
490 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
491 myInternalFeature = aSketch->addFeature(anOperationFeature->getKind());
493 bool isFeatureChanged = copyReetntrantAttributes(anOperationFeature, myInternalFeature,
495 XGUI_PropertyPanel* aPropertyPanel = dynamic_cast<XGUI_PropertyPanel*>
496 (aFOperation->propertyPanel());
498 myInternalWidget = new QWidget(aPropertyPanel->contentWidget()->pageWidget());
499 myInternalWidget->setVisible(false);
501 ModuleBase_PageWidget* anInternalPage = new ModuleBase_PageWidget(myInternalWidget);
503 QString aXmlRepr = aFOperation->getDescription()->xmlRepresentation();
504 ModuleBase_WidgetFactory aFactory(aXmlRepr.toStdString(), myWorkshop);
506 aFactory.createWidget(anInternalPage);
507 QList<ModuleBase_ModelWidget*> aWidgets = aFactory.getModelWidgets();
509 foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
510 bool isStoreValue = !aFOperation->isEditOperation() &&
511 !aWidget->getDefaultValue().empty() &&
512 !aWidget->isComputedDefault();
513 aWidget->setFeature(myInternalFeature, isStoreValue);
514 if (!isStoreValue && isFeatureChanged)
515 aWidget->restoreValue();
518 ModuleBase_ModelWidget* aFirstWidget = ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget
521 myInternalActiveWidget = aFirstWidget;
525 void PartSet_SketcherReetntrantMgr::deleteInternalFeature()
527 if (myInternalActiveWidget) {
528 ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
530 aWSelector->activateSelectionAndFilters(false);
531 myInternalActiveWidget = 0;
533 delete myInternalWidget;
534 myInternalWidget = 0;
536 QObjectPtrList anObjects;
537 anObjects.append(myInternalFeature);
538 workshop()->deleteFeatures(anObjects);
539 myInternalFeature = FeaturePtr();
542 void PartSet_SketcherReetntrantMgr::resetFlags()
544 if (!myIsFlagsBlocked) {
545 myIsInternalEditOperation = false;
546 updateAcceptAllAction();
547 myRestartingMode = RM_None;
551 bool PartSet_SketcherReetntrantMgr::copyReetntrantAttributes(const FeaturePtr& theSourceFeature,
552 const FeaturePtr& theNewFeature,
553 const CompositeFeaturePtr& theSketch,
554 const bool isTemporary)
556 bool aChanged = false;
557 if (!theSourceFeature.get())
560 std::string aFeatureKind = theSourceFeature->getKind();
561 if (aFeatureKind == SketchPlugin_Line::ID()) {
562 // Initialize new line with first point equal to end of previous
563 std::shared_ptr<ModelAPI_Data> aSFData = theSourceFeature->data();
564 std::shared_ptr<GeomDataAPI_Point2D> aSPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
565 aSFData->attribute(SketchPlugin_Line::END_ID()));
566 std::shared_ptr<ModelAPI_Data> aNFData = theNewFeature->data();
567 std::shared_ptr<GeomDataAPI_Point2D> aNPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
568 aNFData->attribute(SketchPlugin_Line::START_ID()));
569 aNPoint->setValue(aSPoint->x(), aSPoint->y());
570 PartSet_Tools::createConstraint(theSketch, aSPoint, aNPoint);
572 aNPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
573 aSFData->attribute(SketchPlugin_Line::END_ID()));
574 aNPoint->setValue(aSPoint->x(), aSPoint->y());
576 else if (aFeatureKind == SketchPlugin_Circle::ID()) {
578 std::string aTypeAttributeId = SketchPlugin_Circle::CIRCLE_TYPE();
579 AttributeStringPtr aSourceFeatureTypeAttr = theSourceFeature->data()->string(aTypeAttributeId);
580 AttributeStringPtr aNewFeatureTypeAttr = theNewFeature->data()->string(aTypeAttributeId);
581 aNewFeatureTypeAttr->setValue(aSourceFeatureTypeAttr->value());
582 //ModuleBase_Tools::flushUpdated(theNewFeature);
585 else if (aFeatureKind == SketchPlugin_Arc::ID()) {
587 std::string aTypeAttributeId = SketchPlugin_Arc::ARC_TYPE();
588 AttributeStringPtr aSourceFeatureTypeAttr = theSourceFeature->data()->string(aTypeAttributeId);
589 AttributeStringPtr aNewFeatureTypeAttr = theNewFeature->data()->string(aTypeAttributeId);
590 aNewFeatureTypeAttr->setValue(aSourceFeatureTypeAttr->value());
592 // if the arc is tangent, set coincidence to end point of the previous arc
593 std::string anArcType = aSourceFeatureTypeAttr->value();
594 if (anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT()) {
595 // get the last point of the previuos arc feature(geom point 2d)
596 std::shared_ptr<ModelAPI_Data> aSData = theSourceFeature->data();
597 std::shared_ptr<GeomDataAPI_Point2D> aSPointAttr =
598 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
599 aSData->attribute(SketchPlugin_Arc::END_ID()));
600 // get point attribute on the current feature
601 AttributeRefAttrPtr aTangentPointAttr = theNewFeature->data()->refattr(
602 SketchPlugin_Arc::TANGENT_POINT_ID());
603 aTangentPointAttr->setAttr(aSPointAttr);
605 std::shared_ptr<GeomDataAPI_Point2D> aNPointAttr =
606 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
607 theNewFeature->data()->attribute(SketchPlugin_Arc::END_ID()));
608 aNPointAttr->setValue(aSPointAttr->x(), aSPointAttr->y());
611 //ModuleBase_Tools::flushUpdated(theNewFeature);
617 bool PartSet_SketcherReetntrantMgr::isTangentArc(ModuleBase_Operation* theOperation,
618 const CompositeFeaturePtr& theSketch)
620 bool aTangentArc = false;
621 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
623 if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation, theSketch)) {
624 FeaturePtr aFeature = aFOperation->feature();
625 if (aFeature.get() && aFeature->getKind() == SketchPlugin_Arc::ID()) {
626 AttributeStringPtr aTypeAttr = aFeature->data()->string(SketchPlugin_Arc::ARC_TYPE());
627 std::string anArcType = aTypeAttr.get() ? aTypeAttr->value() : "";
628 aTangentArc = anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT();
634 void PartSet_SketcherReetntrantMgr::updateAcceptAllAction()
636 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
638 workshop()->errorMgr()->updateAcceptAllAction(aSketch);
641 XGUI_Workshop* PartSet_SketcherReetntrantMgr::workshop() const
643 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
644 return aConnector->workshop();
647 PartSet_Module* PartSet_SketcherReetntrantMgr::module() const
649 return dynamic_cast<PartSet_Module*>(myWorkshop->module());