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 && module()->sketchMgr()->isNestedSketchOperation(aFOperation)) {
269 bool isStarted = false;
270 if (!module()->sketchMgr()->sketchSolverError()) {
271 if (myRestartingMode != RM_Forbided) {
272 myRestartingMode = RM_LastFeatureUsed;
273 isStarted = startInternalEdit(thePreviousAttributeID);
277 aFOperation->commit();
281 bool PartSet_SketcherReetntrantMgr::processEnter(const std::string& thePreviousAttributeID)
288 // empty previous attribute means that the Apply/Ok button has focus and the enter
289 // should not lead to start edition mode of the previous operation
290 if (thePreviousAttributeID.empty())
293 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
294 (myWorkshop->currentOperation());
295 if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty())
298 bool isSketchSolverError = module()->sketchMgr()->sketchSolverError();
300 if (!isSketchSolverError) {
301 myRestartingMode = RM_EmptyFeatureUsed;
302 isDone = startInternalEdit(thePreviousAttributeID);
308 void PartSet_SketcherReetntrantMgr::onVertexSelected()
313 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
314 std::string anOperationId = anOperation->id().toStdString();
315 if (anOperationId == SketchPlugin_Line::ID() ||
316 isTangentArc(anOperation, module()->sketchMgr()->activeSketch())) {
317 /// If last line finished on vertex the lines creation sequence has to be break
318 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
319 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
320 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
321 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
322 bool aFoundWidget = false;
323 bool aFoundObligatory = false;
324 for (; anIt != aLast && !aFoundObligatory; anIt++) {
326 aFoundWidget = *anIt == anActiveWidget;
328 aFoundObligatory = (*anIt)->isObligatory();
330 if (!aFoundObligatory)
331 myRestartingMode = RM_Forbided;
335 void PartSet_SketcherReetntrantMgr::onBeforeStopped()
337 if (!isActiveMgr() || !myIsInternalEditOperation)
340 beforeStopInternalEdit();
343 bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection()
345 return !isActiveMgr() || myRestartingMode == RM_None;
348 bool PartSet_SketcherReetntrantMgr::isInternalEditStarted() const
350 return myIsInternalEditOperation;
353 bool PartSet_SketcherReetntrantMgr::isActiveMgr() const
355 ModuleBase_Operation* aCurrentOperation = myWorkshop->currentOperation();
357 bool anActive = PartSet_SketcherMgr::isSketchOperation(aCurrentOperation);
359 anActive = module()->sketchMgr()->isNestedSketchOperation(aCurrentOperation);
360 if (anActive) { // the manager is not active when the current operation is a usual Edit
361 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
362 (myWorkshop->currentOperation());
363 if (aFOperation->isEditOperation())
364 anActive = myIsInternalEditOperation;
370 bool PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePreviousAttributeID)
373 /// this is workaround for ModuleBase_WidgetEditor, used in SALOME mode. Sometimes key enter
374 /// event comes two times, so we should not start another internal edit operation
375 /// the Apply button becomes disabled becase the second additional internal feature is created
376 if (myIsInternalEditOperation)
379 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
380 (myWorkshop->currentOperation());
382 if (aFOperation && module()->sketchMgr()->isNestedSketchOperation(aFOperation)) {
383 aFOperation->setEditOperation(true/*, false*/);
384 createInternalFeature();
386 myIsInternalEditOperation = true;
387 updateAcceptAllAction();
390 connect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
391 connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
393 // activate selection filters of the first widget in the viewer
396 // activate the last active widget in the Property Panel
397 if (!thePreviousAttributeID.empty()) {
398 ModuleBase_Operation* anEditOperation = module()->currentOperation();
399 if (anEditOperation) {
400 ModuleBase_IPropertyPanel* aPanel = aFOperation->propertyPanel();
401 ModuleBase_ModelWidget* aPreviousAttributeWidget = 0;
402 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
403 for (int i = 0, aNb = aWidgets.size(); i < aNb && !aPreviousAttributeWidget; i++) {
404 if (aWidgets[i]->attributeID() == thePreviousAttributeID) {
405 /// workaround for the same attributes used in different stacked widgets(attribute types)
406 if (ModuleBase_ToolBox::isOffToolBoxParent(aWidgets[i]))
408 aPreviousAttributeWidget = aWidgets[i];
411 // If the current widget is a selector, do nothing, it processes the mouse press
412 if (aPreviousAttributeWidget) {
413 if (!aPreviousAttributeWidget->isViewerSelector()) {
414 aPreviousAttributeWidget->focusTo();
415 aPreviousAttributeWidget->selectContent();
418 // in case of shape multi selector, the widget does not lose focus by filling
419 // like it is in shape selector. So, if enter is pressed, the multi shape selector
420 // control should be deactivated. The focus is moved to Apply button and there
421 // should not be active control visualized in property panel
422 if (aPreviousAttributeWidget == aPanel->activeWidget()) {
423 aPanel->activateWidget(NULL, false);
425 // if there is no the next widget to be automatically activated, the Ok button in property
426 // panel should accept the focus(example is parallel constraint on sketch lines)
427 QToolButton* anOkBtn = dynamic_cast<XGUI_PropertyPanel*>(aPanel)->findButton(PROP_PANEL_OK);
429 anOkBtn->setFocus(Qt::TabFocusReason);
436 module()->sketchMgr()->clearClickedFlags();
441 void PartSet_SketcherReetntrantMgr::beforeStopInternalEdit()
443 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
444 (myWorkshop->currentOperation());
446 disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
447 disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
450 deleteInternalFeature();
453 void PartSet_SketcherReetntrantMgr::restartOperation()
455 if (myIsInternalEditOperation) {
456 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>(
457 myWorkshop->currentOperation());
459 myNoMoreWidgetsAttribute = "";
460 myIsFlagsBlocked = true;
461 module()->launchOperation(aFOperation->id());
462 myIsFlagsBlocked = false;
464 // we should avoid processing of the signal about no more widgets attributes and
465 // do this after the restart operaion is finished if it was called
466 // onNoMoreWidgets depends on myIsFlagsBlocked and fill myNoMoreWidgetsAttribute
467 // if it should be called after restart
468 if (!myNoMoreWidgetsAttribute.empty()) {
469 onNoMoreWidgets(myNoMoreWidgetsAttribute);
470 myNoMoreWidgetsAttribute = "";
476 void PartSet_SketcherReetntrantMgr::createInternalFeature()
478 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
479 (myWorkshop->currentOperation());
481 if (aFOperation && module()->sketchMgr()->isNestedSketchOperation(aFOperation)) {
482 FeaturePtr anOperationFeature = aFOperation->feature();
484 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
485 myInternalFeature = aSketch->addFeature(anOperationFeature->getKind());
487 bool isFeatureChanged = copyReetntrantAttributes(anOperationFeature, myInternalFeature,
489 XGUI_PropertyPanel* aPropertyPanel = dynamic_cast<XGUI_PropertyPanel*>
490 (aFOperation->propertyPanel());
492 myInternalWidget = new QWidget(aPropertyPanel->contentWidget()->pageWidget());
493 myInternalWidget->setVisible(false);
495 ModuleBase_PageWidget* anInternalPage = new ModuleBase_PageWidget(myInternalWidget);
497 QString aXmlRepr = aFOperation->getDescription()->xmlRepresentation();
498 ModuleBase_WidgetFactory aFactory(aXmlRepr.toStdString(), myWorkshop);
500 aFactory.createWidget(anInternalPage);
501 QList<ModuleBase_ModelWidget*> aWidgets = aFactory.getModelWidgets();
503 foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
504 bool isStoreValue = !aFOperation->isEditOperation() &&
505 !aWidget->getDefaultValue().empty() &&
506 !aWidget->isComputedDefault();
507 aWidget->setFeature(myInternalFeature, isStoreValue);
508 if (!isStoreValue && isFeatureChanged)
509 aWidget->restoreValue();
512 ModuleBase_ModelWidget* aFirstWidget = ModuleBase_IPropertyPanel::findFirstAcceptingValueWidget
515 myInternalActiveWidget = aFirstWidget;
519 void PartSet_SketcherReetntrantMgr::deleteInternalFeature()
521 if (myInternalActiveWidget) {
522 ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
524 aWSelector->activateSelectionAndFilters(false);
525 myInternalActiveWidget = 0;
527 delete myInternalWidget;
528 myInternalWidget = 0;
530 QObjectPtrList anObjects;
531 anObjects.append(myInternalFeature);
532 workshop()->deleteFeatures(anObjects);
533 myInternalFeature = FeaturePtr();
536 void PartSet_SketcherReetntrantMgr::resetFlags()
538 if (!myIsFlagsBlocked) {
539 myIsInternalEditOperation = false;
540 updateAcceptAllAction();
541 myRestartingMode = RM_None;
545 bool PartSet_SketcherReetntrantMgr::copyReetntrantAttributes(const FeaturePtr& theSourceFeature,
546 const FeaturePtr& theNewFeature,
547 const CompositeFeaturePtr& theSketch,
548 const bool isTemporary)
550 bool aChanged = false;
551 if (!theSourceFeature.get())
554 std::string aFeatureKind = theSourceFeature->getKind();
555 if (aFeatureKind == SketchPlugin_Line::ID()) {
556 // Initialize new line with first point equal to end of previous
557 std::shared_ptr<ModelAPI_Data> aSFData = theSourceFeature->data();
558 std::shared_ptr<GeomDataAPI_Point2D> aSPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
559 aSFData->attribute(SketchPlugin_Line::END_ID()));
560 std::shared_ptr<ModelAPI_Data> aNFData = theNewFeature->data();
561 std::shared_ptr<GeomDataAPI_Point2D> aNPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
562 aNFData->attribute(SketchPlugin_Line::START_ID()));
563 aNPoint->setValue(aSPoint->x(), aSPoint->y());
564 PartSet_Tools::createConstraint(theSketch, aSPoint, aNPoint);
566 aNPoint = std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
567 aSFData->attribute(SketchPlugin_Line::END_ID()));
568 aNPoint->setValue(aSPoint->x(), aSPoint->y());
570 else if (aFeatureKind == SketchPlugin_Circle::ID()) {
572 std::string aTypeAttributeId = SketchPlugin_Circle::CIRCLE_TYPE();
573 AttributeStringPtr aSourceFeatureTypeAttr = theSourceFeature->data()->string(aTypeAttributeId);
574 AttributeStringPtr aNewFeatureTypeAttr = theNewFeature->data()->string(aTypeAttributeId);
575 aNewFeatureTypeAttr->setValue(aSourceFeatureTypeAttr->value());
576 //ModuleBase_Tools::flushUpdated(theNewFeature);
579 else if (aFeatureKind == SketchPlugin_Arc::ID()) {
581 std::string aTypeAttributeId = SketchPlugin_Arc::ARC_TYPE();
582 AttributeStringPtr aSourceFeatureTypeAttr = theSourceFeature->data()->string(aTypeAttributeId);
583 AttributeStringPtr aNewFeatureTypeAttr = theNewFeature->data()->string(aTypeAttributeId);
584 aNewFeatureTypeAttr->setValue(aSourceFeatureTypeAttr->value());
586 // if the arc is tangent, set coincidence to end point of the previous arc
587 std::string anArcType = aSourceFeatureTypeAttr->value();
588 if (anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT()) {
589 // get the last point of the previuos arc feature(geom point 2d)
590 std::shared_ptr<ModelAPI_Data> aSData = theSourceFeature->data();
591 std::shared_ptr<GeomDataAPI_Point2D> aSPointAttr =
592 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
593 aSData->attribute(SketchPlugin_Arc::END_ID()));
594 // get point attribute on the current feature
595 AttributeRefAttrPtr aTangentPointAttr = theNewFeature->data()->refattr(
596 SketchPlugin_Arc::TANGENT_POINT_ID());
597 aTangentPointAttr->setAttr(aSPointAttr);
599 std::shared_ptr<GeomDataAPI_Point2D> aNPointAttr =
600 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
601 theNewFeature->data()->attribute(SketchPlugin_Arc::END_ID()));
602 aNPointAttr->setValue(aSPointAttr->x(), aSPointAttr->y());
605 //ModuleBase_Tools::flushUpdated(theNewFeature);
611 bool PartSet_SketcherReetntrantMgr::isTangentArc(ModuleBase_Operation* theOperation,
612 const CompositeFeaturePtr& /*theSketch*/) const
614 bool aTangentArc = false;
615 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
617 if (aFOperation && module()->sketchMgr()->isNestedSketchOperation(aFOperation)) {
618 FeaturePtr aFeature = aFOperation->feature();
619 if (aFeature.get() && aFeature->getKind() == SketchPlugin_Arc::ID()) {
620 AttributeStringPtr aTypeAttr = aFeature->data()->string(SketchPlugin_Arc::ARC_TYPE());
621 std::string anArcType = aTypeAttr.get() ? aTypeAttr->value() : "";
622 aTangentArc = anArcType == SketchPlugin_Arc::ARC_TYPE_TANGENT();
628 void PartSet_SketcherReetntrantMgr::updateAcceptAllAction()
630 CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
632 workshop()->errorMgr()->updateAcceptAllAction(aSketch);
635 XGUI_Workshop* PartSet_SketcherReetntrantMgr::workshop() const
637 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
638 return aConnector->workshop();
641 PartSet_Module* PartSet_SketcherReetntrantMgr::module() const
643 return dynamic_cast<PartSet_Module*>(myWorkshop->module());