From 3abb040ed6a94d75da11faea5be78489e19c8095 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 17 Dec 2019 17:26:21 +0300 Subject: [PATCH] 0031153: Visualization - Non clear highlighting of selected trihedron elements. Revert not needed changes in AIS_InteractiveContext.cxx, that can be applied only on the newest OCCT. --- src/AIS/AIS_InteractiveContext.cxx | 38 +++++++++--------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index ec4e3ab73c..314e6229cd 100644 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -69,15 +69,13 @@ namespace typedef NCollection_DataMap::Iterator AIS_MapIteratorOfMapOfObjectOwners; //! Initialize default highlighting attributes. - static void initDefaultHilightAttributes (const Handle(Prs3d_Drawer)& theDrawer, - const Quantity_Color& theColor) + static void initDefaultHilightAttributes (const Handle(Prs3d_Drawer)& theDrawer) { theDrawer->SetMethod (Aspect_TOHM_COLOR); theDrawer->SetDisplayMode (0); - theDrawer->SetColor (theColor); - theDrawer->SetupOwnShadingAspect(); - theDrawer->SetupOwnPointAspect(); + theDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_BLACK, 1.0)); + *theDrawer->PointAspect()->Aspect() = *theDrawer->Link()->PointAspect()->Aspect(); theDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); *theDrawer->LineAspect()->Aspect() = *theDrawer->Link()->LineAspect()->Aspect(); theDrawer->SetWireAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); @@ -88,24 +86,6 @@ namespace *theDrawer->FreeBoundaryAspect()->Aspect() = *theDrawer->Link()->FreeBoundaryAspect()->Aspect(); theDrawer->SetUnFreeBoundaryAspect (new Prs3d_LineAspect (Quantity_NOC_BLACK, Aspect_TOL_SOLID, 1.0)); *theDrawer->UnFreeBoundaryAspect()->Aspect() = *theDrawer->Link()->UnFreeBoundaryAspect()->Aspect(); - theDrawer->SetDatumAspect (new Prs3d_DatumAspect()); - - theDrawer->ShadingAspect()->SetColor (theColor); - theDrawer->WireAspect()->SetColor (theColor); - theDrawer->LineAspect()->SetColor (theColor); - theDrawer->PlaneAspect()->ArrowAspect()->SetColor (theColor); - theDrawer->PlaneAspect()->IsoAspect()->SetColor (theColor); - theDrawer->PlaneAspect()->EdgesAspect()->SetColor (theColor); - theDrawer->FreeBoundaryAspect()->SetColor (theColor); - theDrawer->UnFreeBoundaryAspect()->SetColor (theColor); - theDrawer->PointAspect()->SetColor (theColor); - for (Standard_Integer aPartIter = 0; aPartIter < Prs3d_DP_None; ++aPartIter) - { - if (Handle(Prs3d_LineAspect) aLineAsp = theDrawer->DatumAspect()->LineAspect ((Prs3d_DatumParts )aPartIter)) - { - aLineAsp->SetColor (theColor); - } - } theDrawer->WireAspect()->SetWidth (2.0); theDrawer->LineAspect()->SetWidth (2.0); @@ -155,26 +135,30 @@ myIsAutoActivateSelMode(Standard_True) { const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_Dynamic]; aStyle->Link (myDefaultDrawer); - initDefaultHilightAttributes (aStyle, Quantity_NOC_CYAN1); + initDefaultHilightAttributes (aStyle); aStyle->SetZLayer(Graphic3d_ZLayerId_Top); + aStyle->SetColor (Quantity_NOC_CYAN1); } { const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_LocalDynamic]; aStyle->Link (myDefaultDrawer); - initDefaultHilightAttributes (aStyle, Quantity_NOC_CYAN1); + initDefaultHilightAttributes (aStyle); aStyle->SetZLayer(Graphic3d_ZLayerId_Topmost); + aStyle->SetColor (Quantity_NOC_CYAN1); } { const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_Selected]; aStyle->Link (myDefaultDrawer); - initDefaultHilightAttributes (aStyle, Quantity_NOC_GRAY80); + initDefaultHilightAttributes (aStyle); aStyle->SetZLayer(Graphic3d_ZLayerId_UNKNOWN); + aStyle->SetColor (Quantity_NOC_GRAY80); } { const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_LocalSelected]; aStyle->Link (myDefaultDrawer); - initDefaultHilightAttributes (aStyle, Quantity_NOC_GRAY80); + initDefaultHilightAttributes (aStyle); aStyle->SetZLayer(Graphic3d_ZLayerId_UNKNOWN); + aStyle->SetColor (Quantity_NOC_GRAY80); } { const Handle(Prs3d_Drawer)& aStyle = myStyles[Prs3d_TypeOfHighlight_SubIntensity]; -- 2.39.5