V3d_View Text

Hi all.
I want add the text to V3d_View can i used following method...but i dont know whats going wrong....:-(

Handle(Prs3d_Presentation) aPresentation = new Prs3d_Presentation (GetDocument()->m_pAISContext->CurrentViewer()->Viewer());

Prs3d_Text::Draw(aPresentation,GetDocument()->m_pAISContext->DefaultDrawer()->TextAspect(),str,gp_Pnt(10.0,10.0,0.));

thanks in advance for any suggesions.

d-teissandier's picture

You can do as follows :

TCollection_ExtendedString aTCoText("Text");
gp_Pnt aPnt OrigineDimZT(0,0,0);

aPresentation= new Prs3d_Presentation(aContext->CurrentViewer()->Viewer());
Handle(Prs3d_TextAspect) aTextAspect= new Prs3d_TextAspect();
aTextAspect->SetFont(Graphic3d_NOF_ASCII_COMPLEX);

aTextAspect->SetHeight(6);
aTextAspect->SetColor(Quantity_NOC_SNOW);
aTextAspect->SetSpace(20);
Prs3d_Text::Draw(aPresentation,aComeAspect,aText, OrigineCome);
Prs3d_Text::Draw(aPresentation,aTextAspect,aTCoText, OrigineDimZT);

aPresentation->Display();

Denis

deshpande's picture

hi Denis
Thank you very much....
ajit