For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

How to free memory for unhighlighted lines

Keito Okajima's picture
Forums: 

Hello,
I am using OpenCascade V7.4.0 on 32bit windows.

I am making a process to select the line drawn on the screen and highlight the selected line.
view and context are created from the parent viewer respectively.

context-> Select (xMin, yMin, xMax, yMax, view, Standard_False);
view-> Redraw ();

-----

view = viewer-> CreateView ();
context = new AIS_InteractiveContext (viewer);

Selecting and highlighting a row will increase memory. After that, deselecting the line and unhighlighting does not reduce the increased memory.
Is there a way to free up the extra memory while displaying the lines?

Best regards.
Keito

Kirill Gavrilov's picture

There are two reasons when highlighting might hold extra memory:

  • Highlighting and normal display use two different display modes (like AIS_Shaded and AIS_Wireframe).
    OCCT 3D Viewer normally caches the presentation computed for highlighting to ensure that the next time it will be displayed faster.
  • Local selection mode is activated so that highlighting creates dedicated presentations of each highlighted sub-shape, which are also cached for reusage.

Within the first case, you may consider using the same display mode for highlighting as used for main presentation.
You may try to clear additional presentation explicitly after unhighlighting [context->MainPrsMgr()->Erase(object, AIS_Wireframe)], but this could be error-prone.

Within the second case, auxiliary presentations should be released by deactivation of selection mode.

P.S.: It is better moving to the new forum - this one will be locked / shut down soon.

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.