org.jcae.mesh.amibe.patch.tests
Class QuadTreeSampleNearest

java.lang.Object
  extended by org.jcae.mesh.amibe.patch.tests.QuadTreeSample
      extended by org.jcae.mesh.amibe.patch.tests.QuadTreeSampleNearest

public class QuadTreeSampleNearest
extends QuadTreeSample

Unit test to check detection of near vertices. Run

   QuadTreeSampleNearest
 
to display an initial QuadTree with 500 vertices. When clicking at a point, a yellow segment is displayed between this point and the nearest point found in the same cell, returned by KdTree.getNearVertex(Mesh, Vertex). If KdTree.getNearestVertex(Mesh, Vertex) finds a nearest point, a blue segment is displayed.


Field Summary
 
Fields inherited from class org.jcae.mesh.amibe.patch.tests.QuadTreeSample
quadtree
 
Constructor Summary
QuadTreeSampleNearest(KdTree q)
           
 
Method Summary
 Vertex2D getNearestVertex(Mesh2D mesh, Vertex2D n)
           
 Vertex2D getNearVertex(Mesh2D mesh, Vertex2D n)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class org.jcae.mesh.amibe.patch.tests.QuadTreeSample
bgQuadTree, bgVertices, segment, writeUNV
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadTreeSampleNearest

public QuadTreeSampleNearest(KdTree q)
Method Detail

getNearVertex

public Vertex2D getNearVertex(Mesh2D mesh,
                              Vertex2D n)

getNearestVertex

public Vertex2D getNearestVertex(Mesh2D mesh,
                                 Vertex2D n)

main

public static void main(java.lang.String[] args)