资源简介
用java实现的delaunay三角剖分的生成算法,结构严谨,自己添加点后,随即变化对应的三角形化的图形

代码片段和文件信息
package delaunay;
/*
* Copyright (c) 2007 by L. Paul Chew.
*
* Permission is hereby granted without written agreement and without
* license or royalty fees to use copy modify and distribute this
* software and its documentation for any purpose subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS
* OR IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING
* FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
/**
* An ArrayList implementation of Set. An ArraySet is good for small sets; it
* has less overhead than a HashSet or a TreeSet.
*
* @author Paul Chew
*
* Created December 2007. For use with Voronoi/Delaunay applet.
*
*/
public class ArraySet extends AbstractSet {
private ArrayList items; // Items of the set
/**
* Create an empty set (default initial capacity is 3).
*/
public ArraySet () {
this(3);
}
/**
* Create an empty set with the specified initial capacity.
* @param initialCapacity the initial capacity
*/
public ArraySet (int initialCapacity) {
items = new ArrayList(initialCapacity);
}
/**
* Create a set containing the items of the collection. Any duplicate
* items are discarded.
* @param collection the source for the items of the small set
*/
public ArraySet (Collection extends E> collection) {
items = new ArrayList(collection.size());
for (E item: collection)
if (!items.contains(item)) items.add(item);
}
/**
* Get the item at the specified index.
* @param index where the item is located in the ListSet
* @return the item at the specified index
* @throws IndexOutOfBoundsException if the index is out of bounds
*/
public E get (int index) throws IndexOutOfBoundsException {
return items.get(index);
}
/**
* True iff any member of the collection is also in the ArraySet.
* @param collection the Collection to check
* @return true iff any member of collection appears in this ArraySet
*/
public boolean containsAny (Collection> collection) {
for (object item: collection)
if (this.contains(item)) return true;
return false;
}
@Override
public boolean add(E item) {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3269 2007-12-14 14:52 delaunay\ArraySet.java
文件 14597 2007-12-14 14:51 delaunay\DelaunayAp.java
文件 3825 2007-12-14 14:44 delaunay\Graph.java
文件 17519 2007-12-14 14:42 delaunay\Pnt.java
文件 5235 2007-12-14 14:44 delaunay\Triangle.java
文件 11137 2007-12-14 14:44 delaunay\Triangulation.java
目录 0 2013-02-19 16:19 delaunay\
相关资源
- 推荐算法的JAVA实现
- [免费]java实现有障碍物的贪吃蛇游戏
- 操作系统作业 (pv,作业管理,等5个
- 一元多项式相加 java实现
- java实现的svn统计修改代码行数完整源
- java实现小型函数画图板(附源代码、
- java实现的搜索引擎
- 数据库设备管理系统课程设计论文J
- Java实现的聊天室,具有群聊和私聊功
- java实现的网络五子棋
- java实现的QQ登录界面
- java实现POS系统源码
- 用Java实现TCP通信
- java实现验证码代码
- Java实现的公交查询系统代码
- 扫描二维码 JAVA实现20190403
- java实现软件锁屏功能
- java实现生成Excel默认.xls,可自己修改
- C#和Java实现互通的RSADES加解密算法
- JS实现AES-GCM加密,java实现AES-GCM解密。
- PDFBOX JAR包
- java实现Socket方式文件批量传输/上传到
- Java实现获取窗口句柄并操作窗口jna
- java实现websocket简单demo
- java实现输入任意两个日期输出月份数
- JAVA实现ICTCLAS2015分词
- 网上超市购物结算功能模拟 java实现
- 24点游戏Java实现
- java实现发送短信验证码功能
- java实现的水果忍者游戏
评论
共有 条评论