From b383a61fbdfc28111db53f69c7cef99af01ecbec Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 27 Aug 2019 14:26:45 +0300 Subject: [PATCH] 0030923: Visualization, AIS_ViewCube - avoid mixing non-zoomable text and trihedron-persistence Box sides labels are now drawn with zoomable flag. --- src/AIS/AIS_ViewCube.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/AIS/AIS_ViewCube.cxx b/src/AIS/AIS_ViewCube.cxx index 7db8842ccf..3fdc7ce564 100644 --- a/src/AIS/AIS_ViewCube.cxx +++ b/src/AIS/AIS_ViewCube.cxx @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -193,6 +194,7 @@ void AIS_ViewCube::setDefaultAttributes() myDrawer->TextAspect()->SetColor (Quantity_NOC_BLACK); myDrawer->TextAspect()->SetFont (Font_NOF_SANS_SERIF); myDrawer->TextAspect()->SetHeight (16.0); + myDrawer->TextAspect()->Aspect()->SetTextZoomable (true); // the whole object is drawn within transformation-persistence // this should be forced back-face culling regardless Closed flag myDrawer->TextAspect()->Aspect()->SetSuppressBackFaces (true); @@ -717,7 +719,14 @@ void AIS_ViewCube::Compute (const Handle(PrsMgr_PresentationManager3d)& , const Standard_Real anOffset = 2.0; // extra offset to avoid overlapping with triangulation const gp_Pnt aPos = aDir.XYZ() * (mySize * 0.5 + myBoxFacetExtension + anOffset); const gp_Ax2 aPosition (aPos, aDir, anUp.Crossed (aDir)); - Prs3d_Text::Draw (aTextGroup, myDrawer->TextAspect(), aLabel, aPosition); + + Handle(Graphic3d_Text) aText = new Graphic3d_Text ((Standard_ShortReal)myDrawer->TextAspect()->Height()); + aText->SetText (aLabel); + aText->SetOrientation (aPosition); + aText->SetOwnAnchorPoint (false); + aText->SetHorizontalAlignment(myDrawer->TextAspect()->HorizontalJustification()); + aText->SetVerticalAlignment (myDrawer->TextAspect()->VerticalJustification()); + aTextGroup->AddText (aText); } }