开发者

Best canvas for drawing in wxPython?

开发者 https://www.devze.com 2022-12-20 23:12 出处:网络
I have to draw a graph of elements composing a topological model of a physical network. There would be nodes and arches, and the latter could be unidirectional or bidirectional.

I have to draw a graph of elements composing a topological model of a physical network. There would be nodes and arches, and the latter could be unidirectional or bidirectional.

I would like to capture the clicking events for the nodes and the arches (to select the element and show its properties somewhere), and 开发者_如何学JAVAthe dragging events for the nodes (to move them around) and arches (to connect or disconnect elements).

I've done some research and I've narrowed the alternatives down to OGL (Object Graphics Library) and FloatCanvas. I would not like to go down to the DrawingContext, but it is not discarded if necessary.

Which canvas option would you choose?


I've tried FloatCanvas, although there has been a lot of work to get everything to work. I've managed to get through mouse interaction things like connectivity, movement, automatic reconnection in case of movement, etc.

FloatCanvas is also quite nice in terms of performance and visual results. Anti-aliasing (1) (2) is also possible to improve them if necessary.


It seems that OGL is not being updated, and in general FloatCanvas looks more modern. I don't really know deeply enough the two options.

It seems that event capturing is easier with FloatCanvas. I would try to use it before OGL.

0

精彩评论

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

关注公众号