]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2662: Highlight conflicting constraint by red color
authorvsv <vsv@opencascade.com>
Thu, 4 Oct 2018 09:52:12 +0000 (12:52 +0300)
committervsv <vsv@opencascade.com>
Thu, 4 Oct 2018 09:52:31 +0000 (12:52 +0300)
src/SketchPlugin/SketchPlugin_Plugin.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp

index 4d5aa02e12c1e81f5528ad8699f5d95b04f19a3f..6a47d8539057fdbf43ae8913aaddeb4671550b55 100644 (file)
@@ -77,7 +77,7 @@
 #define SKETCH_ENTITY_COLOR "225,0,0"
 #define SKETCH_EXTERNAL_COLOR "170,0,225"
 #define SKETCH_AUXILIARY_COLOR "0,85,0"
-#define SKETCH_OVERCONSTRAINT_COLOR "0,0,0"
+#define SKETCH_OVERCONSTRAINT_COLOR "255,0,0"
 #define SKETCH_FULLY_CONSTRAINED_COLOR "0,150,0"
 
 //#define SET_PLANES_COLOR_IN_PREFERENCES
index f74c6b5db6d55e015a3f05e373a2a2339edeae11..b8bdd9db71111e3cfbf3e5e3ca2bc6330fc25bbf 100644 (file)
@@ -341,6 +341,18 @@ void SketcherPrs_SymbolPrs::SetCustomColor(const std::vector<int>& theColor)
 
   if (!myAspect.IsNull())
     myAspect->SetColor (myCustomColor);
+
+  Handle(Prs3d_Presentation) aPrs = Presentation();
+  if (!aPrs.IsNull()) {
+    if (myIsCustomColor) {
+      Handle(Graphic3d_PresentationAttributes) aAttr = new Graphic3d_PresentationAttributes();
+      aAttr->SetColor(myCustomColor);
+      aPrs->Highlight(aAttr);
+    }
+    else {
+      aPrs->UnHighlight();
+    }
+  }
 }
 
 //*********************************************************************************
@@ -348,8 +360,6 @@ void SketcherPrs_SymbolPrs::drawShape(const std::shared_ptr<GeomAPI_Shape>& theS
                                       const Handle(Prs3d_Presentation)& thePrs,
                                       Quantity_Color theColor) const
 {
-  int aColNam = theColor.Name();
-  //cout<<"### SketcherPrs_SymbolPrs::drawShape "<<theColor.Name()<<endl;
   Handle(Graphic3d_AspectLine3d) aLineAspect =
     new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);