GTK application scene drawing

2014-08-02 Thread Gurjot Singh Bhatti
Hi all,

This may have been asked many times already but still if you people can
provide some guidance it'd be really helpful.

I am creating a 2D GTK application in which user can draw entities like
point, line, circle, ellipse, etc.

I have some experience working with QT. And in that I have QGraphicsView
and QScenegraph using which I can add items to the scene. The items here
would be those entities.

Now I wish to have something like this so that it'd be easier for me to
transit to GTK.

I know about GtkDrawingArea which can be used to draw with Cairo library.
But Cairo is still pretty limited as compared to Qt, with focus on the
entities/items.

I want that it'd be easier to work with these items in context of their
selection, modification, etc.

I heard about GooCanvas and Clutter.
GooCanvas is not in active development since few years, so that is ruled
out.
Then comes Clutter which I tried to use but could not understand how each
cairo drawing would be added as actors to the stage.

If there is some solution available for my problem then please suggest so.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK application scene drawing

2014-08-02 Thread Stefan Salewski
On Sun, 2014-08-03 at 00:21 +0530, Gurjot Singh Bhatti wrote:
> This may have been asked many times already

Yes, in the last years a have found a few similar questions with google,
in most cases not with VERY helpful replies.

I myself have used cairo with a GTK drawing area for my schematics tool,
and it was not a bad choice for that task: It gives me all the freedom I
need for that application, it looks fine and is fast enough -- I am not
sure if Ruby or cairo is currently more the limiting factor, I guess
both. (I am using bounding boxes for my objects and redraw only when
content has changed. http://www.ssalewski.de/PetEd.html.en)

I think your general conclusion is right, but you do not report about a
few important aspects: First, when you have already experience with Qt,
why do you not use QGraphicsView? I heard it is fine -- for C++ it may
be a good choice, for other languages you have to check if bindings are
available -- I think not for Rust or Ninrod, for Julia, Haskell I am not
sure.

One important aspect may be drawing performance. Cairo in not very fast
by default, I think OpenGl and multi-treading support is limited, at
least I found no nice examples for really fast drawing. And generally
OpenGl for GTK is not very well supported -- GTKGLEXT may work with
GTK3, but I am not sure and there is not much recent activity.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK application scene drawing

2014-08-02 Thread Gurjot Singh Bhatti
On 3 August 2014 02:01, Stefan Salewski  wrote:
>> This may have been asked many times already
>
> Yes, in the last years a have found a few similar questions with google,
> in most cases not with VERY helpful replies.

Exactly.

> I myself have used cairo with a GTK drawing area for my schematics tool,
> and it was not a bad choice for that task: It gives me all the freedom I
> need for that application, it looks fine and is fast enough -- I am not
> sure if Ruby or cairo is currently more the limiting factor, I guess
> both. (I am using bounding boxes for my objects and redraw only when
> content has changed. http://www.ssalewski.de/PetEd.html.en)

Your project looks nice. Is it open-source?
I have something similar in my mind in context to that Grid and
drawing entities.
But so far I am just able to draw points on my drawingArea and and now
working on how to detect if there is already a point under mouse. This
is because I want to draw line when 2 points are already drawn and I
select them.

> I think your general conclusion is right, but you do not report about a
> few important aspects: First, when you have already experience with Qt,
> why do you not use QGraphicsView? I heard it is fine -- for C++ it may
> be a good choice, for other languages you have to check if bindings are
> available -- I think not for Rust or Ninrod, for Julia, Haskell I am not
> sure.

Actually I am working on a GSoC project and Gtk is a requirement.

> One important aspect may be drawing performance. Cairo in not very fast
> by default, I think OpenGl and multi-treading support is limited, at
> least I found no nice examples for really fast drawing. And generally
> OpenGl for GTK is not very well supported -- GTKGLEXT may work with
> GTK3, but I am not sure and there is not much recent activity.

I guess since my application won't be so heavy, drawing performance
might not be an issue. But I am still figuring out how to do something
like Scene and its items.


-- 
Gurjot Singh Bhatti
Blog: http://bhattigurjot.wordpress.com

"It takes a person who is wide awake to make his dream come true." ~
Roger Babson
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list