节点编辑器链接的一些想法(连接) [英] Some ideas for a node-editors's links(connexions)

查看:91
本文介绍了节点编辑器链接的一些想法(连接)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我正在制作基于节点的编辑器(与3ds max,nuke,flowstone等相同的想法)。我现在要弄清楚的是如何绘制节点之间的连接(我的意思是我可以画一条直线,但我想要更多的东西优雅),更具体地说,当它们有很多节点和许多连接时我如何绘制它们。我试图找到一种方式,使他们不会彼此重叠或与节点重叠。我如何绘制它们(使用函数,一些寻路算法...)?



P.S.只是为了让自己更清楚一点,我试图避免像一个混乱,如这个 [ ^ ]



PS2我对创意更感兴趣而不是实际代码。

Hello guys! I am making a node-based editor(the same idea as in 3ds max, nuke, flowstone etc).What i am trying to figure out now is how to draw the connexions between the nodes(I mean I could just draw a straight line, but I want something more elegant), more specifically how do I draw them when they are many nodes and many connexions. I am trying to find a way such that they don't overlap one with each other or with the nodes. How do I draw them(with a function, some pathfinding algorithm...)?

P.S. Just to make myself a little more clear I'm trying to avoid a mess like this[^]

P.S.2 I am more interested in ideas rather than actual code.

推荐答案

简答:从查看开源GraphViz库提供的内容开始:[ ^ ]。 Google有一个适用于GraphViz的.NET包装器:[ ^ ]。注意:我没有直接使用GraphViz或它的.NET包装器。



我假设您确实意识到创建了您可能称之为最小静态的可视化表示形式对象关系的动态图形(父子,任意链接等)可能是一个主要项目,其复杂性可以根据对象的数量,它们的链接数量以及你想要的程度呈指数级增长使最终用户能够直接(鼠标,触摸,键盘)与视觉表示进行交互。



获得这种功能是人们支付大笔费用的原因
Short answer: start by looking at what the open-source GraphViz library offers: [^]. Google has a .NET wrapper for GraphViz: [^]. Note: I have not worked directly with GraphViz, or its .NET wrapper.

I assume you do realize that creating what you might call "minimum-static" visual representations of dynamic graphs of object relationships (parent-child, arbitrary linkages, etc.) is, potentially, a major project whose complexity can increase exponentially depending on the number of objects, the number of their linkages, and the extent to which you want to enable an end-user to interact directly (mouse, touch, keyboard) with the visual representation.

Getting that kind of functionality is why people pay big


用于像Nevron Diagram这样的组件。



视觉编程的许多原型也试图创建启用ui的功能通过拖放操作,通过直接操作(拖放,点击拖动等)创建(Nevron Diagram中称为端口和插件的链接)链接。



p roblem与许多这些实验(如1980年的Miller Puckette(后来的David Zicarelli)的Max for midi编程在Macintosh上)就是这么快,因为链接的复杂性增加,视觉表现成为一个管道噩梦:) Max a la Zicarelli 还活着:[ ^ ]!



我建议您首先搜索当前可用的开源图形/路由包,这些包可能会给您提供想法或可用代码:[ ^ ]。



对于C#? [ ^ ]。



另外,请注意CP有一个'算法论坛:[ ^ ]。
for components like Nevron Diagram.

It is also true that many prototypes of "visual programming" have made an attempt at creating ui's that enable this through drag/drop, creating (what in Nevron Diagram are called ports and plugs) linkages by direct action (drag-drop, click-drag, etc.).

The problem with many of these experiments (like the 1980's Miller Puckette's (later David Zicarelli's) Max for midi-programming on the Macintosh) is that all too soon, as complexity of linkages increases, the visual representation becomes a plumbing nightmare :) Max a la Zicarelli is still alive: [^] !

I suggest you start off by searching for currently available open-source graphing/routing packages that may give you ideas, or usable code: [^].

For C# ? [^].

Also, note that CP has an 'Algorithms forum: [^].


这篇关于节点编辑器链接的一些想法(连接)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆