]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issues #2027, #2024, #2063, #2067: reentrant message to fill new operation by result...
authornds <nds@opencascade.com>
Mon, 3 Apr 2017 06:46:24 +0000 (09:46 +0300)
committernds <nds@opencascade.com>
Mon, 3 Apr 2017 06:46:24 +0000 (09:46 +0300)
Line ends on Linux, do not flush ModelAPI_EventReentrantMessage(it is not grouping signal)

src/PartSet/PartSet_SketcherReentrantMgr.cpp
src/SketchPlugin/SketchPlugin_ConstraintCoincidence.cpp
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_MacroArc.cpp
src/SketchPlugin/SketchPlugin_MacroCircle.cpp
src/SketchPlugin/SketchPlugin_Trim.cpp

index 8af09b3fab92f07e1a87d68dd96f8ba3cc7f26e3..82f1b3b61da588dc5a6a247c4491fded8e86ce1e 100644 (file)
@@ -720,35 +720,35 @@ bool PartSet_SketcherReentrantMgr::copyReetntrantAttributes(const FeaturePtr& th
   }
   else if (aFeatureKind == SketchPlugin_Trim::ID()) {
     /*std::shared_ptr<ModelAPI_AttributeReference> aRefSelectedAttr =
-                            std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
-                            theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
+                      std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+                      theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
     std::shared_ptr<ModelAPI_AttributeReference> aNRefSelectedAttr =
-                            std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
-                            theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
+                      std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+                      theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
     aNRefSelectedAttr->setValue(aRefSelectedAttr->value());*/
 
     std::shared_ptr<ModelAPI_AttributeReference> aRefPreviewAttr =
-                            std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
-                            theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
+                      std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+                      theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
     std::shared_ptr<ModelAPI_AttributeReference> aNRefPreviewAttr =
-                            std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
-                            theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
+                        std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
+                        theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_OBJECT()));
     aNRefPreviewAttr->setValue(aRefPreviewAttr->value());
 
     /*std::shared_ptr<GeomDataAPI_Point2D> aPointSelectedAttr =
-                            std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-                            theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
+                      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+                      theSourceFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
     std::shared_ptr<GeomDataAPI_Point2D> aNPointSelectedAttr =
-                            std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-                            theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
+                      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+                      theNewFeature->data()->attribute(SketchPlugin_Trim::SELECTED_POINT()));
     aNPointSelectedAttr->setValue(aPointSelectedAttr->x(), aPointSelectedAttr->y());
     */
     std::shared_ptr<GeomDataAPI_Point2D> aPointPreviewAttr =
-                            std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-                            theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
+                      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+                      theSourceFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
     std::shared_ptr<GeomDataAPI_Point2D> aNPointPreviewAttr =
-                            std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
-                            theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
+                      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+                      theNewFeature->data()->attribute(SketchPlugin_Trim::PREVIEW_POINT()));
     aNPointPreviewAttr->setValue(aPointPreviewAttr->x(), aPointPreviewAttr->y());
 
     aChanged = true;
index 5fa7f0f075a1e8848f46794f8c7568ebb502df23..3cc02a863e73f99b635880abcd94b982366ebcc6 100644 (file)
@@ -101,8 +101,8 @@ AttributePoint2DPtr SketchPlugin_ConstraintCoincidence::getPoint(const FeaturePt
 }
 
 void SketchPlugin_ConstraintCoincidence::createCoincidenceFeature(SketchPlugin_Sketch* theSketch,
-                                                  const std::shared_ptr<GeomDataAPI_Point2D>& thePoint1,
-                                                  const std::shared_ptr<GeomDataAPI_Point2D>& thePoint2)
+                                           const std::shared_ptr<GeomDataAPI_Point2D>& thePoint1,
+                                           const std::shared_ptr<GeomDataAPI_Point2D>& thePoint2)
 {
   FeaturePtr aFeature;
   if (theSketch) {
index 025a98b432fdd88f377eccd1ce3a02f7cab79e96..99d69ce67bcc16c3cebf2c8528351b8140abc5f7 100644 (file)
@@ -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);
     }
   }
 }
index 6a0fff2dc33a10d86129989de9aaf5db89e888d3..42e3b1cd5b2b64cd2fb5906983587c0ce40887f0 100644 (file)
@@ -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<Events_Message>& theMessage)
index b865ec374d61420e52b206ee2984e08d2e79c00d..0310207db3954ce6be56f2f2a96883bdfe57ef9a 100644 (file)
@@ -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<Events_Message>& theMessage)
+std::string SketchPlugin_MacroCircle::processEvent(
+                                              const std::shared_ptr<Events_Message>& theMessage)
 {
   std::string aFilledAttributeName;
   std::shared_ptr<SketchPlugin_MacroArcReentrantMessage> aReentrantMessage =
index e94f4b10cbd40a07eae3c960fbaa1a0166ba5729..986b99b30d941314868403303847a83dfcf26bc0 100644 (file)
@@ -147,6 +147,8 @@ std::shared_ptr<GeomAPI_Pnt2d> SketchPlugin_Trim::convertPoint(
                                                    const std::shared_ptr<GeomAPI_Pnt>& thePoint)
 {
   std::shared_ptr<GeomAPI_Pnt2d> aPoint;
+  if (!thePoint.get())
+    return aPoint;
 
   AttributeReferencePtr aBaseObjectAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(
                                         data()->attribute(SketchPlugin_Trim::SELECTED_OBJECT()));
@@ -225,7 +227,6 @@ void SketchPlugin_Trim::execute()
   findShapePoints(SELECTED_OBJECT(), SELECTED_POINT(), aStartShapePoint, aLastShapePoint);
 
   std::shared_ptr<GeomAPI_Pnt2d> aStartShapePoint2d = convertPoint(aStartShapePoint);
-
   std::shared_ptr<GeomAPI_Pnt2d> aLastShapePoint2d = convertPoint(aLastShapePoint);
 
   std::set<FeaturePtr> aFeaturesToDelete;
@@ -464,12 +465,11 @@ void SketchPlugin_Trim::execute()
     }
   }
   if (aPreviewObject.get()) {
-    static Events_ID anId = ModelAPI_EventReentrantMessage::eventId();
     std::shared_ptr<ModelAPI_EventReentrantMessage> aMessage = std::shared_ptr
-      <ModelAPI_EventReentrantMessage>(new ModelAPI_EventReentrantMessage(anId, 0));
+      <ModelAPI_EventReentrantMessage>(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;