Display a text in V3d_View without zoomable.

Hi,
How can I display a text in a v3d_view that when the zoom is changing the text's size is not changing.

Thanks in advance.
Lugi.C

ekiroglu's picture

Hello,
You can create a class like ISession_Text :

...
void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer aMode)
{
Prs3d_Text::Draw(aPresentation,myDrawer,MyText,gp_Pnt( MyX ,MyY,MyZ ));
}
...

Then, in your class in which you will create text:

Handle(ISession_Text)aGraphicText = new ISession_Text(aText, aPoint, Aspect_TOT_SOLID, 0.0, 0.5, 5, 2, 0.5 );
GetDocument()->GetAISContext()->Display(aGraphicText,1,-1);

I hope this will be helpfull.

Best Regards,
Erki