memory consumption to display points !!!

Hi,

to test consumption of display/select point, I change code of AISSelect mfc sample CAISSelectDoc::OnBox()to create an display 1000 point an to show display/select memory consumption.

memory consumption with "myAISContext->Display(aPnt);" --> 6 Mo !!!!

and without :

try it, it's crazy to display just points !!

grx29

the code in AISSelect is below :

void CAISSelectDoc::OnBox()
{
myAISContext->CloseAllContexts();

for(int k = 0; k {
gp_XYZ A(1,2,3);gp_Pnt P2(A);
TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex(P2);
Handle(AIS_Shape) aPnt = new AIS_Shape(aVertex);
myAISContext->Display(aPnt);
}
}

fx's picture

Hi

just a precision...

If I keep vertex and AI_Shape in member's arrays of CAISSelectDoc Class, the memory consumption without "Display(aPnt)" is 1.4 Mo...

in conclusion there is 5.5 Mo consumption more for just display 1000 Pnts...

grx29

fx's picture

If I Add correction of Cherenkova Marina on Pen & Brush in W32_Allocator.hxx and WNT_Allocator.cxx

and correction

/*
* free windows ressources
*/
DeleteObject(font);
DeleteObject(hBmp);
DeleteDC(hMemDC);

in OpenGl_tXfm.c --> loadTexFont(char* fontName, TM_FONT_HANDLE* fontHandle)

I have always the same consumption...5.5 Mo

If I Add points in a unique compound, comsumption decrease to 500 Ko ...

the problem comes from display/select a lot of shapes...

grx29

Stephane Routelous's picture

it's because it's a bad idea to create one AIS_InteractiveObject per point.
the best way is to develop your own AIS_InteractiveObject for displaying all your points in one shot.

S.

fx's picture

it's just an example to illustrate the problem with the most simple object. It's possible to have an application with a lot (> 10000) of selected objects (FEM or other..). It's not a bad idea..it's a possible reality ! it's strange to consumpt ~ 6 ko (!!!) to display/select just on point wich is a very simple geometry...

grx29

fx's picture

in Rhino3D (owner CAD libraries) consumption for 1000 points is 250 Ko ...

in Allibre (ACIS CAD libraries) : 10 Mo...

if you have others examples with others cad softwares

Grx29

QbProg's picture

It is because each object in OpenCascade must instantiate ANOTHER object to have a visualization. This is a very memory consuming approach, not a good solution for displaying many objects.