Display a line in view

Hello. How can I add a line to view? 

I need just a plain line, going from start to end, with a given line thickness.

Ivan P's picture
void CommonGraphicsHandler::drawPlainLine(double startPositionX, double startPositionY, double endPositionX, double endPositionY) {
    Handle(Geom_CartesianPoint) startPoint = new Geom_CartesianPoint((double)startPositionX,(double)0.0,(double)startPositionY);
    Handle(Geom_CartesianPoint) endPoint = new Geom_CartesianPoint((double)endPositionX, (double)0.0, (double)endPositionY);
    Handle(AIS_Line) theLineToDisplay = new AIS_Line(startPoint, endPoint);
    privateAISContext->Display(theLineToDisplay, true);