iterators

Casper Boemann cbr at boemann.dk
Wed Jan 19 13:55:08 CET 2005


Hi

I have talked to cyrille, and we both agree that there is no need to keep
the KisIteratorUnit as a base class. So I'll refactor that one in the not so
distant future, so KisIteratorPixel becomes the new base class.

We also agreed that the KisIteratorLine classes are of no real use, so they
are about to go (working on that in my local repository right now). That
should also fix the factory methods in the paint device. The old factory
methods are gone, but new factory methods for the KisIteratorPixel classes
comes instead. The beginning and end creators will be replaced by
extentBeginning and extentEnd.

A little longer into the future. We need to figure out how the two layers of
iterators are to be used. The basic (mine) and the on-top (cyrille's) have
different ways of determining when they are done. That doesn't seem
coherrent although it's not that big a problem.

The isDone() way has the advantage that rectIterators and other 2D iterators
are possible. That was actually the reason I chose it.

The STL way has the advantage of being familliar to STL users, but they are
not really geared to 2D cases.

In fact we have the oppotunity to get rid of the STL way right now,as I am
touching everywhere they are use anyway. I imagine subclassing from the
basic iterators and merge the KisPixel and selection etc stuff we are used
to.

That should be something like
class KisRectIteratorPixel : class KisRectIterator
{
   KisPixelRO *oldValue();
   KisPixel * operator();
}

Now if someone can tell me how to use the STL way for 2D, I'm open to
changing the basic iterators to the STL way, but I still feel that the shown
subclassing would be a good idea. So that either isDone() og STL is used in
all iterators.

thoughts anyone?

best regards
Casper



More information about the kimageshop mailing list