Salome HOME
Implementation and part of tests of High Level Objects History task for Common, Cut...
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Coincident.cpp
index 684065e0a0192a6d4935f3c9347906834db3dc2d..c123960a59a9cc91c36655a5f4ef54ffb485fe61 100644 (file)
@@ -124,12 +124,13 @@ void SketcherPrs_Coincident::Compute(
     std::shared_ptr<GeomAPI_Pnt2d> aPnt = getCoincidencePoint(myConstraint);
     std::shared_ptr<GeomAPI_Pnt2d> aP;
     FeaturePtr aSub;
-    for (int i = 0; i < mySketch->numberOfSubs(); i++) {
+    int aNumberOfSubs = mySketch->numberOfSubs();
+    for (int i = 0; i < aNumberOfSubs; i++) {
       aSub = mySketch->subFeature(i);
       if (aSub->getKind() == SketchPlugin_ConstraintCoincidence::ID() &&
         aSub.get() != myConstraint) {
         aP = getCoincidencePoint(aSub.get());
-        if (aP->isEqual(aPnt)) {
+        if (aP && aP->isEqual(aPnt)) {
           aIsEdge = hasEdge(aSub.get());
           if (aIsEdge)
             break;
@@ -156,7 +157,7 @@ void SketcherPrs_Coincident::Compute(
 
   // Make a black mid ring
   aPtA = new Graphic3d_AspectMarker3d();
-  aPtA->SetType(Aspect_TOM_RING1);
+  aPtA->SetType(aIsEdge ? Aspect_TOM_STAR : Aspect_TOM_RING1);
   aPtA->SetScale(1.);
   aPtA->SetColor(!aCustomColor ? aInternalColor : myCustomColor);
   aGroup->SetPrimitivesAspect(aPtA);