I used vtkLineSource and vtkVectorText but depending on the image size I render this doesn’t work sometimes, so I need some universal solution so that the scale bar line and text always look ok.
Could you please advise something concerning this problem?
I would not even allow displaying a ruler if you use perspective projection, but should work well for parallel projection. You can even display it as a 2D actor - see how it is done in C++ here.