0030721: Visualization - Arrows in dimensions are drawn behind some other lines after...
authorkgv <kgv@opencascade.com>
Wed, 4 Sep 2019 14:24:13 +0000 (17:24 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 5 Sep 2019 15:01:39 +0000 (18:01 +0300)
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

index 7668b4a..4fcfd6f 100755 (executable)
@@ -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);
   }