So far I've been adventuring more and more into reading code and getting used to it, sometimes it can be quite hard, specially because I am reading code related to GBR brushes, which are not so simple, or even complex.
I've been reading
kis_imagepipe_brush.cpp and I've checking the classes related to it, like
Now, I have to recognize that using classes has been fun, but hard and confusing, sometimes I get a little frustrated, I feel like I am completely lost. The positive thing about this is that it means I am actually learning, and I am pushing my self.
I feel confused about how classes seem to know when to be applied and when to work, don't get me wrong, they seem to be an smart feature and that can reduce complexity, however they also feel like magic, doing stuff when it is the right moment.
The thing is, I need to understand how to connect the classes I am writing:
kis_vector_animated_brush, so they work with the other classes I need, like
My tutor explained to me that they work like a cookie, so once they are called they will remain there until they are destroyed or 'eaten'. I understand this concept, it seems simple, now I just need to know how to apply it.
Cycling through the brush
Right now I am trying to give my brush the ability to cycle through a
KoShapes, so that every dab it will render a different image.
I understand the basic concept, I need to call the function
.at() on the
QList, so that with every dab I will get a different image.
(Actually, now that I think about it, I think I could do it right away with all the
QList and instead call the resulting
QImages every time…)
I just need to get the
brusIndex and add 1 every time, seems easy enough, however I still need to figure how to do this at every dab. I have to do this in my new class and using
chooseNextBrush(), seems easy enough, get a dab event, add one to
brushIndex and get next image, but for some reason I still feel lost on how to actually write this.
Well it might seem like I am not competent at programming, but I had been learning about Object Oriented Programming, and every day I feel more and more good with it, so I hope in a couple days I will have figured it out, so I can move to the next part of my project.