toxi.sim.dla
Class RadialDistanceOrder

java.lang.Object
  extended by toxi.sim.dla.RadialDistanceOrder
All Implemented Interfaces:
java.util.Comparator<toxi.geom.Line3D>

public class RadialDistanceOrder
extends java.lang.Object
implements java.util.Comparator<toxi.geom.Line3D>

This comparator sorts segments based on their mid-point's distance to a given origin point. This creates a circular growth. The order can be reversed via a constructor flag and then causes the DLA system to grow from the outside towards the given origin point.


Field Summary
 boolean isFlipped
           
 toxi.geom.Vec3D origin
           
 
Constructor Summary
RadialDistanceOrder()
           
RadialDistanceOrder(toxi.geom.Vec3D origin, boolean isFlipped)
           
 
Method Summary
 int compare(toxi.geom.Line3D a, toxi.geom.Line3D b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

origin

public toxi.geom.Vec3D origin

isFlipped

public boolean isFlipped
Constructor Detail

RadialDistanceOrder

public RadialDistanceOrder()

RadialDistanceOrder

public RadialDistanceOrder(toxi.geom.Vec3D origin,
                           boolean isFlipped)
Method Detail

compare

public int compare(toxi.geom.Line3D a,
                   toxi.geom.Line3D b)
Specified by:
compare in interface java.util.Comparator<toxi.geom.Line3D>