问题描述
我试着写在WPF(.NET 4.0)的类似CAD的应用程序,需要能够显示很多2D点/线。它将被用于显示缩放整个城市的CAD图,平移,旋转和鼠标悬停点捕捉。
I'm trying to write an CAD-like application in WPF(.NET 4.0) that needs to be able to display a lot of 2D points/lines. It will be used to display CAD-plans of entire cities with zoom, pan, rotate and point snapping on mouseover.
现在,我纯粹是用WPF。我读了从CAD文件中的对象画成一个StreamGeometry,把它作为一个新的路径的行程,并将其添加到一个Canvas,有几个转换。
Right now I purely use WPF. I read the objects from the CAD file draw them into a StreamGeometry, use it as stroke of a new Path and add it to a Canvas, with several transforms.
我的问题是,这种解决方案不能很好地扩展不够。它工作正常,小的CAD文件,但是当我想要显示像半个城市(含房屋和土地的界限)是非常非常的延迟。
My problem is that this solution doesn't scale well enough. It works fine with small CAD-files, but when I want to display like half a city(with houses and land boundaries) it is very very delayed.
我也试过我的CAD文件转换为图像,但 - 一个一个32000x32000分辨率有时不够 - 缩小当线路太细
I also tried to convert my CAD-file to an image, but- a resolution a 32000x32000 is sometimes not enough- when zooming out the lines are too thin.
在最后,我需要能够把这个在画布(2D / 3D)作为背景。
In the end I need to be able to place this on a Canvas(2D/3D) as background.
什么是我最好的选择吗?
What are my best options here?
谢谢,尼克拉斯·
推荐答案
据我了解的主题是在WPF 2D CAD系统。大!我用它...
OpenGL和DirectX是无限循环的OnDraw始终。该CPU工作的所有时间。WPF / Silverlight的2D是聪明的模式。
是的,元素的总量(例如,原语从形状继承)必须是没有这么多。但究竟有多少?
我测试自己的应用程序(Silverlight的)。 WPF会更快一点,我希望...在这里,我的2D CAD结果。性能依然很大。每束由多个原语。
As I understand the subject is 2D CAD system within WPF.Great! I use it...
OpenGL and DirectX are in infinite loop OnDraw always. The CPU works all the time.WPF/Silverlight 2D is smart model.
Yes, total amount of elements (for example, primitives inherited from Shape) must be not so much. But how many?
I tested own app (Silverlight). WPF will be a bit faster I hope...Here my 2D CAD results. Performance is still great. Each beam consists of multiple primitives.
这篇关于在WPF二维CAD应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!