Need some advice about performance.


I made a simple cad application (just lines and boxes) to test developing with cascade.

I'm using autocad for comparing performance and I got a litle hurried.

I Have a drawing in autocad, a relative small one, with about 10,000 lines and some arcs, text and hatches.

I imported about 2,200 lines to the cascade aplication and performance was very bad.

I'm using a V3d_View and AIS in this application and I call MoveTo method in every mouse move.

This MoveTo is taking to much time to return.

I need the MoveTo calls because I'm trying to implement "object snap", something autocad also have, so I need to know the detected object in every move.

The lines in created as AIS_Shape and I'm also using the OCAF Document.

Can someone tell me what I can do to increase performance?

Thanks a lot.

kim wj's picture

Dont' create ais_shapes for each line. Create only one AIS_Shape and use 'shape decomposition' for picking. Displaying many AIS_InertactiveObject make your application slow down quickly.

I feel that graphic performance of OCC is not good as other graphic API. But, I think that picking performance of OCC is superior.

r-fortes's picture


I'm trying to do what you told me creating a single AIS_Shape for the lines.

I guess this should be ok if I didn't want to change it afterwords but what happens if you contantly want to change lines?

Do I need to call compute methods (throught ReDisplay I think) each time I change something? Do I create a new AIS_Shape and erase the old one? Can you tell me a little more about this strategy?


fhchina's picture

How do you implement your `snap' function? which OCC class is revelant?