From: kgv Date: Wed, 4 Sep 2019 14:24:13 +0000 (+0300) Subject: 0030721: Visualization - Arrows in dimensions are drawn behind some other lines after... X-Git-Tag: V7_4_0_beta~25 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=bbd8ce10080060ac092bf9c40fa5fda2dc8970f2;p=occt-copy.git 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. --- 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); }