Arrow drawing

Hello, I want to draw arrows to represent the direction of surface normal vector. And I took the https://dev.opencascade.org/content/arrow-representation and https://dev.opencascade.org/doc/occt-7.5.0/refman/html/class_prs3d___arrow.html  as reference (my OCCT version is 7.5.0). 

However, I don't know how to new the Prs3d_Presentation object, the second line of code can't work (aCtx->CurrentViewer()  doesn't have member function Viewer())

reference code:

Handle(AIS_InteractiveContext) aCtx;

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

Prs3d_Arrow::Draw(aPresentation, Point,  Dir, angle, length);

 Can anyone give me suggestion. Thanks a lot.

Kirill Gavrilov's picture

Presentation builders like Prs3d_Arrow::Draw() are designed to be used by subclasses of AIS_InteractiveObject within their AIS_InteractiveObject::Compute() implementation. If you don't want creating an own AIS object, you may try using existing one like AIS_Trihedron as suggested by Andrey in referred topic.