edu.unh.sdb.datasource
Class SliceIterator

java.lang.Object
  extended by edu.unh.sdb.datasource.Slice
      extended by edu.unh.sdb.datasource.SliceIterator
All Implemented Interfaces:
SDBIterator, ObliquePlaneIteratorInterface

public class SliceIterator
extends Slice
implements ObliquePlaneIteratorInterface

It allows to 'iterate' a Slice along is normal vector, calculating the intersection with a Volume and reading data from a DataSource to fill that intersection.

Author:
dlipsa

Constructor Summary
SliceIterator(byte[] outsideColor, byte[] insideColor, Volume volume, Plane plane, DataSource dataSource)
           
 
Method Summary
 void end()
          Advance the iterator to the last valid value in the iteration.
 void init()
          Initialize the slice by allocating memory for the data to be read, seting the default transfer function and performing other initialisations This initialisation can be done once per iteration.
 boolean next()
          Advance the iterator by one step.
 void setSPCacheBlocks(boolean spBlockShape)
          Indicate to this iterator whether the underlying cache has blocks shaped according to the plane normal.
 boolean valid()
          Return true if the iterator currently has a valid value, false otherwise.
 
Methods inherited from class edu.unh.sdb.datasource.Slice
getBounds, getBytesPerTexel, getDataSource, getIntersection2d, getIntersection3d, getMaxProjectionAxis, getNormalArray, getPlane, getPlaneShapeArray, getSpaceBounds, getSpaceShapeArray, getTextureCoordinates, getTextureData, getTextureDimensions, getVolume, log, projectTuple, read, setDataSource, setGoodScanConversionOrder, setInsideColor, setOutsideColor, setPlane, setTransferFunction, setVertical, setVolume, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.unh.sdb.datasource.ObliquePlaneIteratorInterface
getDataSource, getNormalArray, getPlaneShapeArray, getSpaceBounds, getSpaceShapeArray, setDataSource
 

Constructor Detail

SliceIterator

public SliceIterator(byte[] outsideColor,
                     byte[] insideColor,
                     Volume volume,
                     Plane plane,
                     DataSource dataSource)
Method Detail

init

public void init()
Description copied from class: Slice
Initialize the slice by allocating memory for the data to be read, seting the default transfer function and performing other initialisations This initialisation can be done once per iteration. In an iteration the slice will slide along its normal until the entire volume will be traversed.

Specified by:
init in interface SDBIterator
Overrides:
init in class Slice

next

public boolean next()
Description copied from interface: SDBIterator
Advance the iterator by one step. If the iterator cannot be advanced to produce a valid value, the value of the iterator is undefined, but the next() method will return false, as will a subsequent call to valid().

Specified by:
next in interface SDBIterator

valid

public boolean valid()
Description copied from interface: SDBIterator
Return true if the iterator currently has a valid value, false otherwise.

Specified by:
valid in interface SDBIterator

end

public void end()
Description copied from interface: SDBIterator
Advance the iterator to the last valid value in the iteration. (optional operation)

Specified by:
end in interface SDBIterator

setSPCacheBlocks

public void setSPCacheBlocks(boolean spBlockShape)
Description copied from interface: ObliquePlaneIteratorInterface
Indicate to this iterator whether the underlying cache has blocks shaped according to the plane normal.

Specified by:
setSPCacheBlocks in interface ObliquePlaneIteratorInterface