Background image

With the new 5.2 Release (5.1 has not been tested) the V3d_View::SetBackgroundImage function works not as supposed.

The Background image is only displayed, if the SetBackgroundImage function has been called, when there is no object display. If one object is displayed in the viewer (e.g. Trihedron), the background will be black.

Yesterday, I digged through the whole code of the OpenGL driver, but I couldn't find the reason.

Please help me - or at least - confirm that this is a bug !

Kind regards

Markus

Markus Nickels's picture

I have to add, that once you have the background image, you can display any object and the background is still correct.

Markus

Markus Nickels's picture

And my last addition: There is no way to "Unset" the background image - the only one is to restart your application. Or did I miss something ?

Markus

DELORME's picture

Without having to restart an application, it is possible to "unset" a background image, i.e. replace by another image or switch to a simple colored background.

A solution is to rebuild the view :
Handle_AIS_InteractiveContext ais_context;
Handle_V3d_View view3d;
// ... initialized somewhere

// Now you want to swicth to another backround mode, image, etc.
view3d->Window ()->Destroy ();
view3d->Remove ();
view3d = ais_context->CurrentViewer ()->CreateView ();
// etc. juste recreate the view and set the new background.

Note : it works fine on Windows, I have not tested it on any other OS, but it should presumably work as well.