[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Re: paintop brush model
From:       Sven Langkamp <sven.langkamp () gmail ! com>
Date:       2009-07-28 3:24:44
Message-ID: 478b087a0907272024v4df24df2m682da58eb372e4b3 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Mon, Jul 27, 2009 at 1:02 PM, Lukast dev <lukast.dev@gmail.com> wrote:

> Hi,
>
> today I explored the posibilities and I would like to ask you questions.
>
> I modified the Line tool , so that it draws preview of the tool
> according the canvas widget.
> So there is code in paint like this:
>
> void KisToolLine::paintLine(QPainter& gc, const QRect&)
> {
>    if (m_canvas->canvasController()->isCanvasOpenGL()){
>        OpenGL code here...
>    }else ... {
>       QPainter stuff
>    }
> }
>
> I'm asking you, should I use if's or make some interface with method
> paintOpenGL stuff and then
> call this paintOpenGL preview in OpenGL based canvas on every tool
> that will inherite from that interface?
>
> Or rather keep the style consistent with gradient tool preview and use
> #ifdefs (HAVE_OPENGL) etc. etc.?


You need both without #if you can't compile it without the opengl libs
installed and the isCanvasOpenGL as runtime switch.
I'm wondering why you are changing the line tool. What preview do you mean?
The brush for your gsoc shouldn't be needed in the line tool.

What can be a problem:
> some tools also need code in mouseMoveEvent etc. so I doin't know how
> to implement it nicely.
> There can be some math needed for painting previews specific for OpenGL
> canvas.


The tools don't have drawing code in the mouse move event. Actually you
should only need to add code in the freehand tool.

Then I have plan to add support for every paintop. Tool freehand will
> ask for model from paintop and it will paint that model if the OpenGL
> canvas is used.
> Every paintop will have it's obj file and user will set up in settings
> whether he wants to use brush outline or brush model or tool icon.


I think it would be better to leave that to the paintop. Paintop need to
have a model representation e.g. duplicate or deform.
Paintops could also override to provide custom stuff like bristle
simulation.

[Attachment #5 (text/html)]

<div class="gmail_quote">On Mon, Jul 27, 2009 at 1:02 PM, Lukast dev <span \
dir="ltr">&lt;<a href="mailto:lukast.dev@gmail.com">lukast.dev@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi,<br>
<br>
today I explored the posibilities and I would like to ask you questions.<br>
<br>
I modified the Line tool , so that it draws preview of the tool<br>
according the canvas widget.<br>
So there is code in paint like this:<br>
<br>
void KisToolLine::paintLine(QPainter&amp; gc, const QRect&amp;)<br>
{<br>
    if (m_canvas-&gt;canvasController()-&gt;isCanvasOpenGL()){<br>
        OpenGL code here...<br>
    }else ... {<br>
       QPainter stuff<br>
    }<br>
}<br>
<br>
I&#39;m asking you, should I use if&#39;s or make some interface with method<br>
paintOpenGL stuff and then<br>
call this paintOpenGL preview in OpenGL based canvas on every tool<br>
that will inherite from that interface?<br>
<br>
Or rather keep the style consistent with gradient tool preview and use<br>
#ifdefs (HAVE_OPENGL) etc. etc.?</blockquote><div><br>You need both without #if you \
can&#39;t compile it without the opengl libs installed and the isCanvasOpenGL as \
runtime switch.<br>I&#39;m wondering why you are changing the line tool. What preview \
do you mean? The brush for your gsoc shouldn&#39;t be needed in the line tool.<br> \
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> What can be a problem:<br>
some tools also need code in mouseMoveEvent etc. so I doin&#39;t know how<br>
to implement it nicely.<br>
There can be some math needed for painting previews specific for OpenGL \
canvas.</blockquote><div> <br>The tools don&#39;t have drawing code in the mouse move \
event. Actually you should only need to add code in the freehand tool.<br> \
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Then I have plan to add support \
for every paintop. Tool freehand will<br> ask for model from paintop and it will \
paint that model if the OpenGL<br> canvas is used.<br>
Every paintop will have it&#39;s obj file and user will set up in settings<br>
whether he wants to use brush outline or brush model or tool \
icon.</blockquote><div><br>I think it would be better to leave that to the paintop. \
Paintop need to have a model representation e.g. duplicate or deform.<br>Paintops \
could also override to provide custom stuff like bristle simulation.<br> \
</div></div><br>



_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic