是否有一个好的图形布局库可以从 C++ 调用?

发布于 2024-08-27 06:27:34 字数 570 浏览 9 评论 0原文

(有向)图表示有限自动机。到目前为止,我的测试程序一直在写出点文件进行测试。这对于回归测试(将经过验证的输出文件保存在 subversion 中,询问它是否有更改)和可视化都非常好。然而,存在一些问题......

基本上,我想要一些可以从 C++ 调用的东西,它为我的状态和转换规划布局,但将绘图留给我 - 允许我随心所欲地绘制东西并在 GUI 上绘制的东西( wxWidgets)窗口。

我还想要一个允许商业使用的许可证 - 目前我不需要它,而且我很可能会作为开源发布,但我不想限制我的选择 ATM。

GraphViz 的问题是(1)关于在 Windows 上从源代码构建的警告,(2)渲染和解析的所有不必要的依赖项,以及(3)(假定)缺乏专门且纯粹用于布局的文档化 API。

基本上,我希望能够指定我的状态(带有边界矩形大小)和转换,并读出每个转换的状态和路径点的位置,然后根据这些坐标自己进行绘制。我还没有真正弄清楚应该如何处理过渡注释,但是应该有某种规定来指定这些注释的边界框大小,将它们与过渡相关联,并读出位置。

有谁知道可以满足这些要求的图书馆?

我不一定反对为自己实现某些东西,但在这种情况下,我宁愿尽可能避免它。

The (directed) graphs represent finite automata. Up until now my test program has been writing out dot files for testing. This is pretty good both for regression testing (keep the verified output files in subversion, ask it if there has been a change) and for visualisation. However, there are some problems...

Basically, I want something callable from C++ and which plans a layout for my states and transitions but leaves the drawing to me - something that will allow me to draw things however I want and draw on GUI (wxWidgets) windows.

I also want a license which will allow commercial use - I don't need that at present, and I may very well release as open source, but I don't want to limit my options ATM.

The problems with GraphViz are (1) the warnings about building from source on Windows, (2) all the unnecessary dependencies for rendering and parsing, and (3) the (presumed) lack of a documented API specifically and purely for layout.

Basically, I want to be able to specify my states (with bounding rectangle sizes) and transitions, and read out positions for the states and waypoints for each transition, then draw based on those co-ordinates myself. I haven't really figured out how annotations on transitions should be handled, but there should be some kind of provision for specifying bounding-box-sizes for those, associating them with transitions, and reading out positions.

Does anyone know of a library that can handle those requirements?

I'm not necessarily against implementing something for myself, but in this case I'd rather avoid it if possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

忘羡 2024-09-03 06:27:34

嗯,GDToolkit(或 GDT)看起来不错:教程中的许多图像 看起来很不错,而且使用起来也不是很复杂。

编辑:但是检查许可证,它看起来像是商业软件:-(。哎呀!

Hmm, GDToolkit (or GDT) looks okay: many of the images in the tutorial look pretty nice, and it doesn't look like it's terribly complicated to use.

Edit: But checking the license, it looks like it's commercial software :-(. Whoops!

蓝咒 2024-09-03 06:27:34

OGDF 受 GPL 约束。

Pigale 也受 GPL 约束。

GoVisual 是商业软件,但看起来对于一名开发人员来说起价为 1800 美元。

OGDF is under the GPL.

Pigale is also under the GPL.

GoVisual is commercial software, but it looks like it starts at $1800 for one developer.

就是爱搞怪 2024-09-03 06:27:34

今年早些时候我正在处理类似的问题。然而,决策的一个重要输入参数是预期的节点数量。

我决定使用浏览器作为 GUI,因此寻找不错的 Javascript 库,我遇到的一个是 wireit,它非常适合技术布局(也可以通过拖放和“动态”布局进行编辑)。你可以通过在线程中运行一个小型网络服务器来轻松地将其连接到你的c++(无论如何,你将需要某种用于GUI的事件循环/线程)。

好吧,只是我的 2 美分。

I was dealing with a similar problem earlier this year. One important input parameter for a decision however is the expected number of nodes.

I decided to use the Browser as the GUI and therefore looked for nice Javascript libraries, one i came across was wireit, it is very well suited for technical layouts (and also editing with drag and drop and "on the fly" layouting). You could easily connect that to your c++ by running a small webserver in a thread (You will need some kind of eventloop/thread thingie for GUI anyways).

Well just my 2 cents.

赠意 2024-09-03 06:27:34

尽管到目前为止的答案值得点赞,但我无法真正接受其中的任何一个。不过我仍然在寻找。

我发现的一件事是 AGLO。代码是 GPL v1,但有描述算法的论文,因此如果需要的话,应该很容易从头开始重新实现。

还有 Gansner、Koutsofios、North 和 Vo 撰写的论文 - “绘制有向图的技术” - 可从 获取在 Graphviz 网站上

我还仔细研究了 BSD 许可(但 Java)JGraph

不管怎样,看起来我可能会重新实现轮子,即使不是真正重新发明它。

Although the answers so far were worth an upvote, I can't really accept any of them. I've still been searching, though.

One thing I found is AGLO. The code is GPL v1, but there are papers that describe the algorithms, so it should be easy enough to re-implement from scratch if necessary.

There's also the paper by Gansner, Koutsofios, North and Vo - "A Technique for Drawing Directed Graphs" - available from here on the Graphviz site.

I've also been looking closely at the BSD-licensed (but Java) JGraph.

One way or the other, it looks like I might be re-implementing the wheel, if not actually re-inventing it.

红焚 2024-09-03 06:27:34

这是一个很好的图形库集合,具有比较和搜索功能:
http://gvsr.polytech.univ-nantes.fr/GVSR/ task?action=browse#

也许您找到了适合您的库。

Here is a good collection of Graph Libs with comparison and searching functionality:
http://gvsr.polytech.univ-nantes.fr/GVSR/task?action=browse#

Maybe you find a lib which fits for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文