Hi, I’m wondering if the R*Tree index of Sqlite could be used to implement GUI 
object hit testing?

Scenario: We have a 2D scene-graph for our GUI, which does an automatic layout 
of objects following the CSS grid idea. So, we build up the graph, run layout 
and get back the coordinates where to render things.

We could populate a r*tree table with (runtime-object-memory-pointer, x0, y0, 
x1, y0) pretty easy. Now the user clicks the mouse somewhere, and we would like 
to get back all rectangles that were hit. Since we don’t have any overlapping 
we could even sort the rectangles by size and get the whole tree-path to the 
leaf rectangle back.

Since we would implement a R*Tree anyway for hit testing and use Sqlite in our 
app, I can imagine that using it might really be nice here. IMO if everything 
is running in memory, this should be very efficient. We are talking maybe about 
5000 entries.

What do you think? Or maybe any experiences with such a setup?

-- 

Robert M. Münch, CEO
M: +41 79 65 11 49 6

Saphirion AG
smarter | better | faster

http://www.saphirion.com
http://www.nlpp.ch

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to