]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Color correction of conflicting coincidence constraint. Scenario for conflicting...
authornds <nds@opencascade.com>
Fri, 10 Jun 2016 06:50:28 +0000 (09:50 +0300)
committernds <nds@opencascade.com>
Fri, 10 Jun 2016 06:50:57 +0000 (09:50 +0300)
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_Coincident.h

index c4539bf63f4faf837bc4aa47da53f5d75ad0b8d9..26a5e682c9c4f200a339410ed107b9e9b1974bc8 100644 (file)
@@ -86,7 +86,7 @@ void SketcherPrs_Coincident::Compute(const Handle(PrsMgr_PresentationManager3d)&
   // The external yellow contour
   aPtA->SetType(Aspect_TOM_RING3);
   aPtA->SetScale(2.);
-  aPtA->SetColor(aValid ? Quantity_NOC_YELLOW : Quantity_NOC_BLACK);
+  aPtA->SetColor(aValid ? Quantity_NOC_YELLOW : myConflictingColor);
 
   Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePresentation);
   aGroup->SetPrimitivesAspect(aPtA);
@@ -97,7 +97,7 @@ void SketcherPrs_Coincident::Compute(const Handle(PrsMgr_PresentationManager3d)&
   // Make a black mid ring
   aPtA->SetType(Aspect_TOM_RING1);
   aPtA->SetScale(1.);
-  aPtA->SetColor(Quantity_NOC_BLACK);
+  aPtA->SetColor(aValid ? Quantity_NOC_BLACK : myConflictingColor);
   aGroup->SetPrimitivesAspect(aPtA);
   aGroup->AddPrimitiveArray (aPntArray);
 
@@ -134,18 +134,6 @@ void SketcherPrs_Coincident::SetConflictingConstraint(const bool& theConflicting
                                                      const std::vector<int>& theColor)
 {
   myIsConflicting = theConflicting;
-
-    /*if (theConflicting)
-  {
-    if (!myAspect.IsNull())
-      myAspect->SetColor (Quantity_Color (theColor[0] / 255., theColor[1] / 255., theColor[2] / 255.,
-                          Quantity_TOC_RGB));
-    myIsConflicting = true;
-  }
-  else
-  {
-    if (!myAspect.IsNull())
-      myAspect->SetColor (Quantity_Color (1.0, 1.0, 0.0, Quantity_TOC_RGB));
-    myIsConflicting = false;
-  }*/
+  myConflictingColor = Quantity_Color(theColor[0] / 255., theColor[1] / 255., theColor[2] / 255.,
+                                      Quantity_TOC_RGB);
 }
index d041cac9d8210d592913215627afa1a60fbb9ee6..9d6d799adcd971c9e728f49d292e78c7052a54f6 100644 (file)
@@ -72,6 +72,7 @@ private:
   std::shared_ptr<GeomAPI_Ax3> mySketcherPlane;
   gp_Pnt myPoint;
   bool myIsConflicting; /// state if the presentation is visualized in error state
+  Quantity_Color myConflictingColor; /// the color of mid ring if there is a conflict
 };