voronoi图的若干问题

本文详细介绍了如何使用VC++编写仿真环境,实现对WSNs中的LADPEC的仿真,并最终成功显示Voronoi图。通过对比LEDA、CGAL等图形库,作者解决了在不同编译环境下遇到的特定问题,包括避免生成帮助文件和解决Unicode相关错误。此过程涉及C++编程、图形库应用以及WSNs仿真技术。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

这两天,为了实现对WSNs中的LADPEC的仿真,用VC编写了仿真环境,最终还是想实现voronoi图的显示。但是在网上G了好久,都没有找到相关的VC++实现,不过意外发现几个图形库可以帮助实现相关的算法:

1. LEDA
LEDA是用C++写成的库,用来实现常见的数据结构及一些算法,主要涉及到以下几个方面图形及网络问题,计算几何,组合优化等。参考网站上的说法如下:
LEDA provides algorithmic in-depth knowledge in the field of graph- and network problems, geometric computations, combinatorial opimization and other. LEDA is implemented following the object-oriented approach.

2. CGAL
全称computational Geometry Algorithm Lib, 即计算几何算法库,好像已经包括了LEDA。

注意上面两个库原来都是针对Unix平台开发的,但是用的是STD模式,因此也可以支持不同的编译环境,包括MSVC。其中CGAL3.*以后的支持MS 的.NET开发,而LEDA包括三个版本,Free, Research 和Professional。

最终还是在pudn上下载了一个生成voronoi图的VC程序,不过是用.net即vc7.0写的。转换成vc6.0后遇到几个问题:
1. 编译总是显示error to find "c:\winnt\system32\cmd.exe"。莫名其妙,观察发现原来这个工程文件会生成*.hlp文件,用的是makehm.exe。估计是这个原因,在网上查找到一下,有人提出 “让VC不再编译帮助文件的方法”, 试着按照其方法手动修改*.dsp文件(用Editplus打开),问题解决;

2. error LNK2001: unresolved external symbol _WinMain@16
这个错误以前碰到过,是Unicode的问题,一种方法是在project->setting->c/c++->preprocessor->proprocessor defintions中去年_UNICODE;另一种方法是 在Project->Settings->Link选项下选择Output, 然后在Entry里输入:wWinMainCRTStartup即可。
LEDA是一个商业化的算法函数库,LEDA就是Library of Efficient Data structure and Algorithm一个常用ADT的C++实现,推荐下载。简介:LEDA is a library of the data types and algorithms of combinatorial computing. The main features are: LEDA provides a sizable collection of data types and algorithms in a form which allows them to be used by non-experts. In the current version, this collection includes most of the data types and algorithms described in the text books of the area. LEDA gives a precise and readable specification for each of the data types and algorithms mentioned above. The specifications are short (typically, not more than a page), general (so as to allow several implementations), and abstract (so as to hide all details of the implementation). For many efficient data structures access by position is important. In LEDA, we use an item concept to cast positions into an abstract form. We mention that most of the specifications given in the LEDA manual use this concept, i.e., the concept is adequate for the description of many data types. LEDA contains efficient implementations for each of the data types, e.g., Fibonacci heaps for priority queues, red-black trees and dynamic perfect hashing for dictionaries, ... LEDA contains a comfortable data type graph. It offers the standard iterations such as ``for all nodes v of a graph G do'' or ``for all neighbors w of v do'', it allows to add and delete vertices and edges, it offers arrays and matrices indexed by nodes and edges,... The data type graph allows to write programs for graph problems in a form close to the typical text book presentation. LEDA is implemented by a C++ class library. It can be used with almost any C++ compiler (g++, CC, xlC, cxx, Borland, MSVC++, Watcom). LEDA is not in the public domain, but can be used freely for academic research and teaching. A commercial license is also available.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值