From: duv Date: Tue, 14 Jul 2015 14:42:27 +0000 (+0300) Subject: 0026433: AIS_Dimension may attempt to modify the state of default Drawer shading... X-Git-Tag: V7_0_0_beta~15 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=d2dfbc4d7d29eeb23d11d503faa7ddd926189aeb;p=occt.git 0026433: AIS_Dimension may attempt to modify the state of default Drawer shading aspect - Added checks to allow modification of only own aspects in AIS_Dimension::DrawText() --- diff --git a/src/AIS/AIS_Dimension.cxx b/src/AIS/AIS_Dimension.cxx index 6c808dcb8a..c77d1f3250 100755 --- a/src/AIS/AIS_Dimension.cxx +++ b/src/AIS/AIS_Dimension.cxx @@ -496,6 +496,11 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation, if (myDrawer->DimensionAspect()->IsTextShaded()) { // Setting text shading and color parameters + if (!myDrawer->HasOwnShadingAspect()) + { + myDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); + } + Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT); aShadeMat.SetReflectionModeOff (Graphic3d_TOR_AMBIENT); aShadeMat.SetReflectionModeOff (Graphic3d_TOR_DIFFUSE); @@ -509,8 +514,14 @@ void AIS_Dimension::DrawText (const Handle(Prs3d_Presentation)& thePresentation, } else { - // setting color for text + // Setting color for text + if (!myDrawer->HasOwnFreeBoundaryAspect()) + { + myDrawer->SetFreeBoundaryAspect (new Prs3d_LineAspect (aColor, Aspect_TOL_SOLID, 1.0)); + } + myDrawer->FreeBoundaryAspect()->Aspect()->SetColor (aColor); + // drawing text StdPrs_WFShape::Add (thePresentation, aTextShape, myDrawer); }