On 08.01.2008, at 10:53, Jens Grunert wrote:

> I'm a hardware ASIC design engineer who wants to write a small and  
> fast viewer to display graphically the cell placement of ASIC  
> standard cells.
>
> In simply gluing together already existing widgets I got the program  
> working for smaller designs for to 100.000 cells (a surprisingly  
> short time thanks to FLTK and the support).


Ah, so if you have a very regular pattern in your design, then how  
about this:

Derive a new Fl_Group, details below.

Now create you main Group and add 1000 horizontal thin groups,  
creating something that looks like 1000 row.

Next, in each of those groups, put 1000 of your widgets. Now you have  
a 1000x1000 grid of widgets, which is still slow.

Now comes the trick: in the custom top level group, rewrite the draw()  
and the handle() function, so that any subgroup that is invisible is  
never handled or drawn. For example, only row 256 to 310 are visible,  
so don't bother forwarding handle() or draw() events to rows 0 to 255  
or rows 311 to 999. Already we have reduced the number of widgets  
involved by 95%.

Now do the same with each individual row: rewrite the handle function  
to only consider widgets that are actually visible. Tada, you just  
threw away 99% of your CPU load.

Now there is still the issue when the user zooms to see all of the  
widgets. I would write a single specialized widget for rendering the  
widget in the zoomed-out state using standard FLTK rendering call,  
probably buffering off-screen and rendering only changes.

Matthias

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to