From: nds Date: Fri, 10 Jun 2016 06:50:28 +0000 (+0300) Subject: Color correction of conflicting coincidence constraint. Scenario for conflicting... X-Git-Tag: V_2.4.0~116 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3ccd013a70a408dc34c770a99c526094998c0dd7;p=modules%2Fshaper.git Color correction of conflicting coincidence constraint. Scenario for conflicting coincidence constraint: two parallel lines, distance between a point on 1st line and the 2nd line. Create point, which coincident to both lines. --- diff --git a/src/SketcherPrs/SketcherPrs_Coincident.cpp b/src/SketcherPrs/SketcherPrs_Coincident.cpp index c4539bf63..26a5e682c 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.cpp +++ b/src/SketcherPrs/SketcherPrs_Coincident.cpp @@ -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& 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); } diff --git a/src/SketcherPrs/SketcherPrs_Coincident.h b/src/SketcherPrs/SketcherPrs_Coincident.h index d041cac9d..9d6d799ad 100644 --- a/src/SketcherPrs/SketcherPrs_Coincident.h +++ b/src/SketcherPrs/SketcherPrs_Coincident.h @@ -72,6 +72,7 @@ private: std::shared_ptr 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 };