From bbd8ce10080060ac092bf9c40fa5fda2dc8970f2 Mon Sep 17 00:00:00 2001 From: kgv Date: Wed, 4 Sep 2019 17:24:13 +0300 Subject: [PATCH] 0030721: Visualization - Arrows in dimensions are drawn behind some other lines after applying 30716 AIS_Dimension::DrawArrow() now disables polygon offsets for drawing 2D arrow, so that it is expected to be drawn at the same depth as dimension line. --- src/AIS/AIS_Dimension.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/AIS/AIS_Dimension.cxx b/src/AIS/AIS_Dimension.cxx index 7668b4a6b4..4fcfd6fdd3 100755 --- a/src/AIS/AIS_Dimension.cxx +++ b/src/AIS/AIS_Dimension.cxx @@ -403,16 +403,17 @@ void AIS_Dimension::DrawArrow (const Handle(Prs3d_Presentation)& thePresentation anArrow->AddVertex (aRightPoint); // Set aspect for arrow triangles - Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT); - aShadeMat.SetAmbientColor (Quantity_NOC_BLACK); - aShadeMat.SetDiffuseColor (Quantity_NOC_BLACK); - aShadeMat.SetSpecularColor(Quantity_NOC_BLACK); - - Handle(Prs3d_ShadingAspect) aShadingStyle = new Prs3d_ShadingAspect(); + Graphic3d_PolygonOffset aPolOffset; + aPolOffset.Mode = Aspect_POM_Off; + aPolOffset.Factor = 0.0f; + aPolOffset.Units = 0.0f; + Handle(Graphic3d_AspectFillArea3d) aShadingStyle = new Graphic3d_AspectFillArea3d(); + aShadingStyle->SetInteriorStyle (Aspect_IS_SOLID); aShadingStyle->SetColor (myDrawer->DimensionAspect()->ArrowAspect()->Aspect()->Color()); - aShadingStyle->SetMaterial (aShadeMat); + aShadingStyle->SetShadingModel (Graphic3d_TOSM_UNLIT); + aShadingStyle->SetPolygonOffset (aPolOffset); - aGroup->SetPrimitivesAspect (aShadingStyle->Aspect()); + aGroup->SetPrimitivesAspect (aShadingStyle); aGroup->AddPrimitiveArray (anArrow); }