de.grogra.vecmath.geom
Class DefaultCellIterator

java.lang.Object
  extended by de.grogra.vecmath.geom.DefaultCellIterator
All Implemented Interfaces:
CellIterator, java.lang.Cloneable, java.util.Iterator<Octree.Cell>

public class DefaultCellIterator
extends java.lang.Object
implements CellIterator, java.lang.Cloneable


Constructor Summary
DefaultCellIterator()
           
 
Method Summary
 CellIterator dup()
          Returns a clone of this CellIterator.
 double getEnteringParameter()
          Returns the parameter at which the current cell was entered.
 boolean hasNext()
           
protected  boolean hasNextImpl()
           
 void initialize(Octree tree)
          This method has to be invoked once to initialize the iterator for a given octree.
 Octree.Cell next()
           
 void remove()
           
 void setLine(Line line)
          This method has to invoked in order to start a new iteration sequence over the octree cells which intersect line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCellIterator

public DefaultCellIterator()
Method Detail

dup

public CellIterator dup()
Description copied from interface: CellIterator
Returns a clone of this CellIterator. All constant variables which are related to the structure of the octree are copied shallowly, state variables of the iterator are newly created without copying.

Specified by:
dup in interface CellIterator
Returns:
clone of this iterator

getEnteringParameter

public double getEnteringParameter()
Description copied from interface: CellIterator
Returns the parameter at which the current cell was entered. The current cell is the returned cell of the most recent invocation of #nextCell(). This cell is entered at the position line.start + parameter * line.direction.

Specified by:
getEnteringParameter in interface CellIterator
Returns:
line parameter where current cell was entered

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<Octree.Cell>

hasNextImpl

protected boolean hasNextImpl()

initialize

public void initialize(Octree tree)
Description copied from interface: CellIterator
This method has to be invoked once to initialize the iterator for a given octree.

Specified by:
initialize in interface CellIterator
Parameters:
tree - the octree

next

public Octree.Cell next()
Specified by:
next in interface java.util.Iterator<Octree.Cell>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<Octree.Cell>

setLine

public void setLine(Line line)
Description copied from interface: CellIterator
This method has to invoked in order to start a new iteration sequence over the octree cells which intersect line.

Specified by:
setLine in interface CellIterator
Parameters:
line - the line for which octree cells shall be enumerated