TopoDS_Shape in Wire and Shaded modes

Hello everybody,

After the study of HeeksCAD and some other projects, I have detected in my program that:

The behavior of the transformation of TopoDS_Shape to the Graphic card is a little bit curious :
first way to show a TopoDS_Shape:
...
create TopoDS_Shape and aAISObject
...
aAISObject->SetDisplayMode(1);
theInteractiveContext->m_Context->Display(aAISObject);

leads to bad quality of the shown Shape. I have had to increase the quality factor of the AIS_Interactive context in order to increase the quality->very slow.

BUT

If you load the TopoDS_Shape / ASI_Shape AT FIRST in the Wireframe-mode and AFTER THAT switch it to the Shaded mode:
InteractiveContext.SetDisplayMode(1);

the quality is good and it happens more faster (not very slower than bei HeeksCAD). Of course OCC needs some time to switch the modes.->not very fast

What is the reason ? Is it is depend on the mode, how the Shape will be transformed to the GraphicCard ....?
Has somebody the same behavior ?

Paul Jimenez's picture

You say OCC needs some time to switch from Wireframe to Shaded mode. When you display a shape in Wireframe mode at first, only that mode is computed. The moment you switch to Shaded mode, that mode is computed (which takes longer). If you show the shape in Shaded mode at first, then that's the computed mode. If you later switch to Wireframe mode, then that mode is computed. In other words, each mode is computed the first time it's needed.

Dmitry Khabi's picture

But it seems, that the order of the mode's computing have a preference.
If Wireframe is calculatet and then the Shaded mode, then the quality is better.

Paul Jimenez's picture

No idea then.

What happens if you display it in shaded mode, then switch to wireframe and then back to shaded? Does the quality improve?

Dmitry Khabi's picture

No, only by first computation:

"..In other words, each mode is computed the first time it's needed..."