Revision 851444

Go back to digest for 24th August 2008

Optimization in KDE Base

Jason Harris committed changes in /trunk/KDE/kdelibs/kdeui/plotting/kplotwidget.cpp:

Having received no feedback on k-c-d when I announced this patch, I'll go ahead and commit it.

Improved "smart" placement of text labels for plotted points that have been named.
The previous method used a low-resolution "gridding" of the plot region into a 100x100 array (regardless of the plot widget's size) to serve as a mask to identify regions which already contain a plot element.
Now we use an actual image for the mask, matched to the size of the widget.

In addition, we use a "downhill simplex" algorithm to search for an optimal label position near the target point such that the label doesn't overlap with other plot elements.
Before we used a brute-force search.

With the new method, the Solar System tool in KStars takes 85-95 msec to draw itself (compared to 250 ms with the old code, and 75-85 msec with no point labels).

File Changes

Modified 1 files
  • /trunk/KDE/kdelibs/kdeui/plotting/kplotwidget.cpp
1 files changed in total