阅读:2234回复:2
有java编写的 生成 约束 Delaunay三角网的代码
那位朋友 有 约束Delaunay三角网的 java实现代码阿 能给我一份吗 现在急需 ,其他语言的也可以。我的邮箱:<a href="mailtgaoyunshang@126.com" target="_blank" >gaoyunshang@126.com</A> 先谢谢了!
|
|
1楼#
发布于:2006-06-20 16:30
楼上的朋友 能留下你的地址吗 很想向你请教一些问题 我的qq: 18304445
|
|
2楼#
发布于:2006-06-14 14:58
<P>/**<BR> * ==============================================================<BR> * ArrayTest2.java: This java program demonstrates how to create<BR> * a list of triangle objects<BR> * <BR> * Uses: Triangle.java, Edge.java and Node.java<BR> * <BR> * ==============================================================<BR> */</P>
<P>import java.util.ArrayList;<BR>import java.util.Iterator;<BR>import java.util.List;</P> <P>public class ArrayTest2 {</P> <P> public static void main( String args[] ) {</P> <P> // Initialize linked list for triangles....</P> <P> List triangleList = new ArrayList();</P> <P> // Create triangle "A" ...</P> <P> Triangle tA = new Triangle();<BR> tA.sName = "A";</P> <P> tA.node1 = new Node();<BR> tA.node2 = new Node();<BR> tA.node3 = new Node();</P> <P> tA.node1.dX = 3.0; tA.node1.dY = 0.0; tA.node2.setName ("n1");<BR> tA.node2.dX = 3.0; tA.node2.dY = 4.0; tA.node3.setName ("n2");<BR> tA.node3.dX = 0.0; tA.node3.dY = 0.0; tA.node1.setName ("n3");</P> <P> tA.edge1 = new Edge( "e1", tA.node1, tA.node2 );<BR> tA.edge2 = new Edge( "e2", tA.node2, tA.node3 );<BR> tA.edge3 = new Edge( "e3", tA.node3, tA.node1 );</P> <P> // Create triangle "B" ...</P> <P> Triangle tB = new Triangle();<BR> tB.sName = "B";</P> <P> tB.node1 = new Node();<BR> tB.node2 = new Node();<BR> tB.node3 = new Node();</P> <P> tB.node1.dX = 1.0; tB.node1.dY = 0.0; tB.node2.setName ("n1");<BR> tB.node2.dX = 1.0; tB.node2.dY = 4.0; tB.node3.setName ("n2");<BR> tB.node3.dX = 1.0; tB.node3.dY = 1.0; tB.node1.setName ("n3");</P> <P> tB.edge1 = new Edge( "e1", tB.node1, tB.node2 );<BR> tB.edge2 = new Edge( "e2", tB.node2, tB.node3 );<BR> tB.edge3 = new Edge( "e3", tB.node3, tB.node1 );</P> <P> // Create triangle "C" ...</P> <P> Triangle tC = new Triangle();<BR> tC.sName = "C";</P> <P> tC.node1 = new Node();<BR> tC.node2 = new Node();<BR> tC.node3 = new Node();</P> <P> tC.node1.dX = 2.0; tC.node1.dY = 0.0; tC.node2.setName ("n1");<BR> tC.node2.dX = -1.0; tC.node2.dY = -4.0; tC.node3.setName ("n2");<BR> tC.node3.dX = 2.0; tC.node3.dY = -1.0; tC.node1.setName ("n3");</P> <P> tC.edge1 = new Edge( "e1", tC.node1, tC.node2 );<BR> tC.edge2 = new Edge( "e2", tC.node2, tC.node3 );<BR> tC.edge3 = new Edge( "e3", tC.node3, tC.node1 );</P> <P> // Add triangle objects to list .. A, C ... and then B</P> <P> triangleList.add( tA );<BR> triangleList.add( tC );<BR> triangleList.add( tB );</P> <P> // Print details of triangle objects...</P> <P> System.out.println("Print triangles " );<BR> System.out.println("=================================" );</P> <P> Iterator iterator1 = triangleList.iterator();<BR> while ( iterator1.hasNext() != false ) {<BR> Triangle tp = (Triangle) iterator1.next();<BR> System.out.println( tp.toString() );<BR> }<BR> }<BR>}<BR></P> |
|
|