开发者

How to pick a vector graphics element quickly in lots of elements

开发者 https://www.devze.com 2023-01-27 06:20 出处:网络
How to quickly \"pick\" a 2d element in large number of vector graphics elements, such as polylines, polygons, curves etc.

How to quickly "pick" a 2d element in large number of vector graphics elements, such as polylines, polygons, curves etc. In Qt, QGraphics can do this easily, but In my program, I don't need this class, I just need QPaint and QWidget.I want to manage and render these elements data myself. So.. Which related graphics knowledge I need to se开发者_如何学编程arch in google?, BSP-tree?R-tree?

Give me some advice, Thanks!


Seems that an R-tree is more designed for picking than a BSP-tree. According to the wikipedia article on Spatial Indexing, R-tree is

Typically the preferred method for indexing spatial data. Objects (shapes, lines and points) are grouped using the minimum bounding rectangle (MBR). Objects are added to an MBR within the index that will lead to the smallest increase in its size.

But are you sure it's worth your while to implement the creation, maintenance, and use of the R-tree rather than using QGraphics?

0

精彩评论

暂无评论...
验证码 换一张
取 消