我应该如何将项目聚集到一个在图形上有意义的有序集合中?
我有一个应用程序,其中我将获得一个无序的项目集合(基本上可以表示为矩形的对象),并且需要根据它们的物理位置将它们放入更大的矩形形状(集群)。可能存在多个项目簇,并且某些项目可能单独位于一个簇中。
每个项目都知道哪个项目在其右侧(如果有)以及哪个项目在其下方(如果有)。因此,这些项目可以放置在 有向图
中并穿越了。
如何以图形方式显示所有项目?如果我将项目放入Graph
中,我应该如何遍历它?
I've got an an application wherein I will be provided with an unordered collection of items (objects that can basically be represented as rectangles) and need to put them into a larger rectangular shape (a cluster) based off of their physical location. There may be more than one cluster of items, and some items may be in a cluster by themselves.
Each item knows which item is to its right (if any) and which item is below it (if any). Thus the items could be placed in a Directed Graph
and traversed.
How can I display all of the items graphically? If I put the items in a Graph
, how should I traverse it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这听起来像是 PR QuadTree 的一个很好的用例:http://www.codeproject。 com/KB/recipes/QuadTree.aspx
This sounds like a good use case for the PR QuadTree: http://www.codeproject.com/KB/recipes/QuadTree.aspx
好吧,到目前为止我想出的最好的解决方案是使用 GraphSharp 库,尽管我还没有'尚未弄清楚如何自定义图形中
顶点
(项目)的外观。Well, the best solution I've come up with so far is to use the GraphSharp library, although I haven't yet figured out how to customize the look of the
Vertices
(items) in the graph.