From: nds Date: Mon, 3 Apr 2017 06:46:24 +0000 (+0300) Subject: Issues #2027, #2024, #2063, #2067: reentrant message to fill new operation by result... X-Git-Tag: V_2.7.0~101 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=205dad6e3d828218e87f8dc050a41cb1af7eaa65;p=modules%2Fshaper.git Issues #2027, #2024, #2063, #2067: reentrant message to fill new operation by result of the previous one. Issue #2064(PartSet_OperationPrs) Line ends on Linux, do not flush ModelAPI_EventReentrantMessage(it is not grouping signal) --- diff --git a/src/PartSet/PartSet_SketcherReentrantMgr.cpp b/src/PartSet/PartSet_SketcherReentrantMgr.cpp index 8af09b3fa..82f1b3b61 100644 --- a/src/PartSet/PartSet_SketcherReentrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReentrantMgr.cpp @@ -720,35 +720,35 @@ bool PartSet_SketcherReentrantMgr::copyReetntrantAttributes(const FeaturePtr& th } else if (aFeatureKind == SketchPlugin_Trim::ID()) { /*std::shared_ptr aRefSelectedAttr = - std::dynamic_pointer_cast( - theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); + std::dynamic_pointer_cast( + theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); std::shared_ptr aNRefSelectedAttr = - std::dynamic_pointer_cast( - theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); + std::dynamic_pointer_cast( + theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); aNRefSelectedAttr->setValue(aRefSelectedAttr->value());*/ std::shared_ptr aRefPreviewAttr = - std::dynamic_pointer_cast( - theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); + std::dynamic_pointer_cast( + theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); std::shared_ptr aNRefPreviewAttr = - std::dynamic_pointer_cast( - theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); + std::dynamic_pointer_cast( + theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT())); aNRefPreviewAttr->setValue(aRefPreviewAttr->value()); /*std::shared_ptr aPointSelectedAttr = - std::dynamic_pointer_cast( - theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT())); + std::dynamic_pointer_cast( + theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT())); std::shared_ptr aNPointSelectedAttr = - std::dynamic_pointer_cast( - theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT())); + std::dynamic_pointer_cast( + theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT())); aNPointSelectedAttr->setValue(aPointSelectedAttr->x(), aPointSelectedAttr->y()); */ std::shared_ptr aPointPreviewAttr = - std::dynamic_pointer_cast( - theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); + std::dynamic_pointer_cast( + theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); std::shared_ptr aNPointPreviewAttr = - std::dynamic_pointer_cast( - theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); + std::dynamic_pointer_cast( + theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT())); aNPointPreviewAttr->setValue(aPointPreviewAttr->x(), aPointPreviewAttr->y()); aChanged = true; diff --git a/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp b/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp index 5fa7f0f07..3cc02a863 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp @@ -101,8 +101,8 @@ AttributePoint2DPtr SketchPlugin_ConstraintCoincidence::getPoint(const FeaturePt } void SketchPlugin_ConstraintCoincidence::createCoincidenceFeature(SketchPlugin_Sketch* theSketch, - const std::shared_ptr& thePoint1, - const std::shared_ptr& thePoint2) + const std::shared_ptr& thePoint1, + const std::shared_ptr& thePoint2) { FeaturePtr aFeature; if (theSketch) { diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 025a98b43..99d69ce67 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -74,7 +74,6 @@ void SketchPlugin_Line::execute() aMessage->setCreatedFeature(ModelAPI_Feature::feature( data()->attribute(START_ID())->owner())); Events_Loop::loop()->send(aMessage); - Events_Loop::loop()->flush(anId); } } } diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.cpp b/src/SketchPlugin/SketchPlugin_MacroArc.cpp index 6a0fff2dc..42e3b1cd5 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroArc.cpp @@ -284,7 +284,6 @@ void SketchPlugin_MacroArc::execute() aMessage->setTypeOfCreation(!anEditArcType.empty() ? anEditArcType : anArcType); aMessage->setCreatedFeature(anArcFeature); Events_Loop::loop()->send(aMessage); - Events_Loop::loop()->flush(anId); } std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr& theMessage) diff --git a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp index b865ec374..0310207db 100644 --- a/src/SketchPlugin/SketchPlugin_MacroCircle.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroCircle.cpp @@ -102,10 +102,10 @@ void SketchPlugin_MacroCircle::execute() aMessage->setTypeOfCreation(!anEditType.empty() ? anEditType : aType); aMessage->setCreatedFeature(aCircle); Events_Loop::loop()->send(aMessage); - Events_Loop::loop()->flush(anId); } -std::string SketchPlugin_MacroCircle::processEvent(const std::shared_ptr& theMessage) +std::string SketchPlugin_MacroCircle::processEvent( + const std::shared_ptr& theMessage) { std::string aFilledAttributeName; std::shared_ptr aReentrantMessage = diff --git a/src/SketchPlugin/SketchPlugin_Trim.cpp b/src/SketchPlugin/SketchPlugin_Trim.cpp index e94f4b10c..986b99b30 100644 --- a/src/SketchPlugin/SketchPlugin_Trim.cpp +++ b/src/SketchPlugin/SketchPlugin_Trim.cpp @@ -147,6 +147,8 @@ std::shared_ptr SketchPlugin_Trim::convertPoint( const std::shared_ptr& thePoint) { std::shared_ptr aPoint; + if (!thePoint.get()) + return aPoint; AttributeReferencePtr aBaseObjectAttr = std::dynamic_pointer_cast( data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT())); @@ -225,7 +227,6 @@ void SketchPlugin_Trim::execute() findShapePoints(SELECTED_OBJECT(), SELECTED_POINT(), aStartShapePoint, aLastShapePoint); std::shared_ptr aStartShapePoint2d = convertPoint(aStartShapePoint); - std::shared_ptr aLastShapePoint2d = convertPoint(aLastShapePoint); std::set aFeaturesToDelete; @@ -464,12 +465,11 @@ void SketchPlugin_Trim::execute() } } if (aPreviewObject.get()) { - static Events_ID anId = ModelAPI_EventReentrantMessage::eventId(); std::shared_ptr aMessage = std::shared_ptr - (new ModelAPI_EventReentrantMessage(anId, 0)); + (new ModelAPI_EventReentrantMessage( + ModelAPI_EventReentrantMessage::eventId(), 0)); aMessage->setSelectedObject(aPreviewObject); Events_Loop::loop()->send(aMessage); - Events_Loop::loop()->flush(anId); } #ifdef DEBUG_TRIM std::cout << "SketchPlugin_Trim::done" << std::endl;